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

#include <arguments.hpp>

Collaboration diagram for OptionDecl:
[legend]

Class 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 340 of file arguments.hpp.

Public Methods

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 Fields

Enum declElement
 
EROptionDecl record
 
ResourceInfo resourceInfo
 

Constructor & Destructor Documentation

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

Here is the call graph for this function:

Member Function Documentation

◆ 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 374 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 454 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 443 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 383 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 401 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 392 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 422 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 431 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 412 of file arguments.hpp.

Member Data Documentation

◆ declElement

Enum declElement
protected

The enumeration element given with construction.

Definition at line 344 of file arguments.hpp.

◆ record

EROptionDecl record
protected

A copy (!) of the enum record.

Definition at line 347 of file arguments.hpp.

◆ resourceInfo

ResourceInfo resourceInfo
protected

The resource information of the enumeration type given with construction.

Definition at line 350 of file arguments.hpp.


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