24 #ifndef TCLAP_CMDLINE_H 25 #define TCLAP_CMDLINE_H 60 typedef typename C::value_type value_type;
61 std::for_each(c.begin(), c.end(), DelPtr<value_type>);
201 const char delimiter =
' ',
202 const std::string& version =
"none",
203 bool helpAndVersion =
true);
235 void xorAdd( std::vector<Arg*>& xors );
242 void parse(
int argc,
const char *
const * argv);
249 void parse(std::vector<std::string>&
args);
325 const std::string&
v,
368 "Displays usage information and exits.",
376 "Displays version information and exits.",
386 "Ignores the rest of the labeled arguments following this flag.",
399 (*it)->forceRequired();
400 (*it)->setRequireLabel(
"OR required" );
407 std::vector<Arg*> ors;
423 "Argument with same flag/name already exists!",
437 std::vector<std::string>
args;
438 for (
int i = 0;
i < argc;
i++)
439 args.push_back(argv[
i]);
446 bool shouldExit =
false;
451 args.erase(args.begin());
453 int requiredCount = 0;
455 for (
int i = 0;
static_cast<unsigned int>(
i) < args.size();
i++)
457 bool matched =
false;
460 if ( (*it)->processArg( &
i, args ) )
516 for (
int i = 1;
static_cast<unsigned int>(
i) < s.length();
i++ )
527 std::string missingArgList;
530 if ( (*it)->isRequired() && !(*it)->isSet() )
532 missingArgList += (*it)->getName();
533 missingArgList +=
", ";
537 missingArgList = missingArgList.substr(0,missingArgList.length()-2);
541 msg =
"Required arguments missing: ";
543 msg =
"Required argument missing: ";
545 msg += missingArgList;
GLenum GLuint GLenum GLsizei const GLchar * message
std::list< Visitor * > _visitorDeleteOnExitList
void xorAdd(Arg &a, Arg &b)
std::list< Arg * > _argList
virtual void failure(CmdLineInterface &c, ArgException &e)=0
virtual void addToList(std::list< Arg *> &argList) const
static char flagStartChar()
std::string & getProgramName()
void deleteOnExit(Arg *ptr)
virtual std::string longID(const std::string &valueId="val") const
GLboolean GLboolean GLboolean GLboolean a
virtual bool isRequired() const
static const std::string ignoreNameString()
std::list< Arg * > _argDeleteOnExitList
void add(std::vector< Arg *> &ors)
bool _emptyCombined(const std::string &s)
bool getExceptionHandling() const
std::list< Arg * >::iterator ArgListIterator
static const textual_icon exit
CmdLineOutput * getOutput()
GLboolean GLboolean GLboolean b
void setExceptionHandling(const bool state)
std::vector< Arg * >::iterator ArgVectorIterator
std::string & getMessage()
void parse(int argc, const char *const *argv)
int getExitStatus() const
std::string & getVersion()
void setOutput(CmdLineOutput *co)
std::list< Arg * > & getArgList()
CmdLine(const CmdLine &rhs)
CmdLine & operator=(const CmdLine &rhs)
void missingArgsException()
XorHandler & getXorHandler()
static const std::string flagStartString()
void ClearContainer(C &c)
static void setDelimiter(char c)