23 #ifndef DtCmdLine_MULTIPLE_UNLABELED_ARGUMENT_H
24 #define DtCmdLine_MULTIPLE_UNLABELED_ARGUMENT_H
35 #ifdef DtUSE_UTILITIES_NAMESPACE
36 namespace DtUSE_UTILITIES_NAMESPACE
80 const std::string& desc,
81 const std::string& typeDesc,
82 bool ignoreable =
false,
101 const std::string& desc,
102 const std::string& typeDesc,
104 bool ignoreable =
false,
121 const std::string& desc,
122 const std::vector<T>& allowed,
123 bool ignoreable =
false,
141 const std::string& desc,
142 const std::vector<T>& allowed,
144 bool ignoreable =
false,
155 virtual bool processArg(
int* i, std::vector<std::string>& args);
161 virtual std::string shortID(
const std::string& val=
"val")
const;
167 virtual std::string longID(
const std::string& val=
"val")
const;
179 virtual void addToList( std::list<Arg*>& argList )
const;
184 const std::string& desc,
185 const std::string& typeDesc,
188 :
MultiArg<T>(
"", name, desc, false, typeDesc, v)
195 const std::string& desc,
196 const std::string& typeDesc,
200 :
MultiArg<T>(
"", name, desc, false, typeDesc, v)
209 const std::string& desc,
210 const std::vector<T>& allowed,
213 :
MultiArg<T>(
"", name, desc, false, allowed, v)
220 const std::string& desc,
221 const std::vector<T>& allowed,
225 :
MultiArg<T>(
"", name, desc, false, allowed, v)
236 if ( _hasBlanks( args[*i] ) )
241 _extractValue( args[*i] );
248 std::string
id =
"<" + _typeDesc +
"> ...";
256 std::string
id =
"<" + _typeDesc +
"> (accepted multiple times)";
273 argList.push_back( (
Arg*)
this );
278 #ifdef DtUSE_UTILITIES_NAMESPACE
A base class that defines the interface for visitors.
Definition: cmdVisitor.h:41
const bool operator==(const DtU128 &lhs, const DtU128 &rhs)
Just like a MultiArg, except that the arguments are unlabeled.
Definition: cmdUnlabeledMultiArg.h:49
bool _ignoreable
Whether this argument can be ignored, if desired.
Definition: cmdArg.h:125
virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.
Definition: cmdUnlabeledMultiArg.h:233
std::string getDescription() const
Returns the argument description.
Definition: cmdArg.h:473
const std::string & getName() const
Returns the argument name.
Definition: cmdArg.h:488
virtual std::string shortID(const std::string &val="val") const
Returns the a short id string.
Definition: cmdUnlabeledMultiArg.h:246
virtual void addToList(std::list< Arg * > &argList) const
Pushes this to back of list rather than front.
Definition: cmdUnlabeledMultiArg.h:271
virtual std::string longID(const std::string &val="val") const
Returns the a long id string.
Definition: cmdUnlabeledMultiArg.h:254
A virtual base class that defines the essential data for all arguments.
Definition: cmdArg.h:48
virtual void add(Arg &a)=0
Adds an argument to the list of arguments to be parsed.
This file declares the class DtCmdLine::MultiArg and several helper classes.
The base class that manages the command line definition and passes along the parsing to the appropria...
Definition: cmdLineInterface.h:52
An argument that allows multiple values of type T to be specified.
Definition: cmdMultiArg.h:59
virtual bool operator==(const Arg &a) const
Opertor ==.
Definition: cmdUnlabeledMultiArg.h:262
UnlabeledMultiArg(const std::string &name, const std::string &desc, const std::string &typeDesc, bool ignoreable=false, Visitor *v=NULL)
Constructor.
Definition: cmdUnlabeledMultiArg.h:183