|
LibCppCmdLine v1.0
A cross-platform C++ library for parsing command line arguments
|
A parameter that stores data from the command line (base class). More...
#include <Param.h>
Classes | |
| struct | Definition |
| Defines a command line Param. More... | |
| class | InvalidDefinition |
| An exception thrown for invalid Param definitions. More... | |
Public Member Functions | |
| virtual | ~Param ()=default |
| Destructs a Param. | |
| virtual std::string | Name () const =0 |
| Gets the name of the Param. | |
| virtual std::string | Description () const =0 |
| Gets the description of the Param. | |
| virtual std::string | HelpInfo () const =0 |
| Gets help information for the Param. | |
| virtual bool | IsSpecified () const =0 |
| Indicates whether the Param has been specified. | |
| virtual bool | IsMandatory () const =0 |
| Indicates whether the Param is mandatory. | |
A parameter that stores data from the command line (base class).
A command line Param is a variable that stores data specified at the command line. How this is achieved is defined by the implemntation of each class that inherits from this one. This base class declares the the minimum attributes all types of Param are expected to have: a Name(), Description(), HelpInfo() to print on help and usage screens, whether the Param IsSpecified() at the command line, and whether the Param IsMandatory().
|
pure virtual |
Gets the description of the Param.
The description of the Param is used for generating help.
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::OptionParam, CmdLine::PosParam, and CmdLine::ProgParam.
|
pure virtual |
Gets help information for the Param.
The help info will include the Name() and Description() of the parameter when generating help.
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::OptionParam, CmdLine::PosParam, CmdLine::ProgParam, and CmdLine::ValueOption.
|
pure virtual |
Indicates whether the Param is mandatory.
The command line Parser uses this to determine if a parameter must be specified at the command line for parsing to be successful. If a mandatory parameter is not specified, parsing will fail indicating the program was supplied with bad command line arguments.
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::OptionParam, CmdLine::PosParam, and CmdLine::ProgParam.
|
pure virtual |
Indicates whether the Param has been specified.
A Param will only indicate it was specified if it has been successfully populated by data from a command line argument. The command line Parser also uses this to determine if a mandatory parameter has been specified.
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::OptionParam, CmdLine::PosParam, and CmdLine::ProgParam.
|
pure virtual |
Gets the name of the Param.
The name of the Param is used for generating usage and help.
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::OptionParam, CmdLine::PosParam, and CmdLine::ProgParam.