25 #ifndef TCLAP_MULTI_SWITCH_ARG_H
26 #define TCLAP_MULTI_SWITCH_ARG_H
70 const std::string& name,
71 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);
116 std::string
shortID(
const std::string& val)
const;
121 std::string
longID(
const std::string& val)
const;
131 const std::string& name,
132 const std::string& desc,
141 const std::string& name,
142 const std::string& desc,
201 return Arg::longID(val) +
" (accepted multiple times)";
bool _alreadySet
Indicates whether the argument has been set.
bool combinedSwitchesMatch(std::string &combined)
Checks a string to see if any of the chars in the string match the flag for this Switch.
std::string longID(const std::string &val) const
Returns the longID for this Arg.
int _default
Used to support the reset() method so that ValueArg can be reset to their constructed value...
virtual std::string longID(const std::string &valueId="val") const
Returns a long ID for the usage.
A simple switch argument.
void _checkWithVisitor() const
Performs the special handling described by the Vistitor.
int getValue()
Returns int, the number of times the switch has been set.
MultiSwitchArg(const std::string &flag, const std::string &name, const std::string &desc, int init=0, Visitor *v=NULL)
MultiSwitchArg constructor.
std::string shortID(const std::string &val) const
Returns the shortID for this Arg.
A multiple switch argument.
virtual std::string shortID(const std::string &valueId="val") const
Returns a short ID for the usage.
A base class that defines the interface for visitors.
The base class that manages the command line definition and passes along the parsing to the appropria...
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
bool _ignoreable
Whether this argument can be ignored, if desired.
int _value
The value of the switch.
static bool ignoreRest()
Whether to ignore the rest.
virtual bool argMatches(const std::string &s) const
A method that tests whether a string matches this argument.
void reset()
Clears the Arg object and allows it to be reused by new command lines.
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.