Go to the documentation of this file.
23 #ifndef TCLAP_MULTIPLE_UNLABELED_ARGUMENT_H
24 #define TCLAP_MULTIPLE_UNLABELED_ARGUMENT_H
40 class UnlabeledMultiArg :
public MultiArg<T>
74 const std::string& desc,
76 const std::string& typeDesc,
77 bool ignoreable =
false,
98 const std::string& desc,
100 const std::string& typeDesc,
101 CmdLineInterface& parser,
102 bool ignoreable =
false,
121 const std::string& desc,
123 Constraint<T>* constraint,
124 bool ignoreable =
false,
144 const std::string& desc,
146 Constraint<T>* constraint,
147 CmdLineInterface& parser,
148 bool ignoreable =
false,
159 virtual bool processArg(
int* i, std::vector<std::string>& args);
165 virtual std::string
shortID(
const std::string& val=
"val")
const;
171 virtual std::string
longID(
const std::string& val=
"val")
const;
183 virtual void addToList( std::list<Arg*>& argList )
const;
188 const std::string& desc,
190 const std::string& typeDesc,
193 : MultiArg<T>(
"", name, desc, req, typeDesc, v)
201 const std::string& desc,
203 const std::string& typeDesc,
204 CmdLineInterface& parser,
207 :
MultiArg<T>(
"", name, desc, req, typeDesc, v)
217 const std::string& desc,
222 :
MultiArg<T>(
"", name, desc, req, constraint, v)
230 const std::string& desc,
236 :
MultiArg<T>(
"", name, desc, req, constraint, v)
248 if ( _hasBlanks( args[*i] ) )
255 _extractValue( args[(*i)] );
273 static_cast<void>(val);
274 return std::string(
"<") + _typeDesc +
"> ...";
280 static_cast<void>(val);
281 return std::string(
"<") + _typeDesc +
"> (accepted multiple times)";
287 if ( _name == a.getName() || _description == a.getDescription() )
296 argList.push_back(
const_cast<Arg*
>(
static_cast<const Arg* const
>(
this)) );
The base class that manages the command line definition and passes along the parsing to the appropria...
bool _hasBlanks(const std::string &s) const
Checks whether a given string has blank chars, indicating that it is a combined SwitchArg.
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
virtual std::string toString() const
Returns a simple string representation of the argument.
bool _ignoreable
Whether this argument can be ignored, if desired.
virtual std::string longID(const std::string &val="val") const
Returns the a long id string.
An argument that allows multiple values of type T to be specified.
std::string _name
A single work namd indentifying the argument.
std::string _description
Description of the argument.
static void check(bool req, const std::string &argName)
std::string _typeDesc
The description of type T to be used in the usage.
virtual void addToList(std::list< Arg * > &argList) const
Pushes this to back of list rather than front.
UnlabeledMultiArg(const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, bool ignoreable=false, Visitor *v=NULL)
Constructor.
void _extractValue(const std::string &val)
Extracts the value from the string.
A base class that defines the interface for visitors.
virtual bool operator==(const Arg &a) const
Opertor ==.
The interface that defines the interaction between the Arg and Constraint.
bool _alreadySet
Indicates whether the argument has been set.
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.
virtual std::string shortID(const std::string &val="val") const
Returns the a short id string.
A virtual base class that defines the essential data for all arguments.