<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Arg.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> > <b>C++ reference</b> </div> <div align="right"> <a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a> </div> <!-- Generated by Doxygen 1.7.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <div class="left"> <form id="FSearchBox" action="search.php" method="get"> <img id="MSearchSelect" src="search/mag.png" alt=""/> <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"/> </form> </div><div class="right"></div> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">Arg.h</div> </div> </div> <div class="contents"> <a href="_arg_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00002"></a>00002 <span class="comment">/****************************************************************************** </span> <a name="l00003"></a>00003 <span class="comment"> * </span> <a name="l00004"></a>00004 <span class="comment"> * file: Arg.h</span> <a name="l00005"></a>00005 <span class="comment"> * </span> <a name="l00006"></a>00006 <span class="comment"> * Copyright (c) 2003, Michael E. Smoot .</span> <a name="l00007"></a>00007 <span class="comment"> * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno .</span> <a name="l00008"></a>00008 <span class="comment"> * All rights reverved.</span> <a name="l00009"></a>00009 <span class="comment"> * </span> <a name="l00010"></a>00010 <span class="comment"> * See the file COPYING in the top directory of this distribution for</span> <a name="l00011"></a>00011 <span class="comment"> * more information.</span> <a name="l00012"></a>00012 <span class="comment"> * </span> <a name="l00013"></a>00013 <span class="comment"> * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS </span> <a name="l00014"></a>00014 <span class="comment"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, </span> <a name="l00015"></a>00015 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL </span> <a name="l00016"></a>00016 <span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER </span> <a name="l00017"></a>00017 <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING </span> <a name="l00018"></a>00018 <span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER </span> <a name="l00019"></a>00019 <span class="comment"> * DEALINGS IN THE SOFTWARE. </span> <a name="l00020"></a>00020 <span class="comment"> * </span> <a name="l00021"></a>00021 <span class="comment"> *****************************************************************************/</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef TCLAP_ARGUMENT_H</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define TCLAP_ARGUMENT_H</span> <a name="l00026"></a>00026 <span class="preprocessor"></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <string></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <vector></span> <a name="l00029"></a>00029 <span class="preprocessor">#include <list></span> <a name="l00030"></a>00030 <span class="preprocessor">#include <iostream></span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="preprocessor">#include <<a class="code" href="_arg_exception_8h.html">mrpt/otherlibs/tclap/ArgException.h</a>></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <<a class="code" href="_visitor_8h.html">mrpt/otherlibs/tclap/Visitor.h</a>></span> <a name="l00034"></a>00034 <span class="preprocessor">#include <<a class="code" href="_cmd_line_interface_8h.html">mrpt/otherlibs/tclap/CmdLineInterface.h</a>></span> <a name="l00035"></a>00035 <a name="l00036"></a><a class="code" href="namespace_t_c_l_a_p.html">00036</a> <span class="keyword">namespace </span>TCLAP { <a name="l00037"></a>00037 <span class="comment"></span> <a name="l00038"></a>00038 <span class="comment">/** </span> <a name="l00039"></a>00039 <span class="comment"> * A virtual base class that defines the essential data for all arguments.</span> <a name="l00040"></a>00040 <span class="comment"> * This class, or one of its existing children, must be subclassed to do</span> <a name="l00041"></a>00041 <span class="comment"> * anything. </span> <a name="l00042"></a>00042 <span class="comment"> */</span> <a name="l00043"></a>00043 <span class="keyword">class </span><a class="code" href="class_t_c_l_a_p_1_1_arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a> <a name="l00044"></a>00044 { <a name="l00045"></a>00045 <span class="keyword">private</span>: <a name="l00046"></a>00046 <span class="comment"></span> <a name="l00047"></a>00047 <span class="comment"> /**</span> <a name="l00048"></a>00048 <span class="comment"> * Indicates whether the rest of the arguments should be ignored.</span> <a name="l00049"></a>00049 <span class="comment"> */</span> <a name="l00050"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#afa32140f7c01f99f6a9e85deb79281e1">00050</a> <span class="keyword">static</span> <span class="keywordtype">bool</span>& <a class="code" href="class_t_c_l_a_p_1_1_arg.html#afa32140f7c01f99f6a9e85deb79281e1" title="Indicates whether the rest of the arguments should be ignored.">ignoreRestRef</a>() { <span class="keyword">static</span> <span class="keywordtype">bool</span> ign = <span class="keyword">false</span>; <span class="keywordflow">return</span> ign; } <a name="l00051"></a>00051 <span class="comment"></span> <a name="l00052"></a>00052 <span class="comment"> /**</span> <a name="l00053"></a>00053 <span class="comment"> * The delimiter that separates an argument flag/name from the</span> <a name="l00054"></a>00054 <span class="comment"> * value.</span> <a name="l00055"></a>00055 <span class="comment"> */</span> <a name="l00056"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a863591150a407ff29276ac13d0058144">00056</a> <span class="keyword">static</span> <span class="keywordtype">char</span>& <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a863591150a407ff29276ac13d0058144" title="The delimiter that separates an argument flag/name from the value.">delimiterRef</a>() { <span class="keyword">static</span> <span class="keywordtype">char</span> delim = <span class="charliteral">' '</span>; <span class="keywordflow">return</span> delim; } <a name="l00057"></a>00057 <a name="l00058"></a>00058 <span class="keyword">protected</span>: <a name="l00059"></a>00059 <span class="comment"></span> <a name="l00060"></a>00060 <span class="comment"> /** </span> <a name="l00061"></a>00061 <span class="comment"> * The single char flag used to identify the argument.</span> <a name="l00062"></a>00062 <span class="comment"> * This value (preceded by a dash {-}), can be used to identify </span> <a name="l00063"></a>00063 <span class="comment"> * an argument on the command line. The _flag can be blank, </span> <a name="l00064"></a>00064 <span class="comment"> * in fact this is how unlabeled args work. Unlabeled args must</span> <a name="l00065"></a>00065 <span class="comment"> * override appropriate functions to get correct handling. Note </span> <a name="l00066"></a>00066 <span class="comment"> * that the _flag does NOT include the dash as part of the flag.</span> <a name="l00067"></a>00067 <span class="comment"> */</span> <a name="l00068"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5">00068</a> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a>; <a name="l00069"></a>00069 <span class="comment"></span> <a name="l00070"></a>00070 <span class="comment"> /**</span> <a name="l00071"></a>00071 <span class="comment"> * A single work namd indentifying the argument.</span> <a name="l00072"></a>00072 <span class="comment"> * This value (preceded by two dashed {--}) can also be used </span> <a name="l00073"></a>00073 <span class="comment"> * to identify an argument on the command line. Note that the</span> <a name="l00074"></a>00074 <span class="comment"> * _name does NOT include the two dashes as part of the _name. The</span> <a name="l00075"></a>00075 <span class="comment"> * _name cannot be blank.</span> <a name="l00076"></a>00076 <span class="comment"> */</span> <a name="l00077"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa">00077</a> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>; <a name="l00078"></a>00078 <span class="comment"></span> <a name="l00079"></a>00079 <span class="comment"> /**</span> <a name="l00080"></a>00080 <span class="comment"> * Description of the argument. </span> <a name="l00081"></a>00081 <span class="comment"> */</span> <a name="l00082"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9882fe256eaab01ac53db54ac657d272">00082</a> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9882fe256eaab01ac53db54ac657d272" title="Description of the argument.">_description</a>; <a name="l00083"></a>00083 <span class="comment"></span> <a name="l00084"></a>00084 <span class="comment"> /** </span> <a name="l00085"></a>00085 <span class="comment"> * Indicating whether the argument is required.</span> <a name="l00086"></a>00086 <span class="comment"> */</span> <a name="l00087"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad16408bd1ca4d8b1d14d6c5129545a84">00087</a> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad16408bd1ca4d8b1d14d6c5129545a84" title="Indicating whether the argument is required.">_required</a>; <a name="l00088"></a>00088 <span class="comment"></span> <a name="l00089"></a>00089 <span class="comment"> /**</span> <a name="l00090"></a>00090 <span class="comment"> * Label to be used in usage description. Normally set to </span> <a name="l00091"></a>00091 <span class="comment"> * "required", but can be changed when necessary.</span> <a name="l00092"></a>00092 <span class="comment"> */</span> <a name="l00093"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2ed097a868e34a0c4f6062ead744ac54">00093</a> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2ed097a868e34a0c4f6062ead744ac54" title="Label to be used in usage description.">_requireLabel</a>; <a name="l00094"></a>00094 <span class="comment"></span> <a name="l00095"></a>00095 <span class="comment"> /**</span> <a name="l00096"></a>00096 <span class="comment"> * Indicates whether a value is required for the argument.</span> <a name="l00097"></a>00097 <span class="comment"> * Note that the value may be required but the argument/value</span> <a name="l00098"></a>00098 <span class="comment"> * combination may not be, as specified by _required.</span> <a name="l00099"></a>00099 <span class="comment"> */</span> <a name="l00100"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a776682b7e19f4dc231bbad3d10034dfa">00100</a> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a776682b7e19f4dc231bbad3d10034dfa" title="Indicates whether a value is required for the argument.">_valueRequired</a>; <a name="l00101"></a>00101 <span class="comment"></span> <a name="l00102"></a>00102 <span class="comment"> /**</span> <a name="l00103"></a>00103 <span class="comment"> * Indicates whether the argument has been set.</span> <a name="l00104"></a>00104 <span class="comment"> * Indicates that a value on the command line has matched the</span> <a name="l00105"></a>00105 <span class="comment"> * name/flag of this argument and the values have been set accordingly.</span> <a name="l00106"></a>00106 <span class="comment"> */</span> <a name="l00107"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a829e32129857d2683e5791a5df1208ec">00107</a> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a829e32129857d2683e5791a5df1208ec" title="Indicates whether the argument has been set.">_alreadySet</a>; <a name="l00108"></a>00108 <span class="comment"></span> <a name="l00109"></a>00109 <span class="comment"> /**</span> <a name="l00110"></a>00110 <span class="comment"> * A pointer to a vistitor object.</span> <a name="l00111"></a>00111 <span class="comment"> * The visitor allows special handling to occur as soon as the</span> <a name="l00112"></a>00112 <span class="comment"> * argument is matched. This defaults to NULL and should not</span> <a name="l00113"></a>00113 <span class="comment"> * be used unless absolutely necessary.</span> <a name="l00114"></a>00114 <span class="comment"> */</span> <a name="l00115"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa9ff037e92c9fa5bd85e532f61899300">00115</a> <a class="code" href="class_t_c_l_a_p_1_1_visitor.html" title="A base class that defines the interface for visitors.">Visitor</a>* <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa9ff037e92c9fa5bd85e532f61899300" title="A pointer to a vistitor object.">_visitor</a>; <a name="l00116"></a>00116 <span class="comment"></span> <a name="l00117"></a>00117 <span class="comment"> /**</span> <a name="l00118"></a>00118 <span class="comment"> * Whether this argument can be ignored, if desired.</span> <a name="l00119"></a>00119 <span class="comment"> */</span> <a name="l00120"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9832bb7564f4ab472bd51b7b1bbc683f">00120</a> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9832bb7564f4ab472bd51b7b1bbc683f" title="Whether this argument can be ignored, if desired.">_ignoreable</a>; <a name="l00121"></a>00121 <span class="comment"></span> <a name="l00122"></a>00122 <span class="comment"> /**</span> <a name="l00123"></a>00123 <span class="comment"> * Indicates that the arg was set as part of an XOR and not on the</span> <a name="l00124"></a>00124 <span class="comment"> * command line.</span> <a name="l00125"></a>00125 <span class="comment"> */</span> <a name="l00126"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab413bd1d8a7ecf3c89672ee23ef791ba">00126</a> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab413bd1d8a7ecf3c89672ee23ef791ba" title="Indicates that the arg was set as part of an XOR and not on the command line.">_xorSet</a>; <a name="l00127"></a>00127 <a name="l00128"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a13130a9a5d22c57a6d42a8883c9b1e0f">00128</a> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a13130a9a5d22c57a6d42a8883c9b1e0f">_acceptsMultipleValues</a>; <a name="l00129"></a>00129 <span class="comment"></span> <a name="l00130"></a>00130 <span class="comment"> /**</span> <a name="l00131"></a>00131 <span class="comment"> * Performs the special handling described by the Vistitor.</span> <a name="l00132"></a>00132 <span class="comment"> */</span> <a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa963d0d4c8cb297e1f4cf74143bf6d1b" title="Performs the special handling described by the Vistitor.">_checkWithVisitor</a>() <span class="keyword">const</span>; <a name="l00134"></a>00134 <span class="comment"></span> <a name="l00135"></a>00135 <span class="comment"> /**</span> <a name="l00136"></a>00136 <span class="comment"> * Primary constructor. YOU (yes you) should NEVER construct an Arg </span> <a name="l00137"></a>00137 <span class="comment"> * directly, this is a base class that is extended by various children</span> <a name="l00138"></a>00138 <span class="comment"> * that are meant to be used. Use SwitchArg, ValueArg, MultiArg, </span> <a name="l00139"></a>00139 <span class="comment"> * UnlabeledValueArg, or UnlabeledMultiArg instead.</span> <a name="l00140"></a>00140 <span class="comment"> *</span> <a name="l00141"></a>00141 <span class="comment"> * \param flag - The flag identifying the argument.</span> <a name="l00142"></a>00142 <span class="comment"> * \param name - The name identifying the argument.</span> <a name="l00143"></a>00143 <span class="comment"> * \param desc - The description of the argument, used in the usage.</span> <a name="l00144"></a>00144 <span class="comment"> * \param req - Whether the argument is required.</span> <a name="l00145"></a>00145 <span class="comment"> * \param valreq - Whether the a value is required for the argument.</span> <a name="l00146"></a>00146 <span class="comment"> * \param v - The visitor checked by the argument. Defaults to NULL.</span> <a name="l00147"></a>00147 <span class="comment"> */</span> <a name="l00148"></a>00148 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab25a06db5edf82a5b965b641b3c63372" title="Primary constructor.">Arg</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& flag, <a name="l00149"></a>00149 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& name, <a name="l00150"></a>00150 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& desc, <a name="l00151"></a>00151 <span class="keywordtype">bool</span> req, <a name="l00152"></a>00152 <span class="keywordtype">bool</span> valreq, <a name="l00153"></a>00153 <a class="code" href="class_t_c_l_a_p_1_1_visitor.html" title="A base class that defines the interface for visitors.">Visitor</a>* v = NULL ); <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="keyword">public</span>:<span class="comment"></span> <a name="l00156"></a>00156 <span class="comment"> /**</span> <a name="l00157"></a>00157 <span class="comment"> * Destructor.</span> <a name="l00158"></a>00158 <span class="comment"> */</span> <a name="l00159"></a>00159 <span class="keyword">virtual</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a15734a7cf52c8c4ab6df70f0997bbee3" title="Destructor.">~Arg</a>(); <a name="l00160"></a>00160 <span class="comment"></span> <a name="l00161"></a>00161 <span class="comment"> /**</span> <a name="l00162"></a>00162 <span class="comment"> * Adds this to the specified list of Args.</span> <a name="l00163"></a>00163 <span class="comment"> * \param argList - The list to add this to.</span> <a name="l00164"></a>00164 <span class="comment"> */</span> <a name="l00165"></a>00165 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9ff1564beeea2ef855f7fa483c37d0e2" title="Adds this to the specified list of Args.">addToList</a>( <a class="code" href="classstd_1_1list.html">std::list<Arg*></a>& argList ) <span class="keyword">const</span>; <a name="l00166"></a>00166 <span class="comment"></span> <a name="l00167"></a>00167 <span class="comment"> /**</span> <a name="l00168"></a>00168 <span class="comment"> * Begin ignoring arguments since the "--" argument was specified.</span> <a name="l00169"></a>00169 <span class="comment"> */</span> <a name="l00170"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a24165d31c1ec70777fb201356b6cdf6a">00170</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a24165d31c1ec70777fb201356b6cdf6a" title="Begin ignoring arguments since the "--" argument was specified.">beginIgnoring</a>() { <a class="code" href="class_t_c_l_a_p_1_1_arg.html#afa32140f7c01f99f6a9e85deb79281e1" title="Indicates whether the rest of the arguments should be ignored.">ignoreRestRef</a>() = <span class="keyword">true</span>; } <a name="l00171"></a>00171 <span class="comment"></span> <a name="l00172"></a>00172 <span class="comment"> /**</span> <a name="l00173"></a>00173 <span class="comment"> * Whether to ignore the rest.</span> <a name="l00174"></a>00174 <span class="comment"> */</span> <a name="l00175"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a4d412155b8f9b4956e64e91c48e55a3b">00175</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a4d412155b8f9b4956e64e91c48e55a3b" title="Whether to ignore the rest.">ignoreRest</a>() { <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#afa32140f7c01f99f6a9e85deb79281e1" title="Indicates whether the rest of the arguments should be ignored.">ignoreRestRef</a>(); } <a name="l00176"></a>00176 <span class="comment"></span> <a name="l00177"></a>00177 <span class="comment"> /**</span> <a name="l00178"></a>00178 <span class="comment"> * The delimiter that separates an argument flag/name from the</span> <a name="l00179"></a>00179 <span class="comment"> * value.</span> <a name="l00180"></a>00180 <span class="comment"> */</span> <a name="l00181"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aadef6ca7e40f5b3d3fd03186976aea7e">00181</a> <span class="keyword">static</span> <span class="keywordtype">char</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aadef6ca7e40f5b3d3fd03186976aea7e" title="The delimiter that separates an argument flag/name from the value.">delimiter</a>() { <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a863591150a407ff29276ac13d0058144" title="The delimiter that separates an argument flag/name from the value.">delimiterRef</a>(); } <a name="l00182"></a>00182 <span class="comment"></span> <a name="l00183"></a>00183 <span class="comment"> /**</span> <a name="l00184"></a>00184 <span class="comment"> * The char used as a place holder when SwitchArgs are combined.</span> <a name="l00185"></a>00185 <span class="comment"> * Currently set to '*', which shouldn't cause many problems since</span> <a name="l00186"></a>00186 <span class="comment"> * *'s are expanded by most shells on the command line. </span> <a name="l00187"></a>00187 <span class="comment"> */</span> <a name="l00188"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a40ba4acecb58080ba33aa57d99e14cad">00188</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a40ba4acecb58080ba33aa57d99e14cad" title="The char used as a place holder when SwitchArgs are combined.">blankChar</a>() { <span class="keywordflow">return</span> <span class="charliteral">'*'</span>; } <a name="l00189"></a>00189 <span class="comment"></span> <a name="l00190"></a>00190 <span class="comment"> /**</span> <a name="l00191"></a>00191 <span class="comment"> * The char that indicates the beginning of a flag. Currently '-'.</span> <a name="l00192"></a>00192 <span class="comment"> */</span> <a name="l00193"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad270774ee5dba351c988df53d87a3b0f">00193</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad270774ee5dba351c988df53d87a3b0f" title="The char that indicates the beginning of a flag.">flagStartChar</a>() { <span class="keywordflow">return</span> <span class="charliteral">'-'</span>; } <a name="l00194"></a>00194 <span class="comment"></span> <a name="l00195"></a>00195 <span class="comment"> /**</span> <a name="l00196"></a>00196 <span class="comment"> * The sting that indicates the beginning of a flag. Currently "-".</span> <a name="l00197"></a>00197 <span class="comment"> * Should be identical to flagStartChar.</span> <a name="l00198"></a>00198 <span class="comment"> */</span> <a name="l00199"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1">00199</a> <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">flagStartString</a>() { <span class="keywordflow">return</span> <span class="stringliteral">"-"</span>; } <a name="l00200"></a>00200 <span class="comment"></span> <a name="l00201"></a>00201 <span class="comment"> /**</span> <a name="l00202"></a>00202 <span class="comment"> * The sting that indicates the beginning of a name. Currently "--".</span> <a name="l00203"></a>00203 <span class="comment"> * Should be flagStartChar twice.</span> <a name="l00204"></a>00204 <span class="comment"> */</span> <a name="l00205"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14">00205</a> <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">nameStartString</a>() { <span class="keywordflow">return</span> <span class="stringliteral">"--"</span>; } <a name="l00206"></a>00206 <span class="comment"></span> <a name="l00207"></a>00207 <span class="comment"> /**</span> <a name="l00208"></a>00208 <span class="comment"> * The name used to identify the ignore rest argument.</span> <a name="l00209"></a>00209 <span class="comment"> */</span> <a name="l00210"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a6ce0cbe4effd44679ca11f25e3c318e7">00210</a> <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a6ce0cbe4effd44679ca11f25e3c318e7" title="The name used to identify the ignore rest argument.">ignoreNameString</a>() { <span class="keywordflow">return</span> <span class="stringliteral">"ignore_rest"</span>; } <a name="l00211"></a>00211 <span class="comment"></span> <a name="l00212"></a>00212 <span class="comment"> /**</span> <a name="l00213"></a>00213 <span class="comment"> * Sets the delimiter for all arguments.</span> <a name="l00214"></a>00214 <span class="comment"> * \param c - The character that delimits flags/names from values.</span> <a name="l00215"></a>00215 <span class="comment"> */</span> <a name="l00216"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad059b63424001b9aedb4c019e2854c3c">00216</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad059b63424001b9aedb4c019e2854c3c" title="Sets the delimiter for all arguments.">setDelimiter</a>( <span class="keywordtype">char</span> c ) { <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a863591150a407ff29276ac13d0058144" title="The delimiter that separates an argument flag/name from the value.">delimiterRef</a>() = c; } <a name="l00217"></a>00217 <span class="comment"></span> <a name="l00218"></a>00218 <span class="comment"> /**</span> <a name="l00219"></a>00219 <span class="comment"> * Pure virtual method meant to handle the parsing and value assignment</span> <a name="l00220"></a>00220 <span class="comment"> * of the string on the command line. </span> <a name="l00221"></a>00221 <span class="comment"> * \param i - Pointer the the current argument in the list.</span> <a name="l00222"></a>00222 <span class="comment"> * \param args - Mutable list of strings. What is </span> <a name="l00223"></a>00223 <span class="comment"> * passed in from main.</span> <a name="l00224"></a>00224 <span class="comment"> */</span> <a name="l00225"></a>00225 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a61ffe2f660a76111d256f7b22a686146" title="Pure virtual method meant to handle the parsing and value assignment of the string on the command lin...">processArg</a>(<span class="keywordtype">int</span> *i, <a class="code" href="classstd_1_1vector.html">std::vector<std::string></a>& args) = 0; <a name="l00226"></a>00226 <span class="comment"></span> <a name="l00227"></a>00227 <span class="comment"> /**</span> <a name="l00228"></a>00228 <span class="comment"> * Operator ==.</span> <a name="l00229"></a>00229 <span class="comment"> * Equality operator. Must be virtual to handle unlabeled args.</span> <a name="l00230"></a>00230 <span class="comment"> * \param a - The Arg to be compared to this.</span> <a name="l00231"></a>00231 <span class="comment"> */</span> <a name="l00232"></a>00232 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a657a8d2842b7de9ced5a5a55db01d367" title="Operator ==.">operator==</a>(<span class="keyword">const</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a>& a) <span class="keyword">const</span>; <a name="l00233"></a>00233 <span class="comment"></span> <a name="l00234"></a>00234 <span class="comment"> /**</span> <a name="l00235"></a>00235 <span class="comment"> * Returns the argument flag.</span> <a name="l00236"></a>00236 <span class="comment"> */</span> <a name="l00237"></a>00237 <span class="keyword">const</span> std::string& <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a22f616e81a423e794f13a9ae1549ac77" title="Returns the argument flag.">getFlag</a>() <span class="keyword">const</span>; <a name="l00238"></a>00238 <span class="comment"></span> <a name="l00239"></a>00239 <span class="comment"> /**</span> <a name="l00240"></a>00240 <span class="comment"> * Returns the argument name.</span> <a name="l00241"></a>00241 <span class="comment"> */</span> <a name="l00242"></a>00242 <span class="keyword">const</span> std::string& <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a641ced141a56c74fee11d3e3a808f731" title="Returns the argument name.">getName</a>() <span class="keyword">const</span>; <a name="l00243"></a>00243 <span class="comment"></span> <a name="l00244"></a>00244 <span class="comment"> /**</span> <a name="l00245"></a>00245 <span class="comment"> * Returns the argument description.</span> <a name="l00246"></a>00246 <span class="comment"> */</span> <a name="l00247"></a>00247 std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1943999fadcb4f28cecd6ba55ed0b085" title="Returns the argument description.">getDescription</a>() <span class="keyword">const</span>; <a name="l00248"></a>00248 <span class="comment"></span> <a name="l00249"></a>00249 <span class="comment"> /**</span> <a name="l00250"></a>00250 <span class="comment"> * Indicates whether the argument is required.</span> <a name="l00251"></a>00251 <span class="comment"> */</span> <a name="l00252"></a>00252 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a00a3cfdb2b6e9a111ad39cbd4978b96c" title="Indicates whether the argument is required.">isRequired</a>() <span class="keyword">const</span>; <a name="l00253"></a>00253 <span class="comment"></span> <a name="l00254"></a>00254 <span class="comment"> /**</span> <a name="l00255"></a>00255 <span class="comment"> * Sets _required to true. This is used by the XorHandler.</span> <a name="l00256"></a>00256 <span class="comment"> * You really have no reason to ever use it.</span> <a name="l00257"></a>00257 <span class="comment"> */</span> <a name="l00258"></a>00258 <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a58e3de560f364d0bb6bdf36ab533a6fd" title="Sets _required to true.">forceRequired</a>(); <a name="l00259"></a>00259 <span class="comment"></span> <a name="l00260"></a>00260 <span class="comment"> /**</span> <a name="l00261"></a>00261 <span class="comment"> * Sets the _alreadySet value to true. This is used by the XorHandler.</span> <a name="l00262"></a>00262 <span class="comment"> * You really have no reason to ever use it.</span> <a name="l00263"></a>00263 <span class="comment"> */</span> <a name="l00264"></a>00264 <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aec525c8092e56f7f5aa455e71bc72374" title="Sets the _alreadySet value to true.">xorSet</a>(); <a name="l00265"></a>00265 <span class="comment"></span> <a name="l00266"></a>00266 <span class="comment"> /**</span> <a name="l00267"></a>00267 <span class="comment"> * Indicates whether a value must be specified for argument.</span> <a name="l00268"></a>00268 <span class="comment"> */</span> <a name="l00269"></a>00269 <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1373d50d4b93c16db43c7600cf6d0355" title="Indicates whether a value must be specified for argument.">isValueRequired</a>() <span class="keyword">const</span>; <a name="l00270"></a>00270 <span class="comment"></span> <a name="l00271"></a>00271 <span class="comment"> /**</span> <a name="l00272"></a>00272 <span class="comment"> * Indicates whether the argument has already been set. Only true</span> <a name="l00273"></a>00273 <span class="comment"> * if the arg has been matched on the command line.</span> <a name="l00274"></a>00274 <span class="comment"> */</span> <a name="l00275"></a>00275 <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a6af7a1e92b5d92fc2d90c1a95aab4384" title="Indicates whether the argument has already been set.">isSet</a>() <span class="keyword">const</span>; <a name="l00276"></a>00276 <span class="comment"></span> <a name="l00277"></a>00277 <span class="comment"> /**</span> <a name="l00278"></a>00278 <span class="comment"> * Indicates whether the argument can be ignored, if desired. </span> <a name="l00279"></a>00279 <span class="comment"> */</span> <a name="l00280"></a>00280 <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a33816b5ccc58a15f3a998480e5d988e2" title="Indicates whether the argument can be ignored, if desired.">isIgnoreable</a>() <span class="keyword">const</span>; <a name="l00281"></a>00281 <span class="comment"></span> <a name="l00282"></a>00282 <span class="comment"> /**</span> <a name="l00283"></a>00283 <span class="comment"> * A method that tests whether a string matches this argument.</span> <a name="l00284"></a>00284 <span class="comment"> * This is generally called by the processArg() method. This</span> <a name="l00285"></a>00285 <span class="comment"> * method could be re-implemented by a child to change how </span> <a name="l00286"></a>00286 <span class="comment"> * arguments are specified on the command line.</span> <a name="l00287"></a>00287 <span class="comment"> * \param s - The string to be compared to the flag/name to determine</span> <a name="l00288"></a>00288 <span class="comment"> * whether the arg matches.</span> <a name="l00289"></a>00289 <span class="comment"> */</span> <a name="l00290"></a>00290 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aac37b1b734b477e5d16f2037dba9c125" title="A method that tests whether a string matches this argument.">argMatches</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& s ) <span class="keyword">const</span>; <a name="l00291"></a>00291 <span class="comment"></span> <a name="l00292"></a>00292 <span class="comment"> /**</span> <a name="l00293"></a>00293 <span class="comment"> * Returns a simple string representation of the argument.</span> <a name="l00294"></a>00294 <span class="comment"> * Primarily for debugging.</span> <a name="l00295"></a>00295 <span class="comment"> */</span> <a name="l00296"></a>00296 <span class="keyword">virtual</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac98a357568c21f0eb6ca2220b8a3d4a2" title="Returns a simple string representation of the argument.">toString</a>() <span class="keyword">const</span>; <a name="l00297"></a>00297 <span class="comment"></span> <a name="l00298"></a>00298 <span class="comment"> /**</span> <a name="l00299"></a>00299 <span class="comment"> * Returns a short ID for the usage.</span> <a name="l00300"></a>00300 <span class="comment"> * \param valueId - The value used in the id.</span> <a name="l00301"></a>00301 <span class="comment"> */</span> <a name="l00302"></a>00302 <span class="keyword">virtual</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aef8efaf3811162b2b2b2a84c6db280fa" title="Returns a short ID for the usage.">shortID</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& valueId = <span class="stringliteral">"val"</span> ) <span class="keyword">const</span>; <a name="l00303"></a>00303 <span class="comment"></span> <a name="l00304"></a>00304 <span class="comment"> /**</span> <a name="l00305"></a>00305 <span class="comment"> * Returns a long ID for the usage.</span> <a name="l00306"></a>00306 <span class="comment"> * \param valueId - The value used in the id.</span> <a name="l00307"></a>00307 <span class="comment"> */</span> <a name="l00308"></a>00308 <span class="keyword">virtual</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aad93aff46e1fc67e3853765f565bfa96" title="Returns a long ID for the usage.">longID</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& valueId = <span class="stringliteral">"val"</span> ) <span class="keyword">const</span>; <a name="l00309"></a>00309 <span class="comment"></span> <a name="l00310"></a>00310 <span class="comment"> /**</span> <a name="l00311"></a>00311 <span class="comment"> * Trims a value off of the flag.</span> <a name="l00312"></a>00312 <span class="comment"> * \param flag - The string from which the flag and value will be </span> <a name="l00313"></a>00313 <span class="comment"> * trimmed. Contains the flag once the value has been trimmed. </span> <a name="l00314"></a>00314 <span class="comment"> * \param value - Where the value trimmed from the string will</span> <a name="l00315"></a>00315 <span class="comment"> * be stored.</span> <a name="l00316"></a>00316 <span class="comment"> */</span> <a name="l00317"></a>00317 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a54595328e81f5fb77859563690faab25" title="Trims a value off of the flag.">trimFlag</a>( <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& flag, <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& value ) <span class="keyword">const</span>; <a name="l00318"></a>00318 <span class="comment"></span> <a name="l00319"></a>00319 <span class="comment"> /**</span> <a name="l00320"></a>00320 <span class="comment"> * Checks whether a given string has blank chars, indicating that</span> <a name="l00321"></a>00321 <span class="comment"> * it is a combined SwitchArg. If so, return true, otherwise return</span> <a name="l00322"></a>00322 <span class="comment"> * false.</span> <a name="l00323"></a>00323 <span class="comment"> * \param s - string to be checked.</span> <a name="l00324"></a>00324 <span class="comment"> */</span> <a name="l00325"></a>00325 <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2eb0ffefe163218bdc8b4b7a33a974a7" title="Checks whether a given string has blank chars, indicating that it is a combined SwitchArg.">_hasBlanks</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& s ) <span class="keyword">const</span>; <a name="l00326"></a>00326 <span class="comment"></span> <a name="l00327"></a>00327 <span class="comment"> /**</span> <a name="l00328"></a>00328 <span class="comment"> * Sets the requireLabel. Used by XorHandler. You shouldn't ever</span> <a name="l00329"></a>00329 <span class="comment"> * use this.</span> <a name="l00330"></a>00330 <span class="comment"> * \param s - Set the requireLabel to this value.</span> <a name="l00331"></a>00331 <span class="comment"> */</span> <a name="l00332"></a>00332 <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aae5c959f31af1a484a8af06f84a6e8b0" title="Sets the requireLabel.">setRequireLabel</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& s ); <a name="l00333"></a>00333 <a name="l00334"></a>00334 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9aef735d37ef95ca1b7dc7a07850b984">allowMore</a>(); <a name="l00335"></a>00335 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad356870538a255d639e26b30330202ae">acceptsMultipleValues</a>(); <a name="l00336"></a>00336 <a name="l00337"></a>00337 }; <a name="l00338"></a>00338 <span class="comment"></span> <a name="l00339"></a>00339 <span class="comment">/**</span> <a name="l00340"></a>00340 <span class="comment"> * Typedef of an Arg list iterator.</span> <a name="l00341"></a>00341 <span class="comment"> */</span> <a name="l00342"></a><a class="code" href="namespace_t_c_l_a_p.html#aa7d6a803e0690c3c8b1db57c145648c5">00342</a> <span class="keyword">typedef</span> std<a class="code" href="eigen__plugins_8h.html#a39c5d6430ea9395ae7ae729dd0c3f18c">::list<Arg*>::iterator</a> <a class="code" href="namespace_t_c_l_a_p.html#aa7d6a803e0690c3c8b1db57c145648c5" title="Typedef of an Arg list iterator.">ArgListIterator</a>; <a name="l00343"></a>00343 <span class="comment"></span> <a name="l00344"></a>00344 <span class="comment">/**</span> <a name="l00345"></a>00345 <span class="comment"> * Typedef of an Arg vector iterator.</span> <a name="l00346"></a>00346 <span class="comment"> */</span> <a name="l00347"></a><a class="code" href="namespace_t_c_l_a_p.html#a04213af1ffc3178ce5f771d21d5164a2">00347</a> <span class="keyword">typedef</span> std<a class="code" href="eigen__plugins_8h.html#a39c5d6430ea9395ae7ae729dd0c3f18c">::vector<Arg*>::iterator</a> <a class="code" href="namespace_t_c_l_a_p.html#a04213af1ffc3178ce5f771d21d5164a2" title="Typedef of an Arg vector iterator.">ArgVectorIterator</a>; <a name="l00348"></a>00348 <span class="comment"></span> <a name="l00349"></a>00349 <span class="comment">/**</span> <a name="l00350"></a>00350 <span class="comment"> * Typedef of a Visitor list iterator.</span> <a name="l00351"></a>00351 <span class="comment"> */</span> <a name="l00352"></a><a class="code" href="namespace_t_c_l_a_p.html#a30300bc675a64eacafa1298268de1101">00352</a> <span class="keyword">typedef</span> std<a class="code" href="eigen__plugins_8h.html#a39c5d6430ea9395ae7ae729dd0c3f18c">::list<Visitor*>::iterator</a> <a class="code" href="namespace_t_c_l_a_p.html#a30300bc675a64eacafa1298268de1101" title="Typedef of a Visitor list iterator.">VisitorListIterator</a>; <a name="l00353"></a>00353 <a name="l00354"></a>00354 <span class="comment"></span> <a name="l00355"></a>00355 <span class="comment">//////////////////////////////////////////////////////////////////////</span> <a name="l00356"></a>00356 <span class="comment"></span><span class="comment">//BEGIN Arg.cpp</span><span class="comment"></span> <a name="l00357"></a>00357 <span class="comment">//////////////////////////////////////////////////////////////////////</span> <a name="l00358"></a>00358 <span class="comment"></span> <a name="l00359"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab25a06db5edf82a5b965b641b3c63372">00359</a> <span class="keyword">inline</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab25a06db5edf82a5b965b641b3c63372" title="Primary constructor.">Arg::Arg</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& flag, <a name="l00360"></a>00360 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& name, <a name="l00361"></a>00361 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& desc, <a name="l00362"></a>00362 <span class="keywordtype">bool</span> req, <a name="l00363"></a>00363 <span class="keywordtype">bool</span> valreq, <a name="l00364"></a>00364 <a class="code" href="class_t_c_l_a_p_1_1_visitor.html" title="A base class that defines the interface for visitors.">Visitor</a>* v) : <a name="l00365"></a>00365 _flag(flag), <a name="l00366"></a>00366 _name(name), <a name="l00367"></a>00367 _description(desc), <a name="l00368"></a>00368 _required(req), <a name="l00369"></a>00369 _requireLabel(<span class="stringliteral">"required"</span>), <a name="l00370"></a>00370 _valueRequired(valreq), <a name="l00371"></a>00371 _alreadySet(false), <a name="l00372"></a>00372 _visitor( v ), <a name="l00373"></a>00373 _ignoreable(true), <a name="l00374"></a>00374 _xorSet(false), <a name="l00375"></a>00375 _acceptsMultipleValues(false) <a name="l00376"></a>00376 { <a name="l00377"></a>00377 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a>.length() > 1 ) <a name="l00378"></a>00378 <span class="keywordflow">throw</span>(<a class="code" href="class_t_c_l_a_p_1_1_specification_exception.html" title="Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.">SpecificationException</a>( <a name="l00379"></a>00379 <span class="stringliteral">"Argument flag can only be one character long"</span>, <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac98a357568c21f0eb6ca2220b8a3d4a2" title="Returns a simple string representation of the argument.">toString</a>() ) ); <a name="l00380"></a>00380 <a name="l00381"></a>00381 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a> != <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a6ce0cbe4effd44679ca11f25e3c318e7" title="The name used to identify the ignore rest argument.">ignoreNameString</a>() && <a name="l00382"></a>00382 ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> == <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() || <a name="l00383"></a>00383 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> == <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() || <a name="l00384"></a>00384 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> == <span class="stringliteral">" "</span> ) ) <a name="l00385"></a>00385 <span class="keywordflow">throw</span>(<a class="code" href="class_t_c_l_a_p_1_1_specification_exception.html" title="Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.">SpecificationException</a>(<span class="stringliteral">"Argument flag cannot be either '"</span> + <a name="l00386"></a>00386 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() + <span class="stringliteral">"' or '"</span> + <a name="l00387"></a>00387 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() + <span class="stringliteral">"' or a space."</span>, <a name="l00388"></a>00388 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac98a357568c21f0eb6ca2220b8a3d4a2" title="Returns a simple string representation of the argument.">toString</a>() ) ); <a name="l00389"></a>00389 <a name="l00390"></a>00390 <span class="keywordflow">if</span> ( <span class="comment">/*( _name.find( Arg::flagStartString(), 0 ) != std::string::npos ) || */</span> <a name="l00391"></a>00391 ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>.find( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>(), 0 ) != std::string::npos ) || <a name="l00392"></a>00392 ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>.find( <span class="stringliteral">" "</span>, 0 ) != std::string::npos ) ) <a name="l00393"></a>00393 <span class="keywordflow">throw</span>(<a class="code" href="class_t_c_l_a_p_1_1_specification_exception.html" title="Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.">SpecificationException</a>(<span class="stringliteral">"Argument name cannot contain either '"</span> + <a name="l00394"></a>00394 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() + <span class="stringliteral">"' or '"</span> + <a name="l00395"></a>00395 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() + <span class="stringliteral">"' or space."</span>, <a name="l00396"></a>00396 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac98a357568c21f0eb6ca2220b8a3d4a2" title="Returns a simple string representation of the argument.">toString</a>() ) ); <a name="l00397"></a>00397 <a name="l00398"></a>00398 } <a name="l00399"></a>00399 <a name="l00400"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a15734a7cf52c8c4ab6df70f0997bbee3">00400</a> <span class="keyword">inline</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a15734a7cf52c8c4ab6df70f0997bbee3" title="Destructor.">Arg::~Arg</a>() { } <a name="l00401"></a>00401 <a name="l00402"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aef8efaf3811162b2b2b2a84c6db280fa">00402</a> <span class="keyword">inline</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aef8efaf3811162b2b2b2a84c6db280fa" title="Returns a short ID for the usage.">Arg::shortID</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& valueId )<span class="keyword"> const</span> <a name="l00403"></a>00403 <span class="keyword"></span>{ <a name="l00404"></a>00404 std::string <span class="keywordtype">id</span> = <span class="stringliteral">""</span>; <a name="l00405"></a>00405 <a name="l00406"></a>00406 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> != <span class="stringliteral">""</span> ) <a name="l00407"></a>00407 <span class="keywordtype">id</span> = <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a>; <a name="l00408"></a>00408 <span class="keywordflow">else</span> <a name="l00409"></a>00409 <span class="keywordtype">id</span> = <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>; <a name="l00410"></a>00410 <a name="l00411"></a>00411 std::string delim = <span class="stringliteral">" "</span>; <a name="l00412"></a>00412 delim[0] = <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aadef6ca7e40f5b3d3fd03186976aea7e" title="The delimiter that separates an argument flag/name from the value.">Arg::delimiter</a>(); <span class="comment">// ugly!!!</span> <a name="l00413"></a>00413 <a name="l00414"></a>00414 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a776682b7e19f4dc231bbad3d10034dfa" title="Indicates whether a value is required for the argument.">_valueRequired</a> ) <a name="l00415"></a>00415 <span class="keywordtype">id</span> += delim + <span class="stringliteral">"<"</span> + valueId + <span class="stringliteral">">"</span>; <a name="l00416"></a>00416 <a name="l00417"></a>00417 <span class="keywordflow">if</span> ( !<a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad16408bd1ca4d8b1d14d6c5129545a84" title="Indicating whether the argument is required.">_required</a> ) <a name="l00418"></a>00418 <span class="keywordtype">id</span> = <span class="stringliteral">"["</span> + <span class="keywordtype">id</span> + <span class="stringliteral">"]"</span>; <a name="l00419"></a>00419 <a name="l00420"></a>00420 <span class="keywordflow">return</span> id; <a name="l00421"></a>00421 } <a name="l00422"></a>00422 <a name="l00423"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aad93aff46e1fc67e3853765f565bfa96">00423</a> <span class="keyword">inline</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aad93aff46e1fc67e3853765f565bfa96" title="Returns a long ID for the usage.">Arg::longID</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& valueId )<span class="keyword"> const</span> <a name="l00424"></a>00424 <span class="keyword"></span>{ <a name="l00425"></a>00425 std::string <span class="keywordtype">id</span> = <span class="stringliteral">""</span>; <a name="l00426"></a>00426 <a name="l00427"></a>00427 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> != <span class="stringliteral">""</span> ) <a name="l00428"></a>00428 { <a name="l00429"></a>00429 <span class="keywordtype">id</span> += <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a>; <a name="l00430"></a>00430 <a name="l00431"></a>00431 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a776682b7e19f4dc231bbad3d10034dfa" title="Indicates whether a value is required for the argument.">_valueRequired</a> ) <a name="l00432"></a>00432 <span class="keywordtype">id</span> += <span class="stringliteral">" <"</span> + valueId + <span class="stringliteral">">"</span>; <a name="l00433"></a>00433 <a name="l00434"></a>00434 <span class="keywordtype">id</span> += <span class="stringliteral">", "</span>; <a name="l00435"></a>00435 } <a name="l00436"></a>00436 <a name="l00437"></a>00437 <span class="keywordtype">id</span> += <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>; <a name="l00438"></a>00438 <a name="l00439"></a>00439 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a776682b7e19f4dc231bbad3d10034dfa" title="Indicates whether a value is required for the argument.">_valueRequired</a> ) <a name="l00440"></a>00440 <span class="keywordtype">id</span> += <span class="stringliteral">" <"</span> + valueId + <span class="stringliteral">">"</span>; <a name="l00441"></a>00441 <a name="l00442"></a>00442 <span class="keywordflow">return</span> id; <a name="l00443"></a>00443 <a name="l00444"></a>00444 } <a name="l00445"></a>00445 <a name="l00446"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a657a8d2842b7de9ced5a5a55db01d367">00446</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a657a8d2842b7de9ced5a5a55db01d367" title="Operator ==.">Arg::operator==</a>(<span class="keyword">const</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a>& a)<span class="keyword"> const</span> <a name="l00447"></a>00447 <span class="keyword"></span>{ <a name="l00448"></a>00448 <span class="keywordflow">if</span> ( ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> != <span class="stringliteral">""</span> && <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> == a.<a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> ) || <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a> == a.<a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>) <a name="l00449"></a>00449 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00450"></a>00450 <span class="keywordflow">else</span> <a name="l00451"></a>00451 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00452"></a>00452 } <a name="l00453"></a>00453 <a name="l00454"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1943999fadcb4f28cecd6ba55ed0b085">00454</a> <span class="keyword">inline</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1943999fadcb4f28cecd6ba55ed0b085" title="Returns the argument description.">Arg::getDescription</a>()<span class="keyword"> const </span> <a name="l00455"></a>00455 <span class="keyword"></span>{ <a name="l00456"></a>00456 std::string desc = <span class="stringliteral">""</span>; <a name="l00457"></a>00457 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad16408bd1ca4d8b1d14d6c5129545a84" title="Indicating whether the argument is required.">_required</a> ) <a name="l00458"></a>00458 desc = <span class="stringliteral">"("</span> + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2ed097a868e34a0c4f6062ead744ac54" title="Label to be used in usage description.">_requireLabel</a> + <span class="stringliteral">") "</span>; <a name="l00459"></a>00459 <a name="l00460"></a>00460 <span class="comment">// if ( _valueRequired )</span> <a name="l00461"></a>00461 <span class="comment">// desc += "(value required) ";</span> <a name="l00462"></a>00462 <a name="l00463"></a>00463 desc += <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9882fe256eaab01ac53db54ac657d272" title="Description of the argument.">_description</a>; <a name="l00464"></a>00464 <span class="keywordflow">return</span> desc; <a name="l00465"></a>00465 } <a name="l00466"></a>00466 <a name="l00467"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a22f616e81a423e794f13a9ae1549ac77">00467</a> <span class="keyword">inline</span> <span class="keyword">const</span> std::string& <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a22f616e81a423e794f13a9ae1549ac77" title="Returns the argument flag.">Arg::getFlag</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a>; } <a name="l00468"></a>00468 <a name="l00469"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a641ced141a56c74fee11d3e3a808f731">00469</a> <span class="keyword">inline</span> <span class="keyword">const</span> std::string& <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a641ced141a56c74fee11d3e3a808f731" title="Returns the argument name.">Arg::getName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a>; } <a name="l00470"></a>00470 <a name="l00471"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a00a3cfdb2b6e9a111ad39cbd4978b96c">00471</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a00a3cfdb2b6e9a111ad39cbd4978b96c" title="Indicates whether the argument is required.">Arg::isRequired</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad16408bd1ca4d8b1d14d6c5129545a84" title="Indicating whether the argument is required.">_required</a>; } <a name="l00472"></a>00472 <a name="l00473"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1373d50d4b93c16db43c7600cf6d0355">00473</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1373d50d4b93c16db43c7600cf6d0355" title="Indicates whether a value must be specified for argument.">Arg::isValueRequired</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a776682b7e19f4dc231bbad3d10034dfa" title="Indicates whether a value is required for the argument.">_valueRequired</a>; } <a name="l00474"></a>00474 <a name="l00475"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a6af7a1e92b5d92fc2d90c1a95aab4384">00475</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a6af7a1e92b5d92fc2d90c1a95aab4384" title="Indicates whether the argument has already been set.">Arg::isSet</a>()<span class="keyword"> const </span> <a name="l00476"></a>00476 <span class="keyword"></span>{ <a name="l00477"></a>00477 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a829e32129857d2683e5791a5df1208ec" title="Indicates whether the argument has been set.">_alreadySet</a> && !<a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab413bd1d8a7ecf3c89672ee23ef791ba" title="Indicates that the arg was set as part of an XOR and not on the command line.">_xorSet</a> ) <a name="l00478"></a>00478 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00479"></a>00479 <span class="keywordflow">else</span> <a name="l00480"></a>00480 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00481"></a>00481 } <a name="l00482"></a>00482 <a name="l00483"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a33816b5ccc58a15f3a998480e5d988e2">00483</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a33816b5ccc58a15f3a998480e5d988e2" title="Indicates whether the argument can be ignored, if desired.">Arg::isIgnoreable</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9832bb7564f4ab472bd51b7b1bbc683f" title="Whether this argument can be ignored, if desired.">_ignoreable</a>; } <a name="l00484"></a>00484 <a name="l00485"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aae5c959f31af1a484a8af06f84a6e8b0">00485</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aae5c959f31af1a484a8af06f84a6e8b0" title="Sets the requireLabel.">Arg::setRequireLabel</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& s) <a name="l00486"></a>00486 { <a name="l00487"></a>00487 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2ed097a868e34a0c4f6062ead744ac54" title="Label to be used in usage description.">_requireLabel</a> = s; <a name="l00488"></a>00488 } <a name="l00489"></a>00489 <a name="l00490"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aac37b1b734b477e5d16f2037dba9c125">00490</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aac37b1b734b477e5d16f2037dba9c125" title="A method that tests whether a string matches this argument.">Arg::argMatches</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& argFlag )<span class="keyword"> const</span> <a name="l00491"></a>00491 <span class="keyword"></span>{ <a name="l00492"></a>00492 <span class="keywordflow">if</span> ( ( argFlag == <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> && <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> != <span class="stringliteral">""</span> ) || <a name="l00493"></a>00493 argFlag == <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a> ) <a name="l00494"></a>00494 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00495"></a>00495 <span class="keywordflow">else</span> <a name="l00496"></a>00496 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00497"></a>00497 } <a name="l00498"></a>00498 <a name="l00499"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac98a357568c21f0eb6ca2220b8a3d4a2">00499</a> <span class="keyword">inline</span> std::string <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac98a357568c21f0eb6ca2220b8a3d4a2" title="Returns a simple string representation of the argument.">Arg::toString</a>()<span class="keyword"> const</span> <a name="l00500"></a>00500 <span class="keyword"></span>{ <a name="l00501"></a>00501 std::string s = <span class="stringliteral">""</span>; <a name="l00502"></a>00502 <a name="l00503"></a>00503 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> != <span class="stringliteral">""</span> ) <a name="l00504"></a>00504 s += <a class="code" href="class_t_c_l_a_p_1_1_arg.html#af8e739295b0f75028e7bff6d670d97a1" title="The sting that indicates the beginning of a flag.">Arg::flagStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ae68407a0a8223023ad0ae3b9dc7986f5" title="The single char flag used to identify the argument.">_flag</a> + <span class="stringliteral">" "</span>; <a name="l00505"></a>00505 <a name="l00506"></a>00506 s += <span class="stringliteral">"("</span> + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a1df2134870528b80f9f35347fef6fd14" title="The sting that indicates the beginning of a name.">Arg::nameStartString</a>() + <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ac0f138057a99fb5d94ff4acb41a083aa" title="A single work namd indentifying the argument.">_name</a> + <span class="stringliteral">")"</span>; <a name="l00507"></a>00507 <a name="l00508"></a>00508 <span class="keywordflow">return</span> s; <a name="l00509"></a>00509 } <a name="l00510"></a>00510 <a name="l00511"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa963d0d4c8cb297e1f4cf74143bf6d1b">00511</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa963d0d4c8cb297e1f4cf74143bf6d1b" title="Performs the special handling described by the Vistitor.">Arg::_checkWithVisitor</a>()<span class="keyword"> const</span> <a name="l00512"></a>00512 <span class="keyword"></span>{ <a name="l00513"></a>00513 <span class="keywordflow">if</span> ( <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa9ff037e92c9fa5bd85e532f61899300" title="A pointer to a vistitor object.">_visitor</a> != NULL ) <a name="l00514"></a>00514 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aa9ff037e92c9fa5bd85e532f61899300" title="A pointer to a vistitor object.">_visitor</a>-><a class="code" href="class_t_c_l_a_p_1_1_visitor.html#a08625664637579a24ba2f0ab3e713670" title="Does nothing.">visit</a>(); <a name="l00515"></a>00515 } <a name="l00516"></a>00516 <span class="comment"></span> <a name="l00517"></a>00517 <span class="comment">/**</span> <a name="l00518"></a>00518 <span class="comment"> * Implementation of trimFlag.</span> <a name="l00519"></a>00519 <span class="comment"> */</span> <a name="l00520"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a54595328e81f5fb77859563690faab25">00520</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a54595328e81f5fb77859563690faab25" title="Trims a value off of the flag.">Arg::trimFlag</a>(<a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& flag, <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& value)<span class="keyword"> const</span> <a name="l00521"></a>00521 <span class="keyword"></span>{ <a name="l00522"></a>00522 <span class="keywordtype">int</span> stop = 0; <a name="l00523"></a>00523 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; <span class="keyword">static_cast<</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">></span>(i) < flag.length(); i++ ) <a name="l00524"></a>00524 <span class="keywordflow">if</span> ( flag[i] == <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aadef6ca7e40f5b3d3fd03186976aea7e" title="The delimiter that separates an argument flag/name from the value.">Arg::delimiter</a>() ) <a name="l00525"></a>00525 { <a name="l00526"></a>00526 stop = i; <a name="l00527"></a>00527 <span class="keywordflow">break</span>; <a name="l00528"></a>00528 } <a name="l00529"></a>00529 <a name="l00530"></a>00530 <span class="keywordflow">if</span> ( stop > 1 ) <a name="l00531"></a>00531 { <a name="l00532"></a>00532 value = flag.substr(stop+1); <a name="l00533"></a>00533 flag = flag.substr(0,stop); <a name="l00534"></a>00534 } <a name="l00535"></a>00535 <a name="l00536"></a>00536 } <a name="l00537"></a>00537 <span class="comment"></span> <a name="l00538"></a>00538 <span class="comment">/**</span> <a name="l00539"></a>00539 <span class="comment"> * Implementation of _hasBlanks.</span> <a name="l00540"></a>00540 <span class="comment"> */</span> <a name="l00541"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2eb0ffefe163218bdc8b4b7a33a974a7">00541</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a2eb0ffefe163218bdc8b4b7a33a974a7" title="Checks whether a given string has blank chars, indicating that it is a combined SwitchArg.">Arg::_hasBlanks</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>& s )<span class="keyword"> const</span> <a name="l00542"></a>00542 <span class="keyword"></span>{ <a name="l00543"></a>00543 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 1; <span class="keyword">static_cast<</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">></span>(i) < s.length(); i++ ) <a name="l00544"></a>00544 <span class="keywordflow">if</span> ( s[i] == <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a40ba4acecb58080ba33aa57d99e14cad" title="The char used as a place holder when SwitchArgs are combined.">Arg::blankChar</a>() ) <a name="l00545"></a>00545 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00546"></a>00546 <a name="l00547"></a>00547 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00548"></a>00548 } <a name="l00549"></a>00549 <a name="l00550"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a58e3de560f364d0bb6bdf36ab533a6fd">00550</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a58e3de560f364d0bb6bdf36ab533a6fd" title="Sets _required to true.">Arg::forceRequired</a>() <a name="l00551"></a>00551 { <a name="l00552"></a>00552 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad16408bd1ca4d8b1d14d6c5129545a84" title="Indicating whether the argument is required.">_required</a> = <span class="keyword">true</span>; <a name="l00553"></a>00553 } <a name="l00554"></a>00554 <a name="l00555"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#aec525c8092e56f7f5aa455e71bc72374">00555</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#aec525c8092e56f7f5aa455e71bc72374" title="Sets the _alreadySet value to true.">Arg::xorSet</a>() <a name="l00556"></a>00556 { <a name="l00557"></a>00557 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a829e32129857d2683e5791a5df1208ec" title="Indicates whether the argument has been set.">_alreadySet</a> = <span class="keyword">true</span>; <a name="l00558"></a>00558 <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ab413bd1d8a7ecf3c89672ee23ef791ba" title="Indicates that the arg was set as part of an XOR and not on the command line.">_xorSet</a> = <span class="keyword">true</span>; <a name="l00559"></a>00559 } <a name="l00560"></a>00560 <span class="comment"></span> <a name="l00561"></a>00561 <span class="comment">/**</span> <a name="l00562"></a>00562 <span class="comment"> * Overridden by Args that need to added to the end of the list.</span> <a name="l00563"></a>00563 <span class="comment"> */</span> <a name="l00564"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9ff1564beeea2ef855f7fa483c37d0e2">00564</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9ff1564beeea2ef855f7fa483c37d0e2" title="Adds this to the specified list of Args.">Arg::addToList</a>( <a class="code" href="classstd_1_1list.html">std::list<Arg*></a>& argList )<span class="keyword"> const</span> <a name="l00565"></a>00565 <span class="keyword"></span>{ <a name="l00566"></a>00566 argList.push_front( const_cast<Arg*>(<span class="keyword">this</span>) ); <a name="l00567"></a>00567 } <a name="l00568"></a>00568 <a name="l00569"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9aef735d37ef95ca1b7dc7a07850b984">00569</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a9aef735d37ef95ca1b7dc7a07850b984">Arg::allowMore</a>() <a name="l00570"></a>00570 { <a name="l00571"></a>00571 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00572"></a>00572 } <a name="l00573"></a>00573 <a name="l00574"></a><a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad356870538a255d639e26b30330202ae">00574</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#ad356870538a255d639e26b30330202ae">Arg::acceptsMultipleValues</a>() <a name="l00575"></a>00575 { <a name="l00576"></a>00576 <span class="keywordflow">return</span> <a class="code" href="class_t_c_l_a_p_1_1_arg.html#a13130a9a5d22c57a6d42a8883c9b1e0f">_acceptsMultipleValues</a>; <a name="l00577"></a>00577 } <a name="l00578"></a>00578 <span class="comment"></span> <a name="l00579"></a>00579 <span class="comment">//////////////////////////////////////////////////////////////////////</span> <a name="l00580"></a>00580 <span class="comment"></span><span class="comment">//END Arg.cpp</span><span class="comment"></span> <a name="l00581"></a>00581 <span class="comment">//////////////////////////////////////////////////////////////////////</span> <a name="l00582"></a>00582 <span class="comment"></span> <a name="l00583"></a>00583 } <span class="comment">//namespace TCLAP</span> <a name="l00584"></a>00584 <a name="l00585"></a>00585 <span class="preprocessor">#endif</span> <a name="l00586"></a>00586 <span class="preprocessor"></span> </pre></div></div> </div> <br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150"> </td></tr> </table> </body></html>