本文整理汇总了C++中PathName::GetFileNameWithoutExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ PathName::GetFileNameWithoutExtension方法的具体用法?C++ PathName::GetFileNameWithoutExtension怎么用?C++ PathName::GetFileNameWithoutExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathName
的用法示例。
在下文中一共展示了PathName::GetFileNameWithoutExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strstr
void
SessionImpl::Initialize (/*[in]*/ const Session::InitInfo & initInfo)
{
string val;
PathName programInvocationName = initInfo.GetProgramInvocationName();
programInvocationName = programInvocationName.GetFileNameWithoutExtension();
const char * lpsz = strstr(programInvocationName.Get(), MIKTEX_ADMIN_SUFFIX);
bool forceAdminMode =
(lpsz != 0 && strlen(lpsz) == strlen(MIKTEX_ADMIN_SUFFIX));
#if defined(MIKTEX_WINDOWS)
if (! forceAdminMode)
{
programInvocationName =
GetMyProgramFile(false).Normalize().GetFileNameWithoutExtension().Get();
lpsz = strstr(programInvocationName.Get(), MIKTEX_ADMIN_SUFFIX);
forceAdminMode =
(lpsz != 0 && strlen(lpsz) == strlen(MIKTEX_ADMIN_SUFFIX));
}
#endif
bool oldAdminMode = adminMode;
if (forceAdminMode)
{
adminMode = true;
}
else
{
adminMode = ((initInfo.GetFlags() & InitFlags::AdminMode) != 0);
}
#if defined(_MSC_VER)
if (Utils::GetEnvironmentString("MIKTEX_DEBUG_ON_STD_EXCEPTION", val))
{
debugOnStdException = atoi(val.c_str());
}
#endif
// check minimum system requirements (which is Windows 2000 atm)
#if defined(MIKTEX_WINDOWS) && ! defined(MIKTEX_SUPPORT_LEGACY_WINDOWS)
DWORD version = GetVersion();
bool nt = version < 0x80000000;
DWORD major = LOBYTE(LOWORD(version));
DWORD minor = HIBYTE(LOWORD(version));
if ((! nt) // Windows 9x/Me
|| (major < 5)) // Windows NT 3.x/4.x
{
string msg = T_("Unsupported operation system version (");
if (nt)
{
msg += "NT ";
}
msg += NUMTOSTR(major);
msg += ".";
msg += NUMTOSTR(minor);
msg += ").";
FATAL_MIKTEX_ERROR ("SessionImpl::Initialize",
msg.c_str(),
0);
}
#endif
if (initInfo.GetSizeOfStruct() != sizeof(initInfo))
{
INVALID_ARGUMENT ("SessionImpl::Initialize", 0);
}
#if defined(MIKTEX_WINDOWS)
if ((initInfo.GetFlags() & InitFlags::InitializeCOM) != 0)
{
MyCoInitialize ();
}
#endif
Botan::LibraryInitializer::initialize ();
initialized = true;
this->initInfo = initInfo;
theNameOfTheGame = initInfo.GetTheNameOfTheGame();
RegisterLibraryTraceStreams ();
// enable trace streams
string traceOptions;
traceOptions = initInfo.GetTraceFlags();
if (traceOptions.empty())
{
Utils::GetEnvironmentString (MIKTEX_ENV_TRACE, traceOptions);
}
#if defined(MIKTEX_WINDOWS)
if (traceOptions.empty()
&& (initInfo.GetFlags() & InitFlags::NoConfigFiles) == 0)
{
if (! winRegistry::TryGetRegistryValue(TriState::False,
MIKTEX_REGKEY_CORE,
MIKTEX_REGVAL_TRACE,
//.........这里部分代码省略.........