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

Description:

A declaration for an cli::Option.

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

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

Definition at line 286 of file arguments.inl.

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

Public Method Index:

template<typename TEnum>
 OptionDecl (TEnum element)
 
const EnumElement () const
 
const StringHelpText ()
 
const StringHelpUsageLine ()
 
const StringIdentifier ()
 
character IdentifierChar ()
 
int MinimumRecognitionLength ()
 
integer QtyExpectedArgsFollowing ()
 
const StringShortcutReplacementString ()
 
const StringValueSeparator ()
 

Protected Field Index:

Enum declElement
 The enumeration element given with construction.
 
EROptionDecl 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::OptionDecl::declElement
protected

The enumeration element given with construction.

Definition at line 290 of file arguments.inl.

◆ record

EROptionDecl alib::cli::OptionDecl::record
protected

A copy (!) of the enum record.

Definition at line 293 of file arguments.inl.

◆ resourceInfo

ResourceInfo alib::cli::OptionDecl::resourceInfo
protected

The resource information of the enumeration type given with construction.

Definition at line 296 of file arguments.inl.

Constructor(s) / Destructor Details:

◆ OptionDecl()

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

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

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

Definition at line 306 of file arguments.inl.

Here is the call graph for this function:

Method Details:

◆ Element()

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

◆ HelpText()

const String & alib::cli::OptionDecl::HelpText ( )
inline

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

Returns
The help text.

Definition at line 380 of file arguments.inl.

Here is the call graph for this function:

◆ HelpUsageLine()

const String & alib::cli::OptionDecl::HelpUsageLine ( )
inline

Returns a formal description of the usage. Loads the string from resourceInfo using resource name "TOptUsgNN", where NN is the enum element's integral value.

Returns
The help text.

Definition at line 371 of file arguments.inl.

Here is the call graph for this function:

◆ Identifier()

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

Returns the identifier of the option if double hyphen '–' is used.

Returns
The option identifier.

Definition at line 323 of file arguments.inl.

◆ IdentifierChar()

character alib::cli::OptionDecl::IdentifierChar ( )
inline

Returns the identifier of the option if single hyphen '-' is used.

Returns
The option identifier.

Definition at line 337 of file arguments.inl.

◆ MinimumRecognitionLength()

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

Returns the minimum parse length of the identifier if double hyphen '–' is used.

Returns
The minimum characters to satisfy the option.

Definition at line 330 of file arguments.inl.

◆ QtyExpectedArgsFollowing()

integer alib::cli::OptionDecl::QtyExpectedArgsFollowing ( )
inline

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

Returns
The option identifier.

Definition at line 354 of file arguments.inl.

◆ ShortcutReplacementString()

const String & alib::cli::OptionDecl::ShortcutReplacementString ( )
inline

If an option is a shortcut to another one, this string replaces the argument given.

Returns
The option identifier.

Definition at line 361 of file arguments.inl.

◆ ValueSeparator()

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

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

Returns
The separator string.

Definition at line 346 of file arguments.inl.


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