本文整理汇总了C++中CommandLine::HasSwitch方法的典型用法代码示例。如果您正苦于以下问题:C++ CommandLine::HasSwitch方法的具体用法?C++ CommandLine::HasSwitch怎么用?C++ CommandLine::HasSwitch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandLine
的用法示例。
在下文中一共展示了CommandLine::HasSwitch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupCRT
void SetupCRT(const CommandLine& parsed_command_line) {
#if defined(OS_WIN)
#ifdef _CRTDBG_MAP_ALLOC
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
#else
if (!parsed_command_line.HasSwitch(switches::kDisableBreakpad)) {
_CrtSetReportMode(_CRT_ASSERT, 0);
}
#endif
// Enable the low fragmentation heap for the CRT heap. The heap is not changed
// if the process is run under the debugger is enabled or if certain gflags
// are set.
bool use_lfh = false;
if (parsed_command_line.HasSwitch(switches::kUseLowFragHeapCrt))
use_lfh = parsed_command_line.GetSwitchValue(switches::kUseLowFragHeapCrt)
!= L"false";
if (use_lfh) {
void* crt_heap = reinterpret_cast<void*>(_get_heap_handle());
ULONG enable_lfh = 2;
HeapSetInformation(crt_heap, HeapCompatibilityInformation,
&enable_lfh, sizeof(enable_lfh));
}
#endif
}
示例2: CopySwitchesFrom
void CommandLine::CopySwitchesFrom(const CommandLine& source,
const char* const switches[],
size_t count) {
for (size_t i = 0; i < count; ++i) {
if (source.HasSwitch(switches[i]))
AppendSwitchNative(switches[i], source.GetSwitchValueNative(switches[i]));
}
}
示例3: getApplicationLocale
std::string WebEngineLibraryInfo::getApplicationLocale()
{
CommandLine *parsedCommandLine = CommandLine::ForCurrentProcess();
if (!parsedCommandLine->HasSwitch(switches::kLang))
return QLocale().bcp47Name().toStdString();
return parsedCommandLine->GetSwitchValueASCII(switches::kLang);
}