33 #ifndef TCLAP_MULTI_SWITCH_ARG_H 34 #define TCLAP_MULTI_SWITCH_ARG_H 47 template <
class DUMMY =
int>
74 const std::string& name,
75 const std::string& desc,
95 const std::string& name,
96 const std::string& desc,
110 virtual bool processArg(
int* i, std::vector<std::string>& args);
120 std::string
shortID(
const std::string& val)
const;
125 std::string
longID(
const std::string& val)
const;
131 template <
class DUMMY>
133 const std::string& name,
134 const std::string& desc,
141 template <
class DUMMY>
143 const std::string& name,
144 const std::string& desc,
154 template <
class DUMMY>
157 template <
class DUMMY>
195 template <
class DUMMY>
203 template <
class DUMMY>
206 std::string
id =
Arg::longID() +
" (accepted multiple times)";
int getValue()
Returns int, the number of times the switch has been set.
int _value
The value of the switch.
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
A simple switch argument.
A multiple switch argument.
void _checkWithVisitor() const
Performs the special handling described by the Vistitor.
virtual std::string shortID(const std::string &valueId="val") const
Returns a short ID for the usage.
bool _alreadySet
Indicates whether the argument has been set.
MultiSwitchArg(const std::string &flag, const std::string &name, const std::string &desc, int init=0, Visitor *v=NULL)
MultiSwitchArg constructor.
A base class that defines the interface for visitors.
virtual std::string longID(const std::string &valueId="val") const
Returns a long ID for the usage.
std::string shortID(const std::string &val) const
Returns the shortID for this Arg.
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of 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 bool argMatches(const std::string &s) const
A method that tests whether a string matches this argument.
static bool ignoreRest()
Whether to ignore the rest.
std::string longID(const std::string &val) const
Returns the longID for this Arg.
The base class that manages the command line definition and passes along the parsing to the appropria...