16 #ifndef TCLAP_ARGUMENT_H 17 #define TCLAP_ARGUMENT_H 50 static char&
delimiterRef() {
static char delim =
' ';
return delim; }
142 Arg(
const std::string& flag,
143 const std::string& name,
144 const std::string& desc,
159 virtual void addToList( std::list<Arg*>& argList )
const;
219 virtual bool processArg(
int *i, std::vector<std::string>& args) = 0;
231 const std::string&
getFlag()
const;
236 const std::string&
getName()
const;
284 virtual bool argMatches(
const std::string& s )
const;
290 virtual std::string
toString()
const;
296 virtual std::string
shortID(
const std::string& valueId =
"val" )
const;
302 virtual std::string
longID(
const std::string& valueId =
"val" )
const;
311 virtual void trimFlag( std::string& flag, std::string& value )
const;
319 bool _hasBlanks(
const std::string& s )
const;
354 const std::string& name,
355 const std::string& desc,
371 if (
_flag.length() > 1 )
373 "Argument flag can only be one character long",
toString() ) );
386 (
_name.find(
" ", 0 ) != std::string::npos ) )
405 std::string delim =
" ";
409 id += delim +
"<" + valueId +
">";
417 inline std::string
Arg::longID(
const std::string& valueId )
const 426 id +=
" <" + valueId +
">";
434 id +=
" <" + valueId +
">";
450 std::string desc =
"";
517 for (
int i = 0;
static_cast<unsigned int>(i) < flag.length(); i++ )
526 value = flag.substr(stop+1);
527 flag = flag.substr(0,stop);
537 for (
int i = 1;
static_cast<unsigned int>(i) < s.length(); i++ )
560 argList.push_front( const_cast<Arg*>(
this) );
static char flagStartChar()
std::list< Visitor * >::iterator VisitorListIterator
virtual std::string shortID(const std::string &valueId="val") const
virtual bool isRequired() const
static void beginIgnoring()
TClap class indirectly used to define the interface for visitors.
Virtual parent for all the different argument classes.
std::list< Arg * >::iterator ArgListIterator
static std::string nameStartString()
static std::string ignoreNameString()
const std::string & getName() const
static std::string flagStartString()
static bool & ignoreRestRef()
bool _acceptsMultipleValues
virtual std::string toString() const
std::vector< Arg * >::iterator ArgVectorIterator
TCLAP command line argument parser classes.
const std::string & getFlag() const
void _checkWithVisitor() const
virtual std::string longID(const std::string &valueId="val") const
static void setDelimiter(char c)
virtual bool argMatches(const std::string &s) const
std::string getDescription() const
TCLAP command line argument parser classes.
virtual bool acceptsMultipleValues()
bool isIgnoreable() const
virtual bool operator==(const Arg &a) const
bool isValueRequired() const
virtual void addToList(std::list< Arg * > &argList) const
std::string _requireLabel
bool _hasBlanks(const std::string &s) const
static char & delimiterRef()
Arg(const std::string &flag, const std::string &name, const std::string &desc, bool req, bool valreq, Visitor *v=NULL)
TCLAP command line argument parser classes.
Defines the exception that is thrown whenever a conflict in arguments occurs.
virtual void trimFlag(std::string &flag, std::string &value) const
virtual bool processArg(int *i, std::vector< std::string > &args)=0
void setRequireLabel(const std::string &s)