本文整理汇总了C++中SystemInfo::isUserAdmin方法的典型用法代码示例。如果您正苦于以下问题:C++ SystemInfo::isUserAdmin方法的具体用法?C++ SystemInfo::isUserAdmin怎么用?C++ SystemInfo::isUserAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SystemInfo
的用法示例。
在下文中一共展示了SystemInfo::isUserAdmin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xTMAIN
//.........这里部分代码省略.........
<< xTRACE_VAR(application.name()) << xT("\n")
<< xTRACE_VAR(application.decription()) << xT("\n")
<< xTRACE_VAR(application.usage()) << xT("\n")
<< xTRACE_VAR(application.help()) << xT("\n")
<< xTRACE_VAR(application.copyrightYears()) << xT("\n")
<< xTRACE_VAR(application.versionMajor()) << xT("\n")
<< xTRACE_VAR(application.versionMinor()) << xT("\n")
<< xTRACE_VAR(application.versionPatch()) << xT("\n")
<< xTRACE_VAR(application.versionType()) << xT("\n")
<< xTRACE_VAR(application.versionRevision()) << xT("\n")
<< xTRACE_VAR(application.vendorName()) << xT("\n")
<< xTRACE_VAR(application.vendorDomain()) << xT("\n")
<< xTRACE_VAR(application.vendorAuthor()) << xT("\n")
<< xTRACE_VAR(application.vendorUrl()) << xT("\n")
<< xTRACE_VAR(application.vendorEmail()) << xT("\n")
<< xTRACE_VAR(application.vendorSkype());
#endif
application.setOnSignals(signalNums, SignalFunctor::onSignals);
application.setOnTerminate(SignalFunctor::onTerminate);
application.setOnExit(SignalFunctor::onExit);
// test error
TestFail testFail;
testFail.foo3();
#endif
}
#if xOPTION_TESTS
// checks
{
#if xENV_UNIX
SystemInfo info;
xCHECK_MSG_RET(info.isUserAdmin(), xT("xLib_test: Can't run as root"), EXIT_FAILURE);
#endif
}
// options (default)
bool_t isUseTracing = true;
ulonglong_t allLoops = 1ULL;
ulonglong_t unitLoops = 1ULL;
ulonglong_t caseLoops = 1ULL;
{
std::vec_tstring_t args;
ProcessInfo info;
info.setProcessId(Process::currentId());
info.commandLine(&args);
if (a_argsNum == 1) {
// OK, run tests with default params
}
else if (a_argsNum == 2) {
// usage
bool_t bRv = StringCI::compare(xT("-h"), args.at(1)) ||
StringCI::compare(xT("--help"), args.at(1));
if (!bRv) {
std::tcout << xT("\nxLib_test: unknown switches\n") << std::endl;
} else {
std::tcout << xT("\nUsage: ./xLib_test [is_tracing] [all_loops] [unit_loops]\n")
xT(" - xLib_test (binary file path)\n")
xT(" - is_tracing (is tracing)\n")
xT(" - all_loops (loops for all tests)\n")
xT(" - unit_loops (loops for unit test)\n")
xT(" - case_loops (loops for case test)\n") << std::endl;
}