This value‐semantic class parses, validates, and provides access to command‐line arguments.
Synopsis
Declared in <balcl_commandline.h>
class CommandLine;
Description
The constructor takes the specification describing the command‐line arguments. Once created, printUsage can be invoked to print the usage syntax. The parse method takes command‐line arguments and validates them against the specification provided at creation, writing a suitable message to an optionally‐specified stream in case of a parsing error. Once parsed, options and values can be accessed using various accessors. The class has a set of theType methods (e.g., theString, theInt) that provide access, by name, to the value of the indicated option. It is also possible to link a variable with an option in the specification; doing so will cause the variable to be loaded with the option value once parse has been invoked. The options method returns a balcl::CommandLineOptionsHandle object referring to the option names and their values. A similar but different method, specifiedOptions, is suitable for overwriting other configuration parameters (possibly obtained from a configuration file).
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this command‐line object. |
Assign to this command‐line object the value of the specified |
|
Return the allocator used by this object to supply memory. |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return how many times the option with |
|
Return the command‐line options and their values. |
|
Parse the command‐line arguments in |
|
Return the |
|
Return the |
|
Format this command‐line object to the specified output |
|
|
|
Return the options that were entered (or set via environment). |
|
Return the value of the option having the specified |
|
Return the value of the option having the specified |
|
Return a |
|
Return a |
|
Return a |
|
Return a |
|
Return a |
|
Return the value of the option having the specified |
|
Return a |
|
Return the value of the option having the specified |
|
Return the value of the option having the specified |
|
Return a |
|
Return a |
|
Return a |
|
Return a |
|
Return a |
|
Return a |
|
Return the type of the option having the specified |
|
|
Nested trait declaration for |
Static Member Functions
Name |
Description |
|
Non-Member Functions
Name |
Description |
Return |
|
Return |
Created with MrDocs