ALib C++ Library
Library Version: 2412 R0
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 294 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 ()
 

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 declElement
protected

The enumeration element given with construction.

Definition at line 298 of file arguments.hpp.

◆ record

EROptionDecl record
protected

A copy (!) of the enum record.

Definition at line 301 of file arguments.hpp.

◆ resourceInfo

ResourceInfo resourceInfo
protected

The resource information of the enumeration type given with construction.

Definition at line 304 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 314 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 324 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 388 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 379 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 331 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 345 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 338 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 362 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 369 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 354 of file arguments.hpp.


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