A declaration for a Command.
Construction is done by passing a custom enum element of an enum type equipped with ALib Enum Records of type ERCommandDecl.
When bootstrapping, method void DefineCommands() has to be invoked for (each) enum type.
Definition at line 425 of file cliargtypes.hpp.
#include <cliargtypes.hpp>
Public Field Index: | |
| CommandLine & | CmdLine |
| The command-line instance we belong to. | |
| ListMA< ParameterDecl * > | Parameters |
| Command parameters. | |
Public Method Index: | |
| template<typename TEnum> | |
| CommandDecl (TEnum element, CommandLine &cmdLine) | |
| const Enum & | Element () const |
| ParameterDecl * | GetParameterDecl (const String &name) |
| const String & | HelpTextLong () |
| const String & | HelpTextShort () |
| const String & | Identifier () |
| int | MinimumRecognitionLength () |
Protected Field Index: | |
| Enum | declElement |
| The enumeration element given with construction. | |
| ERCommandDecl | record |
| A copy (!) of the enum record. | |
| ResourceInfo | resourceInfo |
| The resource information of the enumeration type given with construction. | |
Protected Method Index: | |
| void | addParamDecls () |
| CommandLine& alib::app::CommandDecl::CmdLine |
The command-line instance we belong to.
Definition at line 438 of file cliargtypes.hpp.
|
protected |
The enumeration element given with construction.
Definition at line 428 of file cliargtypes.hpp.
| ListMA<ParameterDecl*> alib::app::CommandDecl::Parameters |
Command parameters.
Definition at line 441 of file cliargtypes.hpp.
|
protected |
A copy (!) of the enum record.
Definition at line 431 of file cliargtypes.hpp.
|
protected |
The resource information of the enumeration type given with construction.
Definition at line 434 of file cliargtypes.hpp.
|
inline |
Templated constructor which takes an enum element of a custom type equipped with ALib Enum Records of type ERCommandDecl.
Field Parameters is filled as specified in the enum record.
| TEnum | C++ enum type equipped with corresponding ALib Enum Records. |
| element | The enum element |
| cmdLine | The command-line object. Will be stored. |
Definition at line 508 of file cli.hpp.
|
protected |
Called from the constructor. Parses field String parameters of the enum record, and loads the corresponding parameters.
Definition at line 8 of file cliargtypes.cpp.
|
inline |
Returns the type and integral value of the enumeration element used with construction.
Definition at line 457 of file cliargtypes.hpp.
| ParameterDecl * alib::app::CommandDecl::GetParameterDecl | ( | const String & | name | ) |
Searches in Parameters for the declaration of parameter name.
| name | The declaration name of the parameter. |
nullptr if parameter was not declared. Definition at line 25 of file cliargtypes.cpp.
|
inline |
Returns the long version of the help text. Loads the string from resourceInfo using resource name "THlpCmdLngNN", where NN is the enum element's integral value.
Definition at line 478 of file cliargtypes.hpp.
|
inline |
Returns the short version of the help text. Loads the string from resourceInfo using resource name "THlpCmdShtNN", where NN is the enum element's integral value.
Definition at line 471 of file cliargtypes.hpp.
|
inline |
Returns the identifier (name) of the command
Definition at line 461 of file cliargtypes.hpp.
|
inline |
Returns the minimum parse length of the identifier.
Definition at line 465 of file cliargtypes.hpp.