当前位置: 首页>>代码示例>>C++>>正文


C++ OptionSet类代码示例

本文整理汇总了C++中OptionSet的典型用法代码示例。如果您正苦于以下问题:C++ OptionSet类的具体用法?C++ OptionSet怎么用?C++ OptionSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OptionSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: defineOptions

	void defineOptions(OptionSet& options) {
		ServerApplication::defineOptions(options);

		options.addOption(
			Option("log", "l", "Log level argument, must be beetween 0 and 8 : nothing, fatal, critic, error, warn, note, info, debug, trace. Default value is 6 (info), all logs until info level are displayed.")
				.required(false)
				.argument("level")
				.repeatable(false));

		options.addOption(
			Option("dump", "d", "Enables packet traces in logs. Optional arguments are 'middle' or 'all' respectively to displays just middle packet process or all packet process. If no argument is given, just outside packet process will be dumped.",false,"middle|all",false)
				.repeatable(false));

		options.addOption(
			Option("cirrus", "c", "Cirrus address to activate a 'man-in-the-middle' developer mode in bypassing flash packets to the official cirrus server of your choice, it's a instable mode to help Cumulus developers, \"p2p.rtmfp.net:10000\" for example. By adding the 'dump' argument, you will able to display Cirrus/Flash packet exchange in your logs (see 'dump' argument).",false,"address",true)
				.repeatable(false));

		options.addOption(
			Option("middle", "m","Enables a 'man-in-the-middle' developer mode between two peers. It's a instable mode to help Cumulus developers. By adding the 'dump' argument, you will able to display Flash/Flash packet exchange in your logs (see 'dump' argument).")
				.repeatable(false));

		options.addOption(
			Option("help", "h", "Displays help information about command-line usage.")
				.required(false)
				.repeatable(false));
	}
开发者ID:arpu,项目名称:Cumulus,代码行数:26,代码来源:main.cpp

示例2: defineOptions

void check_ortho::defineOptions(OptionSet& options)
{
	Application::defineOptions(options);

	options.addOption(
		Option("help", "h", "mostra le informazioni sui parametri da specificare")
			.required(false)
			.repeatable(false)
			.callback(OptionCallback<check_ortho>(this, &check_ortho::handleHelp)));

		
	options.addOption(
		Option("dir", "d", "Specifica la cartella del progetto")
			.required(false)
			.repeatable(false)
			.argument("value")
			.callback(OptionCallback<check_ortho>(this, &check_ortho::handlePrjDir)));
	
	options.addOption(
		Option("img", "i", "Specifica la cartella delle ortho immagini")
			.required(false)
			.repeatable(false)
			.argument("value")
			.callback(OptionCallback<check_ortho>(this, &check_ortho::handleImgDir)));
	
	//options.addOption(
	//	Option("scale", "s", "Specifica la scala di lavoro")
	//		.required(false)
	//		.repeatable(false)
	//		.argument("value")
	//		.callback(OptionCallback<check_ortho>(this, &check_ortho::handleScale)));
}
开发者ID:geoin,项目名称:ControlloVoliRT,代码行数:32,代码来源:check_ortho.cpp

示例3: defineOptions

void BeeServer::defineOptions(OptionSet& options)
{
	ServerApplication::defineOptions(options);

	options.addOption(
		Option("help", "h", "display help information on command line arguments")
		.required(false)
		.repeatable(false)
		.callback(OptionCallback<BeeServer>(this, &BeeServer::handleHelp)));

	options.addOption(
		Option("stop", "stop", "stop process.")
		.required(false)
		.repeatable(false)
		.argument("taskids w/o arguments", false)
		.callback(OptionCallback<BeeServer>(this, &BeeServer::stop)));

	options.addOption(
		Option("start", "start", "start process.")
		.required(false)
		.repeatable(false)
		.argument("taskids w/o arguments", false)
		.callback(OptionCallback<BeeServer>(this, &BeeServer::start)));

	options.addOption(
		Option("query", "q", "query process state.")
		.required(false)
		.repeatable(false)
		.argument("taskids w/o arguments", false)
		.callback(OptionCallback<BeeServer>(this, &BeeServer::query)));
}
开发者ID:hellowego,项目名称:BEE,代码行数:31,代码来源:BeeServer.cpp

示例4: defineOptions

	void defineOptions(OptionSet& options)
	{
		Application::defineOptions(options);

		options.addOption(
			Option("help", "h", "display help information on command line arguments")
				.required(false)
				.repeatable(false)
				.callback(OptionCallback<TweetApp>(this, &TweetApp::handleHelp)));

		options.addOption(
			Option("username", "u", "specify the Twitter user/account name")
				.required(true)
				.repeatable(false)
				.argument("account")
				.callback(OptionCallback<TweetApp>(this, &TweetApp::handleUsername)));
				
		options.addOption(
			Option("password", "p", "specify the Twitter password")
				.required(true)
				.repeatable(false)
				.argument("password")
				.callback(OptionCallback<TweetApp>(this, &TweetApp::handlePassword)));

		options.addOption(
			Option("message", "m", "specify the status message")
				.required(false)
				.repeatable(true)
				.argument("message")
				.callback(OptionCallback<TweetApp>(this, &TweetApp::handleMessage)));
	}
开发者ID:119,项目名称:vdc,代码行数:31,代码来源:TweetApp.cpp

示例5: defineOptions

	void defineOptions(OptionSet& options)
	{
		Application::defineOptions(options);

		options.addOption(
			Option("help", "h", "display help information on command line arguments")
				.required(false)
				.repeatable(false)
				.callback(OptionCallback<configuracao>(this, &configuracao::handleHelp)));

		options.addOption(
			Option("define", "D", "define a configuration property")
				.required(false)
				.repeatable(true)
				.argument("name=value")
				.callback(OptionCallback<configuracao>(this, &configuracao::handleDefine)));
				
		options.addOption(
			Option("config-file", "f", "load configuration data from a file")
				.required(false)
				.repeatable(true)
				.argument("file")
				.callback(OptionCallback<configuracao>(this, &configuracao::handleConfig)));

		options.addOption(
			Option("bind", "b", "bind option value to test.property")
				.required(false)
				.repeatable(false)
				.argument("value")
				.binding("test.property"));
	}
开发者ID:leandrocprates,项目名称:projecteste,代码行数:31,代码来源:configuracao.cpp

示例6: defineOptions

	void defineOptions(OptionSet& options)
	{
		ServerApplication::defineOptions(options);

		options.addOption(
			Option("help", "h", "display help information on command line arguments")
				.required(false)
				.repeatable(false)
				.callback(OptionCallback<FileTransferApp>(this, &FileTransferApp::handleHelp)));
		options.addOption(
			Option("server", "S", "running in server mode")
				.required(false)
				.repeatable(false)
				.callback(OptionCallback<FileTransferApp>(this, &FileTransferApp::startServer)));
		options.addOption(
			Option("host", "H", "IP of FileTransfer server")
				.required(false)
				.repeatable(false)
				.argument("IP address (x.x.x.x)")
				.callback(OptionCallback<FileTransferApp>(this, &FileTransferApp::setHost)));
		options.addOption(
			Option("port", "P", "Port of FileTransfer server")
				.required(false)
				.repeatable(false)
				.argument("port number")
				.callback(OptionCallback<FileTransferApp>(this, &FileTransferApp::setPort)));
		options.addOption(
			Option("file", "F", "file path to transfer")
				.required(false)
				.repeatable(false)
				.argument("file")
				.callback(OptionCallback<FileTransferApp>(this, &FileTransferApp::setFile)));
	}
开发者ID:lulurun,项目名称:fanni,代码行数:33,代码来源:FileTransferApp.cpp

示例7: defineOptions

	void defineOptions(OptionSet& options)
	{
		Application::defineOptions(options);

		options.addOption(
			Option("help", "h", "Display help information on command line arguments.")
				.required(false)
				.repeatable(false)
				.callback(OptionCallback<Un7zipApp>(this, &Un7zipApp::handleHelp)));

		options.addOption(
			Option("output", "o", "Specify base directory for extracted files.")
				.required(false)
				.repeatable(false)
				.argument("path")
				.callback(OptionCallback<Un7zipApp>(this, &Un7zipApp::handleOutput)));
				
		options.addOption(
			Option("list", "l", "List files and directories in archive.")
				.required(false)
				.repeatable(false)
				.callback(OptionCallback<Un7zipApp>(this, &Un7zipApp::handleList)));

		options.addOption(
			Option("extract", "x", "Extract single file or entire archive.")
				.required(false)
				.repeatable(false)
				.argument("file", false)
				.callback(OptionCallback<Un7zipApp>(this, &Un7zipApp::handleExtract)));
	}
开发者ID:micheleselea,项目名称:poco,代码行数:30,代码来源:un7zip.cpp

示例8: FillMissingOptionDefaults

void FillMissingOptionDefaults() {
    OptionSet* options = OptionSet::getOptions(SIRIKATA_OPTIONS_MODULE,NULL);

    // Parse command line once to make sure we have the right config
    // file. On this pass, use defaults so everything gets filled in.
    options->fillMissingDefaults();
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:7,代码来源:CommonOptions.cpp

示例9: ToolMain

ToolResult ToolMain( OptionSet& options, istream& in, ostream& out )
{
  ToolResult result = noError;
  string transmissionList = options.getopt( "-t|-T|--transmit", "spd" );
  bool transmitStates = ( transmissionList.find_first_of( "sS" ) != string::npos ),
       transmitParameters = ( transmissionList.find_first_of( "pP" ) != string::npos ),
       transmitData = ( transmissionList.find_first_of( "dD" ) != string::npos ),
       calibrateData = !options.findopt( "-r|-R|--raw" );
  string paramFileName = options.getopt( "-p|-P|--parameters", "" );
  string offsetString = options.getopt( "-s|-S|--start", "" );
  string durationString = options.getopt( "-d|-D|--duration", "" );

  // Read the BCI2000 header.
  string token;
  int headerLength,
      sourceCh,
      stateVectorLength;
  SignalType dataFormat;
  StateList states;
  enum { v10, v11 } fileFormatVersion = v10;

  bool legalInput = in >> token;
  if( legalInput && token == "BCI2000V=" )
  {
    legalInput = legalInput &&
      in >> token;
    if( token == "1.1" )
      fileFormatVersion = v11;
    else
      legalInput = false;
    legalInput = legalInput &&
      in >> token;
  }
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:33,代码来源:bci_dat2stream.cpp

示例10: LocationUpdatePolicy

AlwaysLocationUpdatePolicy::AlwaysLocationUpdatePolicy(const String& args)
    : LocationUpdatePolicy(),
      mServerSubscriptions(this),
      mObjectSubscriptions(this)
{
    OptionSet* optionsSet = OptionSet::getOptions(ALWAYS_POLICY_OPTIONS,NULL);
    optionsSet->parse(args);
}
开发者ID:LittleForker,项目名称:sirikata,代码行数:8,代码来源:AlwaysLocationUpdatePolicy.cpp

示例11: createCassandraStorage

static OH::Storage* createCassandraStorage(ObjectHostContext* ctx, const String& args) {
    OptionSet* optionsSet = OptionSet::getOptions("cassandrastorage",NULL);
    optionsSet->parse(args);

    String host = optionsSet->referenceOption("host")->as<String>();
    int32 port = optionsSet->referenceOption("port")->as<int32>();

    return new OH::CassandraStorage(ctx, host, port);
}
开发者ID:pathorn,项目名称:sirikata,代码行数:9,代码来源:PluginInterface.cpp

示例12: createCassandraPersistedObjectSet

static OH::PersistedObjectSet* createCassandraPersistedObjectSet(ObjectHostContext* ctx, const String& args) {
    OptionSet* optionsSet = OptionSet::getOptions("cassandrapersistedset",NULL);
    optionsSet->parse(args);

    String host = optionsSet->referenceOption("host")->as<String>();
    int32 port = optionsSet->referenceOption("port")->as<int32>();
    String ohid = optionsSet->referenceOption("ohid")->as<String>();

    return new OH::CassandraPersistedObjectSet(ctx, host, port, ohid);
}
开发者ID:pathorn,项目名称:sirikata,代码行数:10,代码来源:PluginInterface.cpp

示例13: createCassandraObjectFactory

static ObjectFactory* createCassandraObjectFactory(ObjectHostContext* ctx, ObjectHost* oh, const SpaceID& space, const String& args) {
    OptionSet* optionsSet = OptionSet::getOptions("cassandrafactory",NULL);
    optionsSet->parse(args);

    String host = optionsSet->referenceOption("host")->as<String>();
    int32 port = optionsSet->referenceOption("port")->as<int32>();
    String ohid = optionsSet->referenceOption("ohid")->as<String>();

    return new CassandraObjectFactory(ctx, oh, space, host, port, ohid);
}
开发者ID:pathorn,项目名称:sirikata,代码行数:10,代码来源:PluginInterface.cpp

示例14: ico

SaveFilter::SaveFilter(const String& args) {
    Sirikata::InitializeClassOptions ico("save_filter", NULL,
        new OptionValue("filename","",Sirikata::OptionValueType<String>(),"Name of file to save to."),
        new OptionValue("format","colladamodels",Sirikata::OptionValueType<String>(),"Format to save to."),
        NULL);

    OptionSet* optionSet = OptionSet::getOptions("save_filter",NULL);
    optionSet->parse(args);

    mFilename = optionSet->referenceOption("filename")->as<String>();
    mFormat = optionSet->referenceOption("format")->as<String>();
}
开发者ID:pathorn,项目名称:sirikata,代码行数:12,代码来源:SaveFilter.cpp

示例15: defineOptions

//============================================================================//
void SmitlabService::defineOptions(OptionSet& options)
{

    ServerApplication::defineOptions(options);

    options.addOption(Option("help",        "h",
        "display help information for command line arguments"));

    options.addOption(Option("config-file", "f",
        "load configuration data from a file", false, "path", true));

}
开发者ID:AlekNS,项目名称:smitlab-service,代码行数:13,代码来源:SmitlabService.cpp


注:本文中的OptionSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。