本文整理汇总了C++中PathName::Canonicalize方法的典型用法代码示例。如果您正苦于以下问题:C++ PathName::Canonicalize方法的具体用法?C++ PathName::Canonicalize怎么用?C++ PathName::Canonicalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathName
的用法示例。
在下文中一共展示了PathName::Canonicalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
case FileType::ENC:
RegisterFileType (
FileType::ENC,
"enc",
0,
".enc",
P6_(CURRENT_DIRECTORY,
R_(MIKTEX_PATH_ENC_DIR),
R_(MIKTEX_PATH_MIKTEX_CONFIG_DIR),
R_(MIKTEX_PATH_DVIPS_DIR),
R_(MIKTEX_PATH_PDFTEX_DIR),
R_(MIKTEX_PATH_DVIPDFM_DIR)),
P2_("ENCFONTS", "TEXFONTS"));
break;
case FileType::EXE:
#if defined(MIKTEX_WINDOWS)
case FileType::WindowsCommandScriptFile:
#endif
{
string extensions;
#if defined(MIKTEX_WINDOWS)
if (! Utils::GetEnvironmentString("PATHEXT", extensions)
|| extensions.empty())
{
extensions = P3_(".com",".exe", ".bat");
}
#elif defined(MIKTEX_EXE_FILE_SUFFIX)
extensions = MIKTEX_EXE_FILE_SUFFIX;
#endif
string exePath;
PathName userBinDir = GetSpecialPath(SpecialPath::UserInstallRoot);
userBinDir += MIKTEX_PATH_BIN_DIR;
userBinDir.Canonicalize ();
if (! IsAdminMode()
&& ! Utils::Contains(exePath.c_str(),
userBinDir.Get(),
PATH_DELIMITER_STRING))
{
if (! exePath.empty())
{
exePath += PATH_DELIMITER;
}
exePath += userBinDir.Get();
}
PathName commonBinDir = GetSpecialPath(SpecialPath::CommonInstallRoot);
commonBinDir += MIKTEX_PATH_BIN_DIR;
commonBinDir.Canonicalize ();
if (! Utils::Contains(exePath.c_str(),
commonBinDir.Get(),
PATH_DELIMITER_STRING))
{
if (! exePath.empty())
{
exePath += PATH_DELIMITER;
}
exePath += commonBinDir.Get();
}
string str;
if (Utils::GetEnvironmentString(MIKTEX_ENV_BIN_DIR, str))
{
PathName binDir = str;
binDir.Canonicalize ();
if (! Utils::Contains(exePath.c_str(),
binDir.Get(),
PATH_DELIMITER_STRING))