#include <CmdLine.h>
Inheritance diagram for TCLAP::CmdLine:
Public Member Functions | |
CmdLine (const std::string &message, const char delimiter= ' ', const std::string &version="none", bool helpAndVersion=true) | |
Command line constructor. | |
virtual | ~CmdLine () |
Deletes any resources allocated by a CmdLine object. | |
void | add (Arg &a) |
Adds an argument to the list of arguments to be parsed. | |
void | add (Arg *a) |
An alternative add. | |
void | xorAdd (Arg &a, Arg &b) |
Add two Args that will be xor'd. | |
void | xorAdd (std::vector< Arg * > &xors) |
Add a list of Args that will be xor'd. | |
void | parse (int argc, const char *const *argv) |
Parses the command line. | |
void | parse (std::vector< std::string > &args) |
Parses the command line. | |
CmdLineOutput * | getOutput () |
Returns the CmdLineOutput object. | |
void | setOutput (CmdLineOutput *co) |
std::string & | getVersion () |
Returns the version string. | |
std::string & | getProgramName () |
Returns the program name string. | |
std::list< Arg * > & | getArgList () |
Returns the argList. | |
XorHandler & | getXorHandler () |
Returns the XorHandler. | |
char | getDelimiter () |
Returns the delimiter string. | |
std::string & | getMessage () |
Returns the message string. | |
bool | hasHelpAndVersion () |
Indicates whether or not the help and version switches were created automatically. | |
void | setExceptionHandling (const bool state) |
Disables or enables CmdLine's internal parsing exception handling. | |
bool | getExceptionHandling () const |
Returns the current state of the internal exception handling. | |
void | reset () |
Allows the CmdLine object to be reused. | |
Protected Member Functions | |
void | missingArgsException () |
Throws an exception listing the missing args. | |
bool | _emptyCombined (const std::string &s) |
Checks whether a name/flag string matches entirely matches the Arg::blankChar. | |
void | deleteOnExit (Arg *ptr) |
Perform a delete ptr; operation on ptr when this object is deleted. | |
void | deleteOnExit (Visitor *ptr) |
Perform a delete ptr; operation on ptr when this object is deleted. | |
Protected Attributes | |
std::list< Arg * > | _argList |
The list of arguments that will be tested against the command line. | |
std::string | _progName |
The name of the program. | |
std::string | _message |
A message used to describe the program. | |
std::string | _version |
The version to be displayed with the --version switch. | |
int | _numRequired |
The number of arguments that are required to be present on the command line. | |
char | _delimiter |
The character that is used to separate the argument flag/name from the value. | |
XorHandler | _xorHandler |
The handler that manages xoring lists of args. | |
std::list< Arg * > | _argDeleteOnExitList |
A list of Args to be explicitly deleted when the destructor is called. | |
std::list< Visitor * > | _visitorDeleteOnExitList |
A list of Visitors to be explicitly deleted when the destructor is called. | |
CmdLineOutput * | _output |
Object that handles all output for the CmdLine. | |
bool | _handleExceptions |
Should CmdLine handle parsing exceptions internally? |
Definition at line 70 of file CmdLine.h.
|
Command line constructor. Defines how the arguments will be parsed.
|
|
Deletes any resources allocated by a CmdLine object.
Definition at line 333 of file CmdLine.h. References _argDeleteOnExitList, _output, _visitorDeleteOnExitList, and TCLAP::ClearContainer(). |
Here is the call graph for this function:
|
Checks whether a name/flag string matches entirely matches the Arg::blankChar. Used when multiple switches are combined into a single argument.
Definition at line 499 of file CmdLine.h. Referenced by parse(). |
|
An alternative add. Functionally identical.
Implements TCLAP::CmdLineInterface. Definition at line 407 of file CmdLine.h. References _argList, _numRequired, TCLAP::Arg::addToList(), TCLAP::ArgListIterator, TCLAP::Arg::isRequired(), and TCLAP::Arg::longID(). |
Here is the call graph for this function:
|
Adds an argument to the list of arguments to be parsed.
Implements TCLAP::CmdLineInterface. Definition at line 402 of file CmdLine.h. Referenced by xorAdd(). |
|
Perform a delete ptr; operation on ptr when this object is deleted.
Definition at line 543 of file CmdLine.h. References _visitorDeleteOnExitList. |
|
Perform a delete ptr; operation on ptr when this object is deleted.
Definition at line 538 of file CmdLine.h. References _argDeleteOnExitList. |
|
Returns the argList.
Implements TCLAP::CmdLineInterface. |
|
Returns the delimiter string.
Implements TCLAP::CmdLineInterface. |
|
Returns the current state of the internal exception handling.
|
|
Returns the message string.
Implements TCLAP::CmdLineInterface. |
|
Returns the CmdLineOutput object.
Implements TCLAP::CmdLineInterface. |
|
Returns the program name string.
Implements TCLAP::CmdLineInterface. |
|
Returns the version string.
Implements TCLAP::CmdLineInterface. |
|
Returns the XorHandler.
Implements TCLAP::CmdLineInterface. |
|
Indicates whether or not the help and version switches were created automatically.
Implements TCLAP::CmdLineInterface. |
|
Throws an exception listing the missing args.
Definition at line 511 of file CmdLine.h. References _argList, and TCLAP::ArgListIterator. Referenced by parse(). |
|
Parses the command line.
Reimplemented from TCLAP::CmdLineInterface. Definition at line 433 of file CmdLine.h. References _argList, _emptyCombined(), _output, _progName, _xorHandler, TCLAP::ArgListIterator, TCLAP::XorHandler::check(), TCLAP::CmdLineOutput::failure(), and missingArgsException(). |
Here is the call graph for this function:
|
Parses the command line.
Implements TCLAP::CmdLineInterface. |
|
Allows the CmdLine object to be reused.
Implements TCLAP::CmdLineInterface. Definition at line 604 of file CmdLine.h. References _argList, _progName, and TCLAP::ArgListIterator. |
|
Disables or enables CmdLine's internal parsing exception handling.
Definition at line 594 of file CmdLine.h. References _handleExceptions. |
|
Implements TCLAP::CmdLineInterface. Definition at line 553 of file CmdLine.h. References _output. |
|
Add a list of Args that will be xor'd. If this method is used, add does not need to be called.
Implements TCLAP::CmdLineInterface. Definition at line 381 of file CmdLine.h. References _xorHandler, add(), TCLAP::XorHandler::add(), and TCLAP::ArgVectorIterator. |
Here is the call graph for this function:
|
Add two Args that will be xor'd. If this method is used, add does not need to be called.
Implements TCLAP::CmdLineInterface. |
|
A list of Args to be explicitly deleted when the destructor is called. At the moment, this only includes the three default Args. Definition at line 118 of file CmdLine.h. Referenced by deleteOnExit(), and ~CmdLine(). |
|
The list of arguments that will be tested against the command line.
Definition at line 78 of file CmdLine.h. Referenced by add(), missingArgsException(), parse(), and reset(). |
|
The character that is used to separate the argument flag/name from the value. Defaults to ' ' (space). |
|
Should CmdLine handle parsing exceptions internally?
Definition at line 135 of file CmdLine.h. Referenced by setExceptionHandling(). |
|
A message used to describe the program. Used in the usage output. |
|
The number of arguments that are required to be present on the command line. This is set dynamically, based on the Args added to the CmdLine object. Definition at line 100 of file CmdLine.h. Referenced by add(). |
|
Object that handles all output for the CmdLine.
Definition at line 130 of file CmdLine.h. Referenced by parse(), setOutput(), and ~CmdLine(). |
|
The name of the program. Set to argv[0]. |
|
The version to be displayed with the --version switch.
|
|
A list of Visitors to be explicitly deleted when the destructor is called. At the moment, these are the Vistors created for the default Args. Definition at line 125 of file CmdLine.h. Referenced by deleteOnExit(), and ~CmdLine(). |
|
The handler that manages xoring lists of args.
|