本文整理汇总了C++中OptionList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionList::clear方法的具体用法?C++ OptionList::clear怎么用?C++ OptionList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionList
的用法示例。
在下文中一共展示了OptionList::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_allowed_options
static void set_allowed_options(OptionList *allowed_options)
{
allowed_options->clear();
allowed_options->insert(std::make_pair("help", ValueSpec(VALUETYPE_FLAG,
_("Show allowed options"))));
allowed_options->insert(std::make_pair("version", ValueSpec(VALUETYPE_FLAG,
_("Show version information"))));
allowed_options->insert(std::make_pair("config", ValueSpec(VALUETYPE_STRING,
_("Load configuration from specified file"))));
allowed_options->insert(std::make_pair("port", ValueSpec(VALUETYPE_STRING,
_("Set network port (UDP)"))));
allowed_options->insert(std::make_pair("run-unittests", ValueSpec(VALUETYPE_FLAG,
_("Run the unit tests and exit"))));
allowed_options->insert(std::make_pair("map-dir", ValueSpec(VALUETYPE_STRING,
_("Same as --world (deprecated)"))));
allowed_options->insert(std::make_pair("world", ValueSpec(VALUETYPE_STRING,
_("Set world path (implies local game) ('list' lists all)"))));
allowed_options->insert(std::make_pair("worldname", ValueSpec(VALUETYPE_STRING,
_("Set world by name (implies local game)"))));
allowed_options->insert(std::make_pair("quiet", ValueSpec(VALUETYPE_FLAG,
_("Print to console errors only"))));
allowed_options->insert(std::make_pair("info", ValueSpec(VALUETYPE_FLAG,
_("Print more information to console"))));
allowed_options->insert(std::make_pair("verbose", ValueSpec(VALUETYPE_FLAG,
_("Print even more information to console"))));
allowed_options->insert(std::make_pair("trace", ValueSpec(VALUETYPE_FLAG,
_("Print enormous amounts of information to log and console"))));
allowed_options->insert(std::make_pair("logfile", ValueSpec(VALUETYPE_STRING,
_("Set logfile path ('' = no logging)"))));
allowed_options->insert(std::make_pair("gameid", ValueSpec(VALUETYPE_STRING,
_("Set gameid (\"--gameid list\" prints available ones)"))));
allowed_options->insert(std::make_pair("migrate", ValueSpec(VALUETYPE_STRING,
_("Migrate from current map backend to another (Only works when using minetestserver or with --server)"))));
allowed_options->insert(std::make_pair("autoexit", ValueSpec(VALUETYPE_STRING,
_("Exit after X seconds"))));
allowed_options->insert(std::make_pair("terminal", ValueSpec(VALUETYPE_FLAG,
_("Feature an interactive terminal (Only works when using minetestserver or with --server)"))));
#ifndef SERVER
allowed_options->insert(std::make_pair("videomodes", ValueSpec(VALUETYPE_FLAG,
_("Show available video modes"))));
allowed_options->insert(std::make_pair("speedtests", ValueSpec(VALUETYPE_FLAG,
_("Run speed tests"))));
allowed_options->insert(std::make_pair("address", ValueSpec(VALUETYPE_STRING,
_("Address to connect to. ('' = local game)"))));
allowed_options->insert(std::make_pair("random-input", ValueSpec(VALUETYPE_FLAG,
_("Enable random user input, for testing"))));
allowed_options->insert(std::make_pair("server", ValueSpec(VALUETYPE_FLAG,
_("Run dedicated server"))));
allowed_options->insert(std::make_pair("name", ValueSpec(VALUETYPE_STRING,
_("Set player name"))));
allowed_options->insert(std::make_pair("password", ValueSpec(VALUETYPE_STRING,
_("Set password"))));
allowed_options->insert(std::make_pair("go", ValueSpec(VALUETYPE_FLAG,
_("Disable main menu"))));
#endif
}