本文整理汇总了C++中ArgumentList::set方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentList::set方法的具体用法?C++ ArgumentList::set怎么用?C++ ArgumentList::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentList
的用法示例。
在下文中一共展示了ArgumentList::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
// The QApplication will strip its args from argc/argv, so we want to do
// this before putting the command-line args into our ArgumentList, or we
// will try to open the Qt args as data files.
QApplication app(argc, argv);
SystemServicesImp::instance()->WriteLogInfo(QString("%1 Startup").arg(APP_NAME).toStdString());
// Register the command line options
ArgumentList* pArgumentList = ArgumentList::instance();
if (pArgumentList == NULL)
{
SystemServicesImp::instance()->WriteLogInfo(QString("%1 Shutdown").arg(APP_NAME).toStdString());
return -1;
}
pArgumentList->registerOption("input");
pArgumentList->registerOption("deployment");
pArgumentList->registerOption("debugDeployment");
pArgumentList->registerOption("exitAfterWizards");
pArgumentList->registerOption("generate");
pArgumentList->registerOption("processors");
pArgumentList->registerOption("");
pArgumentList->set(argc, argv);
// Run the application
InteractiveApplication interactiveApp(app);
int success = interactiveApp.run(argc, argv);
SystemServicesImp::instance()->WriteLogInfo(QString("%1 Shutdown").arg(APP_NAME).toStdString());
return success;
}
示例2: postControlAction
bool Action::postControlAction() {
ArgumentList *actionArgList = getArgumentList();
ArgumentList *actionInputArgList = getInputArgumentList();
ActionRequest ctrlReq;
ctrlReq.setRequest(this, actionInputArgList);
if (Debug::isOn() == true)
ctrlReq.print();
ActionResponse *ctrlRes = new ActionResponse();
ctrlReq.post(ctrlRes);
if (Debug::isOn() == true)
ctrlRes->print();
setControlResponse(ctrlRes);
// Thanks for Dimas <[email protected]> and Stefano Lenzi <[email protected]> (07/09/04)
int statCode = ctrlRes->getStatusCode();
setStatus(statCode);
if (ctrlRes->isSuccessful() == false)
return false;
ArgumentList *outArgList = ctrlRes->getResponse();
actionArgList->set(outArgList);
return true;
}