Go to the documentation of this file.
28 #ifndef TCLAP_MULTI_SWITCH_ARG_H
29 #define TCLAP_MULTI_SWITCH_ARG_H
42 class MultiSwitchArg :
public SwitchArg
73 const std::string& name,
74 const std::string& desc,
94 const std::string& name,
95 const std::string& desc,
96 CmdLineInterface& parser,
109 virtual bool processArg(
int* i, std::vector<std::string>& args);
119 std::string
shortID(
const std::string& val)
const;
124 std::string
longID(
const std::string& val)
const;
134 const std::string& name,
135 const std::string& desc,
138 : SwitchArg(flag, name, desc, false, v),
144 const std::string& name,
145 const std::string& desc,
146 CmdLineInterface& parser,
149 : SwitchArg(flag, name, desc, false, v),
202 return Arg::longID(val) +
" (accepted multiple times)";
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.
void _checkWithVisitor() const
Performs the special handling described by the Visitor.
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 shortID(const std::string &valueId="val") const
Returns a short ID for the usage.
bool _ignoreable
Whether this argument can be ignored, if desired.
static bool ignoreRest()
Whether to ignore the rest.
int getValue() const
Returns int, the number of times the switch has been set.
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.
int _value
The value of the switch.
bool combinedSwitchesMatch(std::string &combined)
Checks a string to see if any of the chars in the string match the flag for this Switch.
A base class that defines the interface for visitors.
std::string shortID(const std::string &val) const
Returns the shortID for this Arg.
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.