26 #ifndef TCLAP_MULTI_SWITCH_ARG_H 27 #define TCLAP_MULTI_SWITCH_ARG_H 68 const std::string &desc,
int init = 0,
Visitor *v = NULL);
85 const std::string &desc,
ArgContainer &parser,
int init = 0,
96 virtual bool processArg(
int *i, std::vector<std::string> &args);
106 std::string
shortID(
const std::string &val)
const;
111 std::string
longID(
const std::string &val)
const;
117 const std::string &name,
118 const std::string &desc,
int init,
123 const std::string &name,
124 const std::string &desc,
166 return Arg::longID(val) +
" (accepted multiple times)";
175 #endif // TCLAP_MULTI_SWITCH_ARG_H virtual bool argMatches(const std::string &s) const
A method that tests whether a string matches this argument.
bool _alreadySet
Indicates whether the argument has been set.
virtual ArgContainer & add(Arg &a)=0
Adds an 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.
int _default
Used to support the reset() method so that ValueArg can be reset to their constructed value...
std::string longID(const std::string &val) const
Returns the longID for this Arg.
A simple switch argument.
virtual std::string longID(const std::string &valueId="val") const
Returns a long ID for the usage.
MultiSwitchArg(const std::string &flag, const std::string &name, const std::string &desc, int init=0, Visitor *v=NULL)
MultiSwitchArg constructor.
A multiple switch argument.
void _checkWithVisitor() const
Performs the special handling described by the Visitor.
Interface that allows adding an Arg to a "container".
int getValue() const
Returns int, the number of times the switch has been set.
A base class that defines the interface for visitors.
virtual std::string shortID(const std::string &valueId="val") const
Returns a short ID for the usage.
std::string shortID(const std::string &val) const
Returns the shortID for this Arg.
int _value
The value of the switch.
void reset()
Clears the Arg object and allows it to be reused by new command lines.
std::string _setBy
Indicates the value specified to set this flag (like -a or –all).
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.