📄 classpconfigargs.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PConfigArgs class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>PConfigArgs Class Reference</h1><code>#include <<a class="el" href="args_8h-source.html">args.h</a>></code><p><p>Inheritance diagram for PConfigArgs:<p><center><img src="classPConfigArgs.png" usemap="#PConfigArgs_map" border="0" alt=""></center><map name="PConfigArgs_map"><area href="classPArgList.html" alt="PArgList" shape="rect" coords="0,56,84,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,84,24"></map><a href="classPConfigArgs-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td colspan="2"><div class="groupHeader">Construction</div></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z13_0">PConfigArgs</a> (const <a class="el" href="classPArgList.html">PArgList</a> &args)</td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PArgList</div></td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z15_0">GetOptionCount</a> (char optionChar) const</td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z15_1">GetOptionCount</a> (const char *optionStr) const</td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z15_2">GetOptionCount</a> (const <a class="el" href="classPString.html">PString</a> &optionName) const</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPString.html">PString</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z15_3">GetOptionString</a> (char optionChar, const char *dflt=NULL) const</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPString.html">PString</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z15_4">GetOptionString</a> (const char *optionStr, const char *dflt=NULL) const</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPString.html">PString</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z15_5">GetOptionString</a> (const <a class="el" href="classPString.html">PString</a> &optionName, const char *dflt=NULL) const</td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PArgList</div></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z17_0">Save</a> (const <a class="el" href="classPString.html">PString</a> &optionName)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z17_1">SetSectionName</a> (const <a class="el" href="classPString.html">PString</a> &section)</td></tr><tr><td nowrap align=right valign=top>const <a class="el" href="classPString.html">PString</a> & </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z17_2">GetSectionName</a> () const</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z17_3">SetNegationPrefix</a> (const <a class="el" href="classPString.html">PString</a> &prefix)</td></tr><tr><td nowrap align=right valign=top>const <a class="el" href="classPString.html">PString</a> & </td><td valign=bottom><a class="el" href="classPConfigArgs.html#z17_4">GetNegationPrefix</a> () const</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPString.html">PString</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#b0">CharToString</a> (char ch) const</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPConfig.html">PConfig</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#n0">config</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPString.html">PString</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#n1">sectionName</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPString.html">PString</a> </td><td valign=bottom><a class="el" href="classPConfigArgs.html#n2">negationPrefix</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class parse command line arguments with the ability to override them from a <a class="el" href="classPConfig.html">PConfig</a> file/registry. <p><hr><h2>Constructor & Destructor Documentation</h2><a name="z13_0" doxytag="PConfigArgs::PConfigArgs"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PConfigArgs::PConfigArgs </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPArgList.html">PArgList</a> & </td> <td class="mdname1" valign="top" nowrap> <em>args</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>args</em> </td><td>Raw argument list. </td></tr></table></dl> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="b0" doxytag="PConfigArgs::CharToString"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classPString.html">PString</a> PConfigArgs::CharToString </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char </td> <td class="mdname1" valign="top" nowrap> <em>ch</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [protected]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a name="z17_4" doxytag="PConfigArgs::GetNegationPrefix"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const <a class="el" href="classPString.html">PString</a>& PConfigArgs::GetNegationPrefix </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the prefix for option negation. The default is "no-". </td> </tr></table><a name="z15_2" doxytag="PConfigArgs::GetOptionCount"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual PINDEX PConfigArgs::GetOptionCount </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> & </td> <td class="mdname1" valign="top" nowrap> <em>optionName</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the count of option <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>optionName</em> </td><td>String code for the option </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPArgList.html#z9_2">PArgList</a>. </td> </tr></table><a name="z15_1" doxytag="PConfigArgs::GetOptionCount"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual PINDEX PConfigArgs::GetOptionCount </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>optionStr</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the count of option <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>optionStr</em> </td><td>String code for the option </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPArgList.html#z9_1">PArgList</a>. </td> </tr></table><a name="z15_0" doxytag="PConfigArgs::GetOptionCount"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual PINDEX PConfigArgs::GetOptionCount </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char </td> <td class="mdname1" valign="top" nowrap> <em>optionChar</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the count of the number of times the option was specified on the command line.<p><dl compact><dt><b>Returns: </b></dt><dd>option repeat count. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>optionChar</em> </td><td>Character letter code for the option </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPArgList.html#z9_0">PArgList</a>. </td> </tr></table><a name="z15_5" doxytag="PConfigArgs::GetOptionString"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual <a class="el" href="classPString.html">PString</a> PConfigArgs::GetOptionString </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> & </td> <td class="mdname" nowrap> <em>optionName</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>dflt</em> = NULL</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get option string. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>dflt</em> </td><td>String code for the option Default value of the option string </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPArgList.html#z9_8">PArgList</a>. </td> </tr></table><a name="z15_4" doxytag="PConfigArgs::GetOptionString"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -