Go to the documentation of this file.
24 #ifndef TCLAP_UNLABELED_VALUE_ARGUMENT_H
25 #define TCLAP_UNLABELED_VALUE_ARGUMENT_H
43 class UnlabeledValueArg :
public ValueArg<T>
81 const std::string& desc,
84 const std::string& typeDesc,
85 bool ignoreable =
false,
111 const std::string& desc,
114 const std::string& typeDesc,
115 CmdLineInterface& parser,
116 bool ignoreable =
false,
139 const std::string& desc,
142 Constraint<T>* constraint,
143 bool ignoreable =
false,
168 const std::string& desc,
171 Constraint<T>* constraint,
172 CmdLineInterface& parser,
173 bool ignoreable =
false,
184 virtual bool processArg(
int* i, std::vector<std::string>& args);
189 virtual std::string
shortID(
const std::string& val=
"val")
const;
194 virtual std::string
longID(
const std::string& val=
"val")
const;
205 virtual void addToList( std::list<Arg*>& argList )
const;
214 const std::string& desc,
217 const std::string& typeDesc,
220 : ValueArg<T>(
"", name, desc, req, val, typeDesc, v)
230 const std::string& desc,
233 const std::string& typeDesc,
237 :
ValueArg<T>(
"", name, desc, req, val, typeDesc, v)
249 const std::string& desc,
255 :
ValueArg<T>(
"", name, desc, req, val, constraint, v)
263 const std::string& desc,
270 :
ValueArg<T>(
"", name, desc, req, val, constraint, v)
287 if ( _hasBlanks( args[*i] ) )
292 _extractValue( args[*i] );
303 static_cast<void>(val);
304 return std::string(
"<") + _typeDesc +
">";
313 static_cast<void>(val);
318 return std::string(
"<") + _typeDesc +
">";
336 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.
const std::string & getName() const
Returns the argument name.
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.
virtual std::string toString() const
Returns a simple string representation of the argument.
bool _ignoreable
Whether this argument can be ignored, if desired.
std::string getDescription() const
Returns the argument description.
std::string _name
A single word namd identifying the argument.
std::string _description
Description of the argument.
virtual std::string shortID(const std::string &val="val") const
Overrides shortID for specific behavior.
static void check(bool req, const std::string &argName)
virtual std::string longID(const std::string &val="val") const
Overrides longID for specific behavior.
virtual bool operator==(const Arg &a) const
Overrides operator== for specific behavior.
virtual void addToList(std::list< Arg * > &argList) const
Instead of pushing to the front of list, push to the back.
The basic labeled argument that parses a value.
A base class that defines the interface for visitors.
std::string _typeDesc
A human readable description of the type to be parsed.
The interface that defines the interaction between the Arg and Constraint.
bool _alreadySet
Indicates whether the argument has been set.
UnlabeledValueArg(const std::string &name, const std::string &desc, bool req, T value, const std::string &typeDesc, bool ignoreable=false, Visitor *v=NULL)
UnlabeledValueArg constructor.
A virtual base class that defines the essential data for all arguments.
void _extractValue(const std::string &val)
Extracts the value from the string.