ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
No Matches
ExitCodeDecl Class Reference


An exit code of a cli application.

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

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

Announcing the main application's exit codes to the ALib CLI module has two reasons:

  • The exit codes are included in the help output text utility methods provided by class CommandLine .
  • ALib CLI module exit codes can be translated to valid exit codes using method CLIUtil::GetExitCode .

Definition at line 720 of file arguments.hpp.

#include <arguments.hpp>

Collaboration diagram for ExitCodeDecl:

Public Method Index:

template<typename TEnum >
 ExitCodeDecl (TEnum element)
cli::Exceptions AssociatedCLIException ()
const StringFormatString ()
const StringName ()

Field Details:

◆ declElement

Enum declElement

The enumeration element given with construction.

Definition at line 724 of file arguments.hpp.

◆ record

ERExitCodeDecl record

A copy (!) of the enum record.

Definition at line 727 of file arguments.hpp.

◆ resourceInfo

ResourceInfo resourceInfo

The resource information of the enumeration type given with construction.

Definition at line 730 of file arguments.hpp.

Constructor(s) / Destructor Details::

◆ ExitCodeDecl()

template<typename TEnum >
ExitCodeDecl ( TEnum element)

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

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

Definition at line 742 of file arguments.hpp.

Method Details:

◆ AssociatedCLIException()

cli::Exceptions AssociatedCLIException ( )

If an element of enum type Exceptions is associated with this exit code, it is returned. Otherwise cli::ExitCodes(-1).

See also
Method CLIUtil::GetExitCode .
The associated element of cli::Exceptions.

Definition at line 766 of file arguments.hpp.

◆ FormatString()

const String & FormatString ( )

Returns the format string associated with this exit code. Loads the string from resourceInfo using resource name "TExitNN", where NN is the enum element's integral value.

The format string.

Definition at line 777 of file arguments.hpp.

Here is the call graph for this function:

◆ Name()

const String & Name ( )

Returns the name of the enum element

The name of the enum element.

Definition at line 754 of file arguments.hpp.

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