#include <arguments.hpp>
A parameter of a CommandDecl.
Construction is done by passing a custom enum element of an enum type equipped with ALib Enum Records of type ERParameterDecl.
When bootstrapping ALib CLI, method CommandLine::DefineParameters has to be invoked for (each) enum type.
Definition at line 114 of file arguments.hpp.
Public Methods | |
template<typename TEnum > | |
ParameterDecl (TEnum element) | |
const Enum & | Element () const |
const String & | GetHelpTextLong () |
const String & | GetHelpTextShort () |
const String & | Identifier () |
bool | IsOptional () |
int | MinimumRecognitionLength () |
const String & | Name () |
int | QtyExpectedArgsFollowing () |
nchar | ValueListSeparator () |
const String & | ValueSeparator () |
Protected Fields | |
Enum | declElement |
ERParameterDecl | record |
ResourceInfo | resourceInfo |
|
inline |
Templated constructor which takes an enum element of a custom type equipped with ALib Enum Records of type ERParameterDecl.
TEnum | C++ enum type equipped with corresponding ALib Enum Records. |
element | The enum element |
Definition at line 135 of file arguments.hpp.
|
inline |
Returns the type and integral value of the enumeration element used with construction.
Definition at line 151 of file arguments.hpp.
|
inline |
Returns the long help text. Loads the string from resourceInfo using resource name "THelpParLngNN"
, where NN
is the enum element's integral value.
Definition at line 248 of file arguments.hpp.
|
inline |
Returns the short help text. Loads the string from resourceInfo using resource name "THelpParShtNN"
, where NN
is the enum element's integral value.
Definition at line 237 of file arguments.hpp.
|
inline |
Returns the identifier of the parameter. If this is empty, the parameter is not optional and hence has no identifier.
Definition at line 175 of file arguments.hpp.
|
inline |
Returns true
if the parameter is optional. The information about this attribute is used to create help messages and usage format strings only. It does not automatically raise an exception if a parameter is not given. Such exception or other error treatment is up to the user code.
true
if the parameter is optional, false
otherwise. Definition at line 226 of file arguments.hpp.
|
inline |
Returns the minimum parse length of the identifier.
Definition at line 184 of file arguments.hpp.
|
inline |
Returns the name of the parameter. This is not the identifier. The name is just for help and configuration output.
Definition at line 164 of file arguments.hpp.
|
inline |
The number of CLI arguments to consume and store in Option::Args with method Parameter::Read.
Definition at line 214 of file arguments.hpp.
|
inline |
A separator character for parsing multiple values.
Definition at line 203 of file arguments.hpp.
|
inline |
An optional separator string (usually "="), that separates the parameter name from a parameter value.
Definition at line 194 of file arguments.hpp.
|
protected |
The enumeration element given with construction.
Definition at line 118 of file arguments.hpp.
|
protected |
A copy (!) of the enum record.
Definition at line 121 of file arguments.hpp.
|
protected |
The resource information of the enumeration type given with construction.
Definition at line 124 of file arguments.hpp.