TCLAP::CmdLine Class Reference
#include <CmdLine.h>
List of all members.
Detailed Description
The base class that manages the command line definition and passes along the parsing to the appropriate Arg classes.
Definition at line 70 of file CmdLine.h.
Constructor & Destructor Documentation
TCLAP::CmdLine::CmdLine |
( |
const CmdLine & |
rhs |
) |
[private] |
Prevent accidental copying.
TCLAP::CmdLine::CmdLine |
( |
const std::string & |
message, |
|
|
const char |
delimiter = ' ' , |
|
|
const std::string & |
version = "none" , |
|
|
bool |
helpAndVersion = true | |
|
) |
| | [inline] |
Command line constructor. Defines how the arguments will be parsed.
- Parameters:
-
| message | - The message to be used in the usage output. |
| delimiter | - The character that is used to separate the argument flag/name from the value. Defaults to ' ' (space). |
| version | - The version number to be used in the --version switch. |
| helpAndVersion | - Whether or not to create the Help and Version switches. Defaults to true. |
Definition at line 323 of file CmdLine.h.
TCLAP::CmdLine::~CmdLine |
( |
|
) |
[inline, virtual] |
Member Function Documentation
void TCLAP::CmdLine::_constructor |
( |
|
) |
[inline, private] |
Encapsulates the code common to the constructors (which is all of it).
Definition at line 356 of file CmdLine.h.
bool TCLAP::CmdLine::_emptyCombined |
( |
const std::string & |
s |
) |
[inline, protected] |
Checks whether a name/flag string matches entirely matches the Arg::blankChar. Used when multiple switches are combined into a single argument.
- Parameters:
-
| s | - The message to be used in the usage. |
Definition at line 511 of file CmdLine.h.
void TCLAP::CmdLine::add |
( |
Arg * |
a |
) |
[inline, virtual] |
void TCLAP::CmdLine::add |
( |
Arg & |
a |
) |
[inline, virtual] |
void TCLAP::CmdLine::deleteOnExit |
( |
Visitor * |
ptr |
) |
[inline, protected] |
Perform a delete ptr; operation on ptr when this object is deleted.
Definition at line 555 of file CmdLine.h.
void TCLAP::CmdLine::deleteOnExit |
( |
Arg * |
ptr |
) |
[inline, protected] |
Perform a delete ptr; operation on ptr when this object is deleted.
Definition at line 550 of file CmdLine.h.
std::list< Arg * > & TCLAP::CmdLine::getArgList |
( |
|
) |
[inline, virtual] |
char TCLAP::CmdLine::getDelimiter |
( |
|
) |
[inline, virtual] |
bool TCLAP::CmdLine::getExceptionHandling |
( |
|
) |
const [inline] |
Returns the current state of the internal exception handling.
- Return values:
-
| true | Parsing exceptions are handled internally. |
| false | Parsing exceptions are propagated to the caller. |
Definition at line 613 of file CmdLine.h.
std::string & TCLAP::CmdLine::getMessage |
( |
|
) |
[inline, virtual] |
std::string & TCLAP::CmdLine::getProgramName |
( |
|
) |
[inline, virtual] |
std::string & TCLAP::CmdLine::getVersion |
( |
|
) |
[inline, virtual] |
XorHandler & TCLAP::CmdLine::getXorHandler |
( |
|
) |
[inline, virtual] |
bool TCLAP::CmdLine::hasHelpAndVersion |
( |
|
) |
[inline, virtual] |
void TCLAP::CmdLine::missingArgsException |
( |
|
) |
[inline, protected] |
Throws an exception listing the missing args.
Definition at line 523 of file CmdLine.h.
void TCLAP::CmdLine::parse |
( |
std::vector< std::string > & |
args |
) |
[inline] |
Parses the command line.
- Parameters:
-
| args | - A vector of strings representing the args. args[0] is still the program name. |
Reimplemented from TCLAP::CmdLineInterface.
Definition at line 444 of file CmdLine.h.
void TCLAP::CmdLine::parse |
( |
int |
argc, |
|
|
const char *const * |
argv | |
|
) |
| | [inline, virtual] |
void TCLAP::CmdLine::reset |
( |
|
) |
[inline, virtual] |
void TCLAP::CmdLine::setExceptionHandling |
( |
const bool |
state |
) |
[inline] |
Disables or enables CmdLine's internal parsing exception handling.
- Parameters:
-
| state | Should CmdLine handle parsing exceptions internally? |
Definition at line 608 of file CmdLine.h.
void TCLAP::CmdLine::setOutput |
( |
CmdLineOutput * |
co |
) |
[inline, virtual] |
void TCLAP::CmdLine::xorAdd |
( |
std::vector< Arg * > & |
xors |
) |
[inline, virtual] |
Add a list of Args that will be xor'd. If this method is used, add does not need to be called.
- Parameters:
-
| xors | - List of Args to be added and xor'd. |
Implements TCLAP::CmdLineInterface.
Definition at line 393 of file CmdLine.h.
void TCLAP::CmdLine::xorAdd |
( |
Arg & |
a, |
|
|
Arg & |
b | |
|
) |
| | [inline, virtual] |
Add two Args that will be xor'd. If this method is used, add does not need to be called.
- Parameters:
-
| a | - Argument to be added and xor'd. |
| b | - Argument to be added and xor'd. |
Implements TCLAP::CmdLineInterface.
Definition at line 405 of file CmdLine.h.
Member Data Documentation
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.
The list of arguments that will be tested against the command line.
Definition at line 78 of file CmdLine.h.
The character that is used to separate the argument flag/name from the value. Defaults to ' ' (space).
Definition at line 106 of file CmdLine.h.
Whether or not to automatically create help and version switches.
Definition at line 184 of file CmdLine.h.
A message used to describe the program. Used in the usage output.
Definition at line 88 of file CmdLine.h.
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.
The name of the program. Set to argv[0].
Definition at line 83 of file CmdLine.h.
Is set to true when a user sets the output object. We use this so that we don't delete objects that are created outside of this lib.
Definition at line 179 of file CmdLine.h.
The version to be displayed with the --version switch.
Definition at line 93 of file CmdLine.h.
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.
The handler that manages xoring lists of args.
Definition at line 111 of file CmdLine.h.
The documentation for this class was generated from the following file: