#include <CLArgs.hpp>
Collaboration diagram for Ionflux::Tools::CLArgs:
Public Member Functions | |
CLArgs () | |
Constructor. | |
CLArgs (int argc, char *argv[]) | |
Constructor. | |
virtual | ~CLArgs () |
Destructor. | |
virtual void | setArgs (int argc, char *argv[]) |
Set command line arguments. | |
virtual CLOption * | getOption (const std::string &searchOption) |
Get an option. | |
virtual bool | isSet (const std::string &checkOption) |
Check whether an option is set. | |
virtual void | getParams (CLParams &target) |
Get parameters. | |
virtual void | setCheckOptions (bool newCheckOptions) |
Set option checking status. | |
virtual void | addAcceptableOption (const std::string &newOption, bool newAcceptValue) |
Add acceptable option. | |
virtual bool | getCheckOptions () |
Get option checking status. | |
virtual CLAcceptableOption * | getAcceptableOption (const std::string &searchOption) |
Get acceptable option record. | |
virtual bool | isAcceptable (const std::string &checkOption) |
Check for acceptable option. | |
virtual bool | acceptsValue (const std::string &checkOption) |
Check for acceptable option value. | |
virtual std::vector< std::string > & | getInvalidOptions () |
Get invalid options. | |
virtual bool | optionsOK () |
Get option validation status. | |
virtual void | clearAcceptableOptions () |
Clears the list of acceptable command line options. | |
virtual void | clearOptions () |
Clears the list of command line options. | |
virtual void | clearParams () |
Clears the list of command line parameters. | |
virtual void | printDebugInfo () |
Print debug information. | |
virtual Reporter & | getLog () |
Get Console output/logging facility. | |
Static Public Attributes | |
static const TokenType | TT_OPTION |
Token type: Option marker. | |
static const TokenType | TT_ASSIGN |
Token type: Assignment operator. | |
static const CLOption | OPTION_NOT_SET |
Option: Not set. | |
Protected Member Functions | |
virtual bool | addOption (CLOption *newOption) |
Add option. | |
virtual void | parse () |
Parse command line arguments. | |
Protected Attributes | |
Ionflux::Tools::Reporter | log |
Console output/logging. | |
std::vector< std::string > | args |
Command line arguments. | |
std::vector< CLOption * > | options |
Command line options. | |
CLParams | params |
Command line parameters. | |
std::vector< CLAcceptableOption * > | acceptable |
Acceptable command line options. | |
bool | checkOptions |
Check options flag. | |
std::vector< std::string > | invalidOptions |
Invalid options. |
A command line argument parser which recognizes the following types of options and parameters:
-o
Single-character option (switch).
--option
Multi-character option (switch).
-o
<value>
Single-character option with value.
--option
<value>
Multi-character option with value.
-abc
Concatenated single-character options (multiple switches).
-abc
<value>
Concatenated single-character options with value.
option=<value>
Assignment option.
<parameter>
Command line parameter.
|
Constructor. Construct new CLArgs object. |
|
Constructor. Construct new CLArgs object.
|
|
Destructor. Destruct CLArgs object. |
|
Check for acceptable option value. Checks whether an option accepts a value.
|
|
Add acceptable option. Adds an option to the list of options accepted by the command line parser.
|
|
Add option. Adds an option if it is acceptable.
|
|
Clears the list of acceptable command line options.
|
|
Clears the list of command line options.
|
|
Clears the list of command line parameters.
|
|
Get acceptable option record. Get an acceptable option record.
|
|
Get option checking status. Returns the option checking status.
|
|
Get invalid options. Get invalid options that have been encountered by the parser.
|
|
Get Console output/logging facility.
|
|
Get an option. Get an option.
|
|
Get parameters. Get command line parameters (values passed on the command line that do not qualify as options).
|
|
Check for acceptable option. Checks whether an option should be accepted by the parser.
|
|
Check whether an option is set.
Returns
|
|
Get option validation status.
|
|
Parse command line arguments.
|
|
Print debug information.
|
|
Set command line arguments. Sets the command line arguments in the standard format.
|
|
Set option checking status. Sets whether the parser should reject options that are not explicitly set as acceptable.
|
|
Acceptable command line options.
|
|
Command line arguments.
|
|
Check options flag.
|
|
Invalid options.
|
|
Console output/logging.
|
|
Option: Not set.
|
|
Command line options.
|
|
Command line parameters.
|
|
Initial value: { TokenType::USERTYPE_ID + 2, "=", false, 1}
|
|
Initial value: { TokenType::USERTYPE_ID + 1, "-", false, 2}
|