Go to the documentation of this file.
16 #ifndef TCLAP_ARGUMENT_H
17 #define TCLAP_ARGUMENT_H
44 static bool&
ignoreRestRef() {
static bool ign =
false;
return ign; }
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;
353 inline Arg::Arg(
const std::string& flag,
354 const std::string& name,
355 const std::string& desc,
363 _requireLabel(
"required"),
364 _valueRequired(valreq),
369 _acceptsMultipleValues(false)
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 =
"";
514 inline void Arg::trimFlag(std::string& flag, std::string& value)
const
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 void setDelimiter(char c)
TCLAP command line argument parser classes.
TCLAP command line argument parser classes.
virtual bool acceptsMultipleValues()
bool _hasBlanks(const std::string &s) const
const std::string & getName() const
std::list< Arg * >::iterator ArgListIterator
void _checkWithVisitor() const
std::list< Visitor * >::iterator VisitorListIterator
virtual std::string shortID(const std::string &valueId="val") const
TCLAP command line argument parser classes.
std::vector< Arg * >::iterator ArgVectorIterator
std::string _requireLabel
static char & delimiterRef()
Arg(const std::string &flag, const std::string &name, const std::string &desc, bool req, bool valreq, Visitor *v=NULL)
std::string getDescription() const
Virtual parent for all the different argument classes.
Defines the exception that is thrown whenever a conflict in arguments occurs.
virtual bool argMatches(const std::string &s) const
virtual bool processArg(int *i, std::vector< std::string > &args)=0
void setRequireLabel(const std::string &s)
static void beginIgnoring()
virtual void addToList(std::list< Arg * > &argList) const
static char flagStartChar()
TClap class indirectly used to define the interface for visitors.
bool isIgnoreable() const
const std::string & getFlag() const
bool isValueRequired() const
static std::string nameStartString()
virtual void trimFlag(std::string &flag, std::string &value) const
virtual std::string toString() const
static std::string flagStartString()
virtual std::string longID(const std::string &valueId="val") const
static std::string ignoreNameString()
virtual bool operator==(const Arg &a) const
virtual bool isRequired() const
static bool & ignoreRestRef()
bool _acceptsMultipleValues
ecl_command_line
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:13