<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <title>tclap: TCLAP::SwitchArg Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.0 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceTCLAP.html">TCLAP</a>::<a class="el" href="classTCLAP_1_1SwitchArg.html">SwitchArg</a> </div> </div> <div class="contents"> <h1>TCLAP::SwitchArg Class Reference</h1><!-- doxytag: class="TCLAP::SwitchArg" --><!-- doxytag: inherits="TCLAP::Arg" --> <p>A simple switch argument. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>></code></p> <div class="dynheader"> Inheritance diagram for TCLAP::SwitchArg:</div> <div class="dynsection"> <div class="center"> <img src="classTCLAP_1_1SwitchArg.gif" usemap="#TCLAP::SwitchArg_map" alt=""/> <map id="TCLAP::SwitchArg_map" name="TCLAP::SwitchArg_map"> <area href="classTCLAP_1_1Arg.html" alt="TCLAP::Arg" shape="rect" coords="0,0,143,24"/> <area href="classTCLAP_1_1MultiSwitchArg.html" alt="TCLAP::MultiSwitchArg" shape="rect" coords="0,112,143,136"/> </map> </div> </div> <p><a href="classTCLAP_1_1SwitchArg-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#a3895b036fa2d36e4fcfa41dfcdb298c1">SwitchArg</a> (const std::string &flag, const std::string &name, const std::string &desc, bool def=false, <a class="el" href="classTCLAP_1_1Visitor.html">Visitor</a> *v=NULL)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classTCLAP_1_1SwitchArg.html" title="A simple switch argument.">SwitchArg</a> constructor. <a href="#a3895b036fa2d36e4fcfa41dfcdb298c1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#af7e9628155772af0686f6a2114dfe78b">SwitchArg</a> (const std::string &flag, const std::string &name, const std::string &desc, <a class="el" href="classTCLAP_1_1CmdLineInterface.html">CmdLineInterface</a> &parser, bool def=false, <a class="el" href="classTCLAP_1_1Visitor.html">Visitor</a> *v=NULL)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classTCLAP_1_1SwitchArg.html" title="A simple switch argument.">SwitchArg</a> constructor. <a href="#af7e9628155772af0686f6a2114dfe78b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#a624f98df6c4907efec95ffc353e9d08c">processArg</a> (int *i, std::vector< std::string > &args)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Handles the processing of the argument. <a href="#a624f98df6c4907efec95ffc353e9d08c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#af5fbd44d462539941b09e960034d692c">combinedSwitchesMatch</a> (std::string &combined)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks a string to see if any of the chars in the string match the flag for this Switch. <a href="#af5fbd44d462539941b09e960034d692c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#aed1bc8a81a9bda4013cfcf407ccc7716">getValue</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns bool, whether or not the switch has been set. <a href="#aed1bc8a81a9bda4013cfcf407ccc7716"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#af8561d903ec3c11f5f2175e6db179d9c">reset</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Clears the <a class="el" href="classTCLAP_1_1Arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a> object and allows it to be reused by new command lines. <a href="#af8561d903ec3c11f5f2175e6db179d9c"></a><br/></td></tr> <tr><td colspan="2"><h2>Protected Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#a0389ecebecc504d9756703d46e8cf3ca">_value</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The value of the switch. <a href="#a0389ecebecc504d9756703d46e8cf3ca"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTCLAP_1_1SwitchArg.html#ae25a99eb06fc2ee75a3b98edba1d5d8d">_default</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Used to support the <a class="el" href="classTCLAP_1_1SwitchArg.html#af8561d903ec3c11f5f2175e6db179d9c" title="Clears the Arg object and allows it to be reused by new command lines.">reset()</a> method so that <a class="el" href="classTCLAP_1_1ValueArg.html" title="The basic labeled argument that parses a value.">ValueArg</a> can be reset to their constructed value. <a href="#ae25a99eb06fc2ee75a3b98edba1d5d8d"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>A simple switch argument. </p> <p>If the switch is set on the command line, then the getValue method will return the opposite of the default value for the switch. </p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00039">39</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a3895b036fa2d36e4fcfa41dfcdb298c1"></a><!-- doxytag: member="TCLAP::SwitchArg::SwitchArg" ref="a3895b036fa2d36e4fcfa41dfcdb298c1" args="(const std::string &flag, const std::string &name, const std::string &desc, bool def=false, Visitor *v=NULL)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">TCLAP::SwitchArg::SwitchArg </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>flag</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>desc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>def</em> = <code>false</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classTCLAP_1_1Visitor.html">Visitor</a> * </td> <td class="paramname"> <em>v</em> = <code>NULL</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="classTCLAP_1_1SwitchArg.html" title="A simple switch argument.">SwitchArg</a> constructor. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>flag</em> </td><td>- The one character flag that identifies this argument on the command line. </td></tr> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>- A one word name for the argument. Can be used as a long flag on the command line. </td></tr> <tr><td valign="top"></td><td valign="top"><em>desc</em> </td><td>- A description of what the argument is for or does. </td></tr> <tr><td valign="top"></td><td valign="top"><em>def</em> </td><td>- The default value for this Switch. </td></tr> <tr><td valign="top"></td><td valign="top"><em>v</em> </td><td>- An optional visitor. You probably should not use this unless you have a very good reason. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00135">135</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> </div> </div> <a class="anchor" id="af7e9628155772af0686f6a2114dfe78b"></a><!-- doxytag: member="TCLAP::SwitchArg::SwitchArg" ref="af7e9628155772af0686f6a2114dfe78b" args="(const std::string &flag, const std::string &name, const std::string &desc, CmdLineInterface &parser, bool def=false, Visitor *v=NULL)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">TCLAP::SwitchArg::SwitchArg </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>flag</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>desc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classTCLAP_1_1CmdLineInterface.html">CmdLineInterface</a> & </td> <td class="paramname"> <em>parser</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>def</em> = <code>false</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classTCLAP_1_1Visitor.html">Visitor</a> * </td> <td class="paramname"> <em>v</em> = <code>NULL</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p><a class="el" href="classTCLAP_1_1SwitchArg.html" title="A simple switch argument.">SwitchArg</a> constructor. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>flag</em> </td><td>- The one character flag that identifies this argument on the command line. </td></tr> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>- A one word name for the argument. Can be used as a long flag on the command line. </td></tr> <tr><td valign="top"></td><td valign="top"><em>desc</em> </td><td>- A description of what the argument is for or does. </td></tr> <tr><td valign="top"></td><td valign="top"><em>parser</em> </td><td>- A <a class="el" href="classTCLAP_1_1CmdLine.html" title="The base class that manages the command line definition and passes along the parsing...">CmdLine</a> parser object to add this <a class="el" href="classTCLAP_1_1Arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a> to </td></tr> <tr><td valign="top"></td><td valign="top"><em>def</em> </td><td>- The default value for this Switch. </td></tr> <tr><td valign="top"></td><td valign="top"><em>v</em> </td><td>- An optional visitor. You probably should not use this unless you have a very good reason. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00145">145</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>References <a class="el" href="classTCLAP_1_1CmdLineInterface.html#a13b29ab754c030185e58f779dc355631">TCLAP::CmdLineInterface::add()</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="af5fbd44d462539941b09e960034d692c"></a><!-- doxytag: member="TCLAP::SwitchArg::combinedSwitchesMatch" ref="af5fbd44d462539941b09e960034d692c" args="(std::string &combined)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool TCLAP::SwitchArg::combinedSwitchesMatch </td> <td>(</td> <td class="paramtype">std::string & </td> <td class="paramname"> <em>combined</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Checks a string to see if any of the chars in the string match the flag for this Switch. </p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00169">169</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>References <a class="el" href="Arg_8h_source.html#l00098">TCLAP::Arg::_flag</a>, <a class="el" href="Arg_8h_source.html#l00217">TCLAP::Arg::blankChar()</a>, <a class="el" href="Arg_8h_source.html#l00211">TCLAP::Arg::delimiter()</a>, <a class="el" href="Arg_8h_source.html#l00236">TCLAP::Arg::flagStartString()</a>, and <a class="el" href="Arg_8h_source.html#l00245">TCLAP::Arg::nameStartString()</a>.</p> <p>Referenced by <a class="el" href="SwitchArg_8h_source.html#l00223">processArg()</a>, and <a class="el" href="MultiSwitchArg_8h_source.html#l00155">TCLAP::MultiSwitchArg::processArg()</a>.</p> </div> </div> <a class="anchor" id="aed1bc8a81a9bda4013cfcf407ccc7716"></a><!-- doxytag: member="TCLAP::SwitchArg::getValue" ref="aed1bc8a81a9bda4013cfcf407ccc7716" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool TCLAP::SwitchArg::getValue </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns bool, whether or not the switch has been set. </p> <p>Reimplemented in <a class="el" href="classTCLAP_1_1MultiSwitchArg.html#a0389e414c11ebbab4a88dfbbf3af18bd">TCLAP::MultiSwitchArg</a>.</p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00158">158</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>References <a class="el" href="SwitchArg_8h_source.html#l00046">_value</a>.</p> </div> </div> <a class="anchor" id="a624f98df6c4907efec95ffc353e9d08c"></a><!-- doxytag: member="TCLAP::SwitchArg::processArg" ref="a624f98df6c4907efec95ffc353e9d08c" args="(int *i, std::vector< std::string > &args)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool TCLAP::SwitchArg::processArg </td> <td>(</td> <td class="paramtype">int * </td> <td class="paramname"> <em>i</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::vector< std::string > & </td> <td class="paramname"> <em>args</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Handles the processing of the argument. </p> <p>This re-implements the <a class="el" href="classTCLAP_1_1Arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a> version of this method to set the _value of the argument appropriately. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>i</em> </td><td>- Pointer the the current argument in the list. </td></tr> <tr><td valign="top"></td><td valign="top"><em>args</em> </td><td>- Mutable list of strings. Passed in from main(). </td></tr> </table> </dd> </dl> <p>Implements <a class="el" href="classTCLAP_1_1Arg.html#a61ffe2f660a76111d256f7b22a686146">TCLAP::Arg</a>.</p> <p>Reimplemented in <a class="el" href="classTCLAP_1_1MultiSwitchArg.html#a91c3d349570f21d8af6dc90767d747a2">TCLAP::MultiSwitchArg</a>.</p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00223">223</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>References <a class="el" href="Arg_8h_source.html#l00150">TCLAP::Arg::_ignoreable</a>, <a class="el" href="Arg_8h_source.html#l00590">TCLAP::Arg::argMatches()</a>, <a class="el" href="SwitchArg_8h_source.html#l00169">combinedSwitchesMatch()</a>, <a class="el" href="Arg_8h_source.html#l00205">TCLAP::Arg::ignoreRest()</a>, and <a class="el" href="Arg_8h_source.html#l00599">TCLAP::Arg::toString()</a>.</p> </div> </div> <a class="anchor" id="af8561d903ec3c11f5f2175e6db179d9c"></a><!-- doxytag: member="TCLAP::SwitchArg::reset" ref="af8561d903ec3c11f5f2175e6db179d9c" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void TCLAP::SwitchArg::reset </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Clears the <a class="el" href="classTCLAP_1_1Arg.html" title="A virtual base class that defines the essential data for all arguments.">Arg</a> object and allows it to be reused by new command lines. </p> <p>Reimplemented from <a class="el" href="classTCLAP_1_1Arg.html#ab5b5dc9a9b0381561f0684523f943a2c">TCLAP::Arg</a>.</p> <p>Reimplemented in <a class="el" href="classTCLAP_1_1MultiSwitchArg.html#ac320530811dbca7fdcb2a41ab252fce4">TCLAP::MultiSwitchArg</a>.</p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00255">255</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>References <a class="el" href="SwitchArg_8h_source.html#l00052">_default</a>, and <a class="el" href="SwitchArg_8h_source.html#l00046">_value</a>.</p> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="ae25a99eb06fc2ee75a3b98edba1d5d8d"></a><!-- doxytag: member="TCLAP::SwitchArg::_default" ref="ae25a99eb06fc2ee75a3b98edba1d5d8d" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classTCLAP_1_1SwitchArg.html#ae25a99eb06fc2ee75a3b98edba1d5d8d">TCLAP::SwitchArg::_default</a><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Used to support the <a class="el" href="classTCLAP_1_1SwitchArg.html#af8561d903ec3c11f5f2175e6db179d9c" title="Clears the Arg object and allows it to be reused by new command lines.">reset()</a> method so that <a class="el" href="classTCLAP_1_1ValueArg.html" title="The basic labeled argument that parses a value.">ValueArg</a> can be reset to their constructed value. </p> <p>Reimplemented in <a class="el" href="classTCLAP_1_1MultiSwitchArg.html#afcd5b3e418e455af3d31aec1e300bb74">TCLAP::MultiSwitchArg</a>.</p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00052">52</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>Referenced by <a class="el" href="SwitchArg_8h_source.html#l00255">reset()</a>.</p> </div> </div> <a class="anchor" id="a0389ecebecc504d9756703d46e8cf3ca"></a><!-- doxytag: member="TCLAP::SwitchArg::_value" ref="a0389ecebecc504d9756703d46e8cf3ca" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classTCLAP_1_1SwitchArg.html#a0389ecebecc504d9756703d46e8cf3ca">TCLAP::SwitchArg::_value</a><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>The value of the switch. </p> <p>Reimplemented in <a class="el" href="classTCLAP_1_1MultiSwitchArg.html#ab488d4bcdde96fc9edea87ee9b6f5839">TCLAP::MultiSwitchArg</a>.</p> <p>Definition at line <a class="el" href="SwitchArg_8h_source.html#l00046">46</a> of file <a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a>.</p> <p>Referenced by <a class="el" href="SwitchArg_8h_source.html#l00158">getValue()</a>, and <a class="el" href="SwitchArg_8h_source.html#l00255">reset()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="SwitchArg_8h_source.html">SwitchArg.h</a></li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated on Sat Apr 16 15:34:25 2011 for tclap by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.0 </small></address> </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 16129 | tjuricek |
Rename/move files again... this time to the hyphenated-approach. |
||
//guest/tjuricek/file_system_client/main/vendor/tclap-1.2.1/docs/html/classTCLAP_1_1SwitchArg.html | |||||
#1 | 16119 | tjuricek | Rename/move to meet workshop project conventions. | ||
//guest/tjuricek/fsclient/vendor/tclap-1.2.1/docs/html/classTCLAP_1_1SwitchArg.html | |||||
#1 | 16118 | tjuricek |
FSClient initial version: handles add, edit This is a proof-of-concept app that mirrors an existing Perforce workspace to handle running commands like "p4 add" and "p4 edit" automatically when your apps add and write files. See the readme for more information. |