25 #ifndef TCLAP_ARGUMENT_H 26 #define TCLAP_ARGUMENT_H 41 #if defined(HAVE_SSTREAM) 44 #elif defined(HAVE_STRSTREAM) 48 #error "Need a stringstream (sstream or strstream) to compile!" 86 static char&
delimiterRef() {
static char delim =
' ';
return delim; }
178 Arg(
const std::string& flag,
179 const std::string&
name,
180 const std::string& desc,
195 virtual void addToList( std::list<Arg*>& argList )
const;
223 #ifndef TCLAP_FLAGSTARTCHAR 224 #define TCLAP_FLAGSTARTCHAR '-' 233 #ifndef TCLAP_FLAGSTARTSTRING 234 #define TCLAP_FLAGSTARTSTRING "-" 242 #ifndef TCLAP_NAMESTARTSTRING 243 #define TCLAP_NAMESTARTSTRING "--" 277 const std::string&
getFlag()
const;
282 const std::string&
getName()
const;
330 virtual bool argMatches(
const std::string&
s )
const;
336 virtual std::string
toString()
const;
342 virtual std::string
shortID(
const std::string& valueId =
"val" )
const;
348 virtual std::string
longID(
const std::string& valueId =
"val" )
const;
357 virtual void trimFlag( std::string& flag, std::string&
value )
const;
365 bool _hasBlanks(
const std::string& s )
const;
390 virtual void reset();
414 template<
typename T>
void 417 static_cast<void>(vl);
421 while ( is.good() ) {
422 if ( is.peek() != EOF )
423 #ifdef TCLAP_SETBASE_ZERO
424 is >> std::setbase(0) >> destVal;
436 "from string '" + strVal +
"'"));
439 if ( valuesRead > 1 )
441 "string '" + strVal +
"'"));
451 template<
typename T>
void 454 static_cast<void>(sl);
463 const std::string&
name,
464 const std::string& desc,
480 if (
_flag.length() > 1 )
482 "Argument flag can only be one character long",
toString() ) );
495 (
_name.find(
" ", 0 ) != std::string::npos ) )
523 inline std::string
Arg::longID(
const std::string& valueId )
const 556 std::string desc =
"";
623 for (
int i = 0;
static_cast<unsigned int>(
i) < flag.length();
i++ )
632 value = flag.substr(stop+1);
633 flag = flag.substr(0,stop);
643 for (
int i = 1;
static_cast<unsigned int>(
i) < s.length();
i++ )
666 argList.push_front( const_cast<Arg*>(
this) );
virtual bool argMatches(const std::string &s) const
std::istringstream istringstream
GLuint const GLchar * name
void SetString(T &dst, const std::string &src)
virtual void addToList(std::list< Arg *> &argList) const
void setRequireLabel(const std::string &s)
static char flagStartChar()
static char & delimiterRef()
static const textual_icon stop
virtual std::string longID(const std::string &valueId="val") const
std::list< Visitor * >::iterator VisitorListIterator
GLboolean GLboolean GLboolean GLboolean a
#define TCLAP_FLAGSTARTCHAR
virtual bool isRequired() const
Arg & operator=(const Arg &rhs)
void _checkWithVisitor() const
static const std::string ignoreNameString()
static const std::string nameStartString()
#define TCLAP_NAMESTARTSTRING
const std::string & getName() const
std::list< Arg * >::iterator ArgListIterator
virtual std::string shortID(const std::string &valueId="val") const
virtual std::string toString() const
bool isValueRequired() const
virtual bool acceptsMultipleValues()
std::vector< Arg * >::iterator ArgVectorIterator
virtual bool processArg(int *i, std::vector< std::string > &args)=0
static void beginIgnoring()
virtual bool operator==(const Arg &a) const
bool isIgnoreable() const
std::string getDescription() const
const std::string & getFlag() const
void ExtractValue(T &destVal, const std::string &strVal, ValueLike vl)
bool _acceptsMultipleValues
static bool & ignoreRestRef()
bool _hasBlanks(const std::string &s) const
#define TCLAP_FLAGSTARTSTRING
std::string _requireLabel
static const std::string flagStartString()
virtual void trimFlag(std::string &flag, std::string &value) const
static void setDelimiter(char c)