ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Fields | Public Methods | Protected Fields | Protected Methods | List of all members
CommandDecl Class Reference

#include <arguments.hpp>

Collaboration diagram for CommandDecl:
[legend]

Class Description

A declaration for a cli::Command.

Construction is done by passing a custom enum element of an enum type equipped with ALib Enum Records of type ERCommandDecl.

When bootstrapping ALib CLI, method CommandLine::DefineCommands has to be invoked for (each) enum type.

Definition at line 537 of file arguments.hpp.

Public Fields

CommandLineCmdLine
 
List< ParameterDecl * > Parameters
 

Public Methods

template<typename TEnum >
 CommandDecl (TEnum element, CommandLine &cmdLine)
 
const EnumElement () const
 
ALIB_API ParameterDeclGetParameterDecl (const String &name)
 
const StringHelpTextLong ()
 
const StringHelpTextShort ()
 
const StringIdentifier ()
 
int MinimumRecognitionLength ()
 

Protected Fields

Enum declElement
 
ERCommandDecl record
 
ResourceInfo resourceInfo
 

Protected Methods

ALIB_API void addParamDecls ()
 

Constructor & Destructor Documentation

◆ CommandDecl()

CommandDecl ( TEnum  element,
CommandLine cmdLine 
)
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.

Template Parameters
TEnumC++ enum type equipped with corresponding ALib Enum Records.
Parameters
elementThe enum element
cmdLineThe command line object. Will be stored.

Definition at line 611 of file commandline.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ addParamDecls()

void addParamDecls ( )
protected

Called from the constructor. Parses field ERCommandDecl::parameters of the enum record, and loads the corresponding parameters.

Definition at line 38 of file arguments.cpp.

Here is the call graph for this function:

◆ Element()

const Enum& Element ( ) const
inline

Returns the type and integral value of the enumeration element used with construction.

Returns
The enumeration element used with construction.

Definition at line 574 of file arguments.hpp.

◆ GetParameterDecl()

ParameterDecl * GetParameterDecl ( const String name)

Searches in Parameters for the declaration of parameter name.

Parameters
nameThe declaration name of the parameter.
Returns
A pointer to the parameter's declaration, nullptr if parameter was not declared.

Definition at line 59 of file arguments.cpp.

◆ HelpTextLong()

const String& HelpTextLong ( )
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.

Returns
The help text.

Definition at line 614 of file arguments.hpp.

Here is the call graph for this function:

◆ HelpTextShort()

const String& HelpTextShort ( )
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.

Returns
The help text.

Definition at line 603 of file arguments.hpp.

Here is the call graph for this function:

◆ Identifier()

const String& Identifier ( )
inline

Returns the identifier (name) of the command

Returns
The command identifier.

Definition at line 583 of file arguments.hpp.

◆ MinimumRecognitionLength()

int MinimumRecognitionLength ( )
inline

Returns the minimum parse length of the identifier.

Returns
The minimum characters to satisfy the command to be parsed.

Definition at line 592 of file arguments.hpp.

Member Data Documentation

◆ CmdLine

CommandLine& CmdLine

The command line instance we belong to.

Definition at line 551 of file arguments.hpp.

◆ declElement

Enum declElement
protected

The enumeration element given with construction.

Definition at line 541 of file arguments.hpp.

◆ Parameters

List<ParameterDecl*> Parameters

Command parameters.

Definition at line 554 of file arguments.hpp.

◆ record

ERCommandDecl record
protected

A copy (!) of the enum record.

Definition at line 544 of file arguments.hpp.

◆ resourceInfo

ResourceInfo resourceInfo
protected

The resource information of the enumeration type given with construction.

Definition at line 547 of file arguments.hpp.


The documentation for this class was generated from the following files: