ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::cli::ParameterDecl Class Reference

Description:

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 92 of file arguments.inl.

Collaboration diagram for alib::cli::ParameterDecl:
[legend]

Public Method Index:

template<typename TEnum>
 ParameterDecl (TEnum element)
 
const EnumElement () const
 
const StringGetHelpTextLong ()
 
const StringGetHelpTextShort ()
 
const StringIdentifier ()
 
bool IsOptional ()
 
int MinimumRecognitionLength ()
 
const StringName ()
 
int QtyExpectedArgsFollowing ()
 
nchar ValueListSeparator ()
 
const StringValueSeparator ()
 

Protected Field Index:

Enum declElement
 The enumeration element given with construction.
 
ERParameterDecl record
 A copy (!) of the enum record.
 
ResourceInfo resourceInfo
 The resource information of the enumeration type given with construction.
 

Field Details:

◆ declElement

Enum alib::cli::ParameterDecl::declElement
protected

The enumeration element given with construction.

Definition at line 96 of file arguments.inl.

◆ record

ERParameterDecl alib::cli::ParameterDecl::record
protected

A copy (!) of the enum record.

Definition at line 99 of file arguments.inl.

◆ resourceInfo

ResourceInfo alib::cli::ParameterDecl::resourceInfo
protected

The resource information of the enumeration type given with construction.

Definition at line 102 of file arguments.inl.

Constructor(s) / Destructor Details:

◆ ParameterDecl()

template<typename TEnum>
alib::cli::ParameterDecl::ParameterDecl ( TEnum element)
inline

Templated constructor which takes an enum element of a custom type equipped with ALib Enum Records of type ERParameterDecl.

Template Parameters
TEnumC++ enum type equipped with corresponding ALib Enum Records.
Parameters
elementThe enum element

Definition at line 111 of file arguments.inl.

Here is the call graph for this function:

Method Details:

◆ Element()

const Enum & alib::cli::ParameterDecl::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 125 of file arguments.inl.

◆ GetHelpTextLong()

const String & alib::cli::ParameterDecl::GetHelpTextLong ( )
inline

Returns the long help text. Loads the string from resourceInfo using resource name "THelpParLngNN", where NN is the enum element's integral value.

Returns
The help text.

Definition at line 204 of file arguments.inl.

Here is the call graph for this function:

◆ GetHelpTextShort()

const String & alib::cli::ParameterDecl::GetHelpTextShort ( )
inline

Returns the short help text. Loads the string from resourceInfo using resource name "THelpParShtNN", where NN is the enum element's integral value.

Returns
The help text.

Definition at line 195 of file arguments.inl.

Here is the call graph for this function:

◆ Identifier()

const String & alib::cli::ParameterDecl::Identifier ( )
inline

Returns the identifier of the parameter. If this is empty, the parameter is not optional and hence has no identifier.

Returns
The name of the enum element.

Definition at line 145 of file arguments.inl.

◆ IsOptional()

bool alib::cli::ParameterDecl::IsOptional ( )
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.

Returns
true if the parameter is optional, false otherwise.

Definition at line 186 of file arguments.inl.

◆ MinimumRecognitionLength()

int alib::cli::ParameterDecl::MinimumRecognitionLength ( )
inline

Returns the minimum parse length of the identifier.

Returns
The minimum characters to satisfy the parameter.

Definition at line 152 of file arguments.inl.

◆ Name()

const String & alib::cli::ParameterDecl::Name ( )
inline

Returns the name of the parameter. This is not the identifier. The name is just for help and configuration output.

See also
Method Identifier.
Returns
The name of the enum element.

Definition at line 136 of file arguments.inl.

◆ QtyExpectedArgsFollowing()

int alib::cli::ParameterDecl::QtyExpectedArgsFollowing ( )
inline

The number of CLI arguments to consume and store in Option::Args with method Parameter::Read.

Returns
The parameter identifier.

Definition at line 176 of file arguments.inl.

◆ ValueListSeparator()

nchar alib::cli::ParameterDecl::ValueListSeparator ( )
inline

A separator character for parsing multiple values.

Returns
The separator character.

Definition at line 167 of file arguments.inl.

◆ ValueSeparator()

const String & alib::cli::ParameterDecl::ValueSeparator ( )
inline

An optional separator string (usually "="), that separates the parameter name from a parameter value.

Returns
The separator string.

Definition at line 160 of file arguments.inl.


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