32 #ifndef TCLAP_SWITCH_ARG_H 33 #define TCLAP_SWITCH_ARG_H 71 const std::string& name,
72 const std::string& desc,
91 const std::string& name,
92 const std::string& desc,
106 virtual bool processArg(
int* i, std::vector<std::string>& args);
125 const std::string& name,
126 const std::string& desc,
129 :
Arg(flag, name, desc, false, false, v),
134 const std::string& name,
135 const std::string& desc,
139 :
Arg(flag, name, desc, false, false, v),
160 for (
unsigned int i = 1; i < combinedSwitches.length(); i++ )
161 if ( combinedSwitches[i] ==
_flag[0] )
bool _value
The value of the switch.
void _checkWithVisitor() const
Performs the special handling described by the Vistitor.
virtual bool argMatches(const std::string &s) const
A method that tests whether a string matches this argument.
A virtual base class that defines the essential data for all arguments.
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
A simple switch argument.
static const std::string nameStartString()
The sting that indicates the beginning of a name.
bool _alreadySet
Indicates whether the argument has been set.
static const std::string flagStartString()
The sting that indicates the beginning of a flag.
Thrown from CmdLine when the arguments on the command line are not properly specified,...
A base class that defines the interface for visitors.
std::string _flag
The single char flag used to identify the argument.
bool combinedSwitchesMatch(std::string &combined)
Checks a string to see if any of the chars in the string match the flag for this Switch.
bool _ignoreable
Whether this argument can be ignored, if desired.
virtual std::string toString() const
Returns a simple string representation of the argument.
static bool ignoreRest()
Whether to ignore the rest.
bool getValue()
Returns bool, whether or not the switch has been set.
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.
SwitchArg(const std::string &flag, const std::string &name, const std::string &desc, bool def=false, Visitor *v=NULL)
SwitchArg constructor.
static char blankChar()
The char used as a place holder when SwitchArgs are combined.
The base class that manages the command line definition and passes along the parsing to the appropria...