ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 339 of file arguments.hpp.

#include <arguments.hpp>

Collaboration diagram for 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 ()
 

Field Details:

◆ declElement

Enum declElement
protected

The enumeration element given with construction.

Definition at line 343 of file arguments.hpp.

◆ record

EROptionDecl record
protected

A copy (!) of the enum record.

Definition at line 346 of file arguments.hpp.

◆ resourceInfo

ResourceInfo resourceInfo
protected

The resource information of the enumeration type given with construction.

Definition at line 349 of file arguments.hpp.

Constructor(s) / Destructor Details::

◆ OptionDecl()

template<typename TEnum >
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 361 of file arguments.hpp.

Method Details:

◆ 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 373 of file arguments.hpp.

◆ HelpText()

const String & 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 453 of file arguments.hpp.

Here is the call graph for this function:

◆ HelpUsageLine()

const String & 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 442 of file arguments.hpp.

Here is the call graph for this function:

◆ Identifier()

const String & Identifier ( )
inline

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

Returns
The option identifier.

Definition at line 382 of file arguments.hpp.

◆ IdentifierChar()

character IdentifierChar ( )
inline

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

Returns
The option identifier.

Definition at line 400 of file arguments.hpp.

Here is the call graph for this function:

◆ MinimumRecognitionLength()

int 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 391 of file arguments.hpp.

◆ QtyExpectedArgsFollowing()

integer 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 421 of file arguments.hpp.

◆ ShortcutReplacementString()

const String & ShortcutReplacementString ( )
inline

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

Returns
The option identifier.

Definition at line 430 of file arguments.hpp.

◆ ValueSeparator()

const String & ValueSeparator ( )
inline

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

Returns
The separator string.

Definition at line 411 of file arguments.hpp.


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