19 #ifndef _BASIS_VALUEARG_H 20 #define _BASIS_VALUEARG_H 23 #include "tclap/ValueArg.h" 74 const std::string& name,
75 const std::string& desc,
78 const std::string& typeDesc,
79 bool allowOverwrite =
false,
80 TCLAP::Visitor* v = NULL);
104 const std::string& name,
105 const std::string& desc,
108 const std::string& typeDesc,
109 TCLAP::CmdLineInterface& parser,
110 bool allowOverwrite =
false,
111 TCLAP::Visitor* v = NULL);
133 const std::string& name,
134 const std::string& desc,
137 TCLAP::Constraint<T>* constraint,
138 TCLAP::CmdLineInterface& parser,
139 bool allowOverwrite =
false,
140 TCLAP::Visitor* v = NULL);
161 const std::string& name,
162 const std::string& desc,
165 TCLAP::Constraint<T>* constraint,
166 bool allowOverwrite =
false,
167 TCLAP::Visitor* v = NULL);
182 virtual bool processArg(
int* i, std::vector<std::string>& args);
207 const std::string& name,
208 const std::string& desc,
211 const std::string& typeDesc,
215 TCLAP::
ValueArg<T>(flag, name, desc, req, val, typeDesc, v),
223 const std::string& name,
224 const std::string& desc,
227 const std::string& typeDesc,
228 TCLAP::CmdLineInterface& parser,
232 TCLAP::
ValueArg<T>(flag, name, desc, req, val, typeDesc, parser, v),
240 const std::string& name,
241 const std::string& desc,
244 TCLAP::Constraint<T>* constraint,
248 TCLAP::
ValueArg<T>(flag, name, desc, req, val, constraint, v),
256 const std::string& name,
257 const std::string& desc,
260 TCLAP::Constraint<T>* constraint,
261 TCLAP::CmdLineInterface& parser,
265 TCLAP::
ValueArg<T>(flag, name, desc, req, val, constraint, parser, v),
274 if (TCLAP::ValueArg<T>::_ignoreable && TCLAP::ValueArg<T>::ignoreRest())
return false;
275 if (TCLAP::ValueArg<T>::_hasBlanks(args[*i]))
return false;
277 std::string flag = args[*i];
279 std::string value =
"";
280 TCLAP::ValueArg<T>::trimFlag(flag, value);
282 if (TCLAP::ValueArg<T>::argMatches(flag)) {
284 if (TCLAP::ValueArg<T>::_xorSet) {
286 TCLAP::ValueArg<T>::toString());
289 TCLAP::ValueArg<T>::toString());
293 if (TCLAP::Arg::delimiter() !=
' ' && value ==
"") {
295 TCLAP::ValueArg<T>::toString());
300 if (static_cast<unsigned int>(*i) < args.size()) {
301 TCLAP::ValueArg<T>::_extractValue(args[*i]);
304 TCLAP::ValueArg<T>::toString());
307 TCLAP::ValueArg<T>::_extractValue(value);
310 TCLAP::ValueArg<T>::_alreadySet =
true;
311 TCLAP::ValueArg<T>::_checkWithVisitor();
322 #endif // _BASIS_VALUEARG_H virtual bool processArg(int *i, std::vector< std::string > &args)
Handles the processing of the argument.
TCLAP::ArgParseException ArgParseException
Exception thrown on command-line argument parsing error.
ValueArg(const std::string &flag, const std::string &name, const std::string &desc, bool req, T value, const std::string &typeDesc, bool allowOverwrite=false, TCLAP::Visitor *v=NULL)
Constructor.
TCLAP::CmdLineParseException CmdLineParseException
Exception thrown on command-line parsing error.
An argument that allows multiple values of type T to be specified.