27#ifndef TCLAP_UNLABELED_VALUE_ARGUMENT_H
28#define TCLAP_UNLABELED_VALUE_ARGUMENT_H
61 virtual bool hasLabel()
const {
return false; }
86 const std::string& desc,
89 const std::string& typeDesc,
90 bool ignoreable =
false,
116 const std::string& desc,
119 const std::string& typeDesc,
121 bool ignoreable =
false,
144 const std::string& desc,
148 bool ignoreable =
false,
173 const std::string& desc,
178 bool ignoreable =
false,
189 virtual bool processArg(
int* i, std::vector<std::string>& args);
194 virtual std::string
shortID(
const std::string& val=
"val")
const;
199 virtual std::string
longID(
const std::string& val=
"val")
const;
210 virtual void addToList( std::list<Arg*>& argList )
const;
219 const std::string& desc,
222 const std::string& typeDesc,
225:
ValueArg<T>(
"", name, desc, req, val, typeDesc, v)
235 const std::string& desc,
238 const std::string& typeDesc,
242:
ValueArg<T>(
"", name, desc, req, val, typeDesc, v)
254 const std::string& desc,
260:
ValueArg<T>(
"", name, desc, req, val, constraint, v)
268 const std::string& desc,
275:
ValueArg<T>(
"", name, desc, req, val, constraint, v)
292 if ( _hasBlanks( args[*i] ) )
297 _extractValue( args[*i] );
299 this->_checkWithVisitor();
309 static_cast<void>(val);
310 return std::string(
"<") + _typeDesc +
">";
319 static_cast<void>(val);
324 return std::string(
"<") + _typeDesc +
">";
342 argList.push_back(
const_cast<Arg*
>(
static_cast<const Arg* const
>(
this)) );
A virtual base class that defines the essential data for all arguments.
bool _hasBlanks(const std::string &s) const
Checks whether a given string has blank chars, indicating that it is a combined SwitchArg.
bool _alreadySet
Indicates whether the argument has been set.
bool _ignoreable
Whether this argument can be ignored, if desired.
std::string _description
Description of the argument.
const std::string & getName() const
Returns the argument name.
std::string getDescription() const
Returns the argument description.
std::string _name
A single word namd identifying the argument.
virtual std::string toString() const
Returns a simple string representation of the argument.
The base class that manages the command line definition and passes along the parsing to the appropria...
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
The interface that defines the interaction between the Arg and Constraint.
static void check(bool req, const std::string &argName)
The basic unlabeled argument that parses a value.
virtual std::string longID(const std::string &val="val") const
Overrides longID for specific behavior.
virtual std::string shortID(const std::string &val="val") const
Overrides shortID for specific behavior.
virtual void addToList(std::list< Arg * > &argList) const
Instead of pushing to the front of list, push to the back.
virtual bool hasLabel() const
Whether this argument has an option label rather than being an operand.
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.
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.
virtual bool operator==(const Arg &a) const
Overrides operator== for specific behavior.
The basic labeled argument that parses a value.
std::string _typeDesc
A human readable description of the type to be parsed.
void _extractValue(const std::string &val)
Extracts the value from the string.
A base class that defines the interface for visitors.