LibCppCmd v1.0 Beta 15
C++ Command Line Parsing Library
|
A parameter populated by command line arguments (base class). More...
#include <ArgParam.h>
Public Member Functions | |
virtual | ~ArgParam ()=default |
Destructs an ArgParam. | |
virtual bool | Populate (std::deque< std::string > &args)=0 |
Populates the ArgParam from an argument queue. | |
virtual bool | CanPopulate (const std::deque< std::string > &args) const =0 |
Determines if the specified args can populate the ArgParam. | |
virtual std::size_t | Consumes (const std::deque< std::string > &args) const =0 |
Gets the number of arguments the ArgParam consumes. | |
Public Member Functions inherited from CmdLine::Param | |
virtual | ~Param ()=default |
Destructs a Param. | |
virtual std::string | Name () const =0 |
Gets the name of the Param. | |
virtual std::string | Description () const =0 |
Getst the description of the Param. | |
virtual std::string | HelpInfo () const =0 |
Gets help info 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 populated by command line arguments (base class).
An ArgParam is a variable that the CmdLine::Parser will populate with data from one or more command line arguments. It provides methods for populating the parameter, as well as determining how many arguments population consumes and whether the next arguments in an argument queue (deque) can populate the parameter.
|
pure virtual |
Determines if the specified args can populate the ArgParam.
Accepts a reference to an argument queue (deque) and determines if the next n arguments in the queue can populate the ArgParam.
args | The argument queue to evaluate. |
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::PosParam, CmdLine::ProgParam, and CmdLine::ValueOption.
|
pure virtual |
Gets the number of arguments the ArgParam consumes.
Each ArgParam consumes a certain number of arguments from an argument queue upon successful population. This number is implementation defined.
args | The argument queue to evaluate. |
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::PosParam, CmdLine::ProgParam, and CmdLine::ValueOption.
|
pure virtual |
Populates the ArgParam from an argument queue.
Accepts a reference to an argument queue (deque) and attempts to populate the ArgParam with data from the next n arguments in the queue, where n is the number of arguments the ArgParam consumes. Populating the ArgParam, at a minimum, marks it as specified and may also populate it with values (depending on the implementation). Successful population also consumes the arguments from the queue that populated the ArgParam.
args | The argument queue to populate from. |
Implemented in CmdLine::MultiPosParam, CmdLine::Option, CmdLine::PosParam, CmdLine::ProgParam, and CmdLine::ValueOption.