15 #ifndef TCLAP_VALUE_ARGUMENT_H 16 #define TCLAP_VALUE_ARGUMENT_H 26 #if defined(HAVE_SSTREAM) 28 #elif defined(HAVE_STRSTREAM) 31 #error "Need a stringstream (sstream or strstream) to compile!" 38 namespace ValueArgHelper {
79 #if defined(HAVE_SSTREAM) 80 std::istringstream is(val);
81 #elif defined(HAVE_STRSTREAM) 82 std::istrstream is(val.c_str());
84 #error "Need a stringstream (sstream or strstream) to compile!" 90 if ( is.peek() != EOF )
101 if ( valuesRead > 1 )
187 void _extractValue(
const std::string& val );
215 const std::string& name,
216 const std::string& desc,
219 const std::string& typeDesc,
248 const std::string& name,
249 const std::string& desc,
252 const std::string& typeDesc,
279 const std::string& name,
280 const std::string& desc,
309 const std::string& name,
310 const std::string& desc,
325 virtual bool processArg(
int* i, std::vector<std::string>& args);
336 virtual std::string shortID(
const std::string& val =
"val")
const;
342 virtual std::string longID(
const std::string& val =
"val")
const;
352 const std::string& name,
353 const std::string& desc,
356 const std::string& typeDesc,
358 :
Arg(flag, name, desc, req, true, v),
360 _typeDesc( typeDesc ),
366 const std::string& name,
367 const std::string& desc,
370 const std::string& typeDesc,
373 :
Arg(flag, name, desc, req, true, v),
383 const std::string& name,
384 const std::string& desc,
389 :
Arg(flag, name, desc, req, true, v),
397 const std::string& name,
398 const std::string& desc,
404 :
Arg(flag, name, desc, req, true, v),
431 std::string flag = args[*i];
433 std::string value =
"";
443 "Couldn't find delimiter for this argument!",
449 if ( static_cast<unsigned int>(*i) < args.size() )
472 std::string stop_warnings = val;
482 std::string stop_warnings = val;
499 "More than one valid value parsed from string '" +
505 "' does not meet constraint: " +
virtual bool argMatches(const std::string &s) const
void _extractValue(const std::string &val)
TCLAP command line argument parser classes.
ValueArg(const std::string &flag, const std::string &name, const std::string &desc, bool req, T value, const std::string &typeDesc, Visitor *v=NULL)
virtual bool processArg(int *i, std::vector< std::string > &args)
virtual std::string shortID(const std::string &val="val") const
TCLAP command line argument parser classes.
TClap class indirectly used to define the interface for visitors.
Managing interface for The base class that manages the command line definition and passes along the p...
Virtual parent for all the different argument classes.
virtual std::string longID(const std::string &valueId="val") const
virtual void trimFlag(std::string &flag, std::string &value) const
virtual std::string toString() const
Defines the interaction between an argument and a constraint.
Defines the exception that is thrown when an argument is improperly parsed.
virtual std::string longID(const std::string &val="val") const
virtual void add(Arg &a)=0
bool _hasBlanks(const std::string &s) const
Defines the exception when an argument is improperly specified.
virtual std::string shortID(const std::string &valueId="val") const
void _checkWithVisitor() const
Constraint< T > * _constraint