本文整理汇总了C++中ConfigSection::addStringOption方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigSection::addStringOption方法的具体用法?C++ ConfigSection::addStringOption怎么用?C++ ConfigSection::addStringOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigSection
的用法示例。
在下文中一共展示了ConfigSection::addStringOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_config
void init_config(ConfigCollection* collection) {
ConfigSection* section;
CmdLineOption* option;
CmdLineArgString* strarg;
CmdLineArgSet* setarg;
/* GLE */
section = new ConfigSection("gle");
strarg = section->addStringOption("current", GLE_CONFIG_GLE_VERSION);
strarg->setDefault("");
section->addSPairListOption("versions", GLE_CONFIG_GLE_INSTALL);
collection->addSection(section, GLE_CONFIG_GLE);
/* Tools */
section = new ConfigSection("tools");
/* LaTeX */
strarg = section->addStringOption("latex", GLE_TOOL_LATEX_CMD);
#ifdef __WIN32__
strarg->setDefault("latex.exe");
#endif
#ifdef __UNIX__
strarg->setDefault("latex");
#endif
#ifdef __OS2__
strarg->setDefault("vlatexp.cmd");
#endif
section->addStringOption("latex_options", GLE_TOOL_LATEX_OPTIONS);
/* PdfLaTeX */
strarg = section->addStringOption("pdflatex", GLE_TOOL_PDFTEX_CMD);
#ifdef __WIN32__
strarg->setDefault("pdflatex.exe");
#else
strarg->setDefault("pdflatex");
#endif
section->addStringOption("pdflatex_options", GLE_TOOL_PDFTEX_OPTIONS);
/* DVIPS */
strarg = section->addStringOption("dvips", GLE_TOOL_DVIPS_CMD);
#ifdef __WIN32__
strarg->setDefault("dvips.exe");
#endif
#ifdef __UNIX__
strarg->setDefault("dvips");
#endif
#ifdef __OS2__
strarg->setDefault("dvips.exe");
#endif
section->addStringOption("dvips_options", GLE_TOOL_DVIPS_OPTIONS);
/* GhostScript Program */
strarg = section->addStringOption("ghostscript", GLE_TOOL_GHOSTSCRIPT_CMD);
#ifdef __WIN32__
strarg->setDefault("gswin32c.exe");
#endif
#ifdef __MACOS__
strarg->setDefault("gs,glegs;$EXELOC/glegs");
#endif
#if defined(__UNIX__) && !defined(__MACOS__)
strarg->setDefault("gs");
#endif
#ifdef __OS2__
strarg->setDefault("gsos2.exe");
#endif
section->addStringOption("ghostscript_options", GLE_TOOL_GHOSTSCRIPT_OPTIONS);
collection->addSection(section, GLE_CONFIG_TOOLS);
/* GhostScript Library */
strarg = section->addStringOption("libgs", GLE_TOOL_GHOSTSCRIPT_LIB);
#ifdef __WIN32__
strarg->setDefault("gsdll32.dll");
#endif
#ifdef __MACOS__
strarg->setDefault("/Library/Frameworks/Ghostscript.framework,Ghostscript.framework");
#endif
#if defined(__UNIX__) && !defined(__MACOS__)
strarg->setDefault("/usr/lib/libgs.so");
#endif
strarg = section->addStringOption("editor", GLE_TOOL_TEXT_EDITOR);
strarg = section->addStringOption("pdfviewer", GLE_TOOL_PDF_VIEWER);
/* TeX config */
section = new ConfigSection("tex");
option = new CmdLineOption("system");
setarg = new CmdLineArgSet("device-names");
setarg->setMaxCard(1);
setarg->addPossibleValue("latex");
setarg->addPossibleValue("vtex");
#ifdef __OS2__
setarg->addDefaultValue(GLE_TEX_SYSTEM_VTEX);
#else
setarg->addDefaultValue(GLE_TEX_SYSTEM_LATEX);
#endif
option->addArg(setarg);
section->addOption(option, GLE_TEX_SYSTEM);
collection->addSection(section, GLE_CONFIG_TEX);
/* Config paper */
section = new ConfigSection("paper");
strarg = section->addStringOption("size", GLE_CONFIG_PAPER_SIZE);
strarg->setDefault("a4paper");
strarg = section->addStringOption("margins", GLE_CONFIG_PAPER_MARGINS);
strarg->setDefault("2.54 2.54 2.54 2.54");
collection->addSection(section, GLE_CONFIG_PAPER);
//.........这里部分代码省略.........