ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
ERException Struct Reference

Description:


An ALib Enum Record type used to equip custom enumeration types with records that define an entries of class Exception .

Besides the exception entry name, the only field this record adds provides a textual description of an exception entry. If TMP struct T_Resourced is likewise specialized for a custom enumeration type, then this field is interpreted as a resource name to load the description from.

When parsing the enum records from string data, inherited field ERSerializable::MinimumRecognitionLength is not parsed from the string, but set to fixed value 0. Therefore, only three fields have to be given per record:

  1. The custom integral enum value (this is mandatory with every resourced enum record).
  2. A string denoting inherited field ERSerializable::EnumElementName .
  3. A string containing the description text, respectively the resource name of that.

Definition at line 62 of file exception.hpp.

#include <exception.hpp>

Inheritance diagram for ERException:
[legend]
Collaboration diagram for ERException:
[legend]

Public Field Index:

String DescriptionOrItsResourceName
 
- Public Field Index: inherited from ERSerializable
String EnumElementName
 
int MinimumRecognitionLength
 

Public Method Index:

 ERException () noexcept=default
 
 ERException (const String &name, const String &description) noexcept
 
ALIB_API void Parse ()
 
- Public Method Index: inherited from ERSerializable
 ERSerializable () noexcept=default
 
 ERSerializable (const String &name, int minLength=0) noexcept
 
ALIB_API void Parse ()
 

Field Details:

◆ DescriptionOrItsResourceName

String DescriptionOrItsResourceName

The description of the exception.

Note
If TMP struct T_Resourced is specialized for an enumeration, this field is interpreted as a resource name to load the description from.

Definition at line 70 of file exception.hpp.

Constructor(s) / Destructor Details::

◆ ERException() [1/2]

ERException ( )
defaultnoexcept

Default constructor leaving the record undefined.

◆ ERException() [2/2]

ERException ( const String & name,
const String & description )
inlinenoexcept

Constructor usually used with static variable declarations (declarations that are not using enumeration types associated with ALib Enum Records of this type).

If used however to define an enum record during bootstrap of a software (by user code that omits the preferred option of parsing resourced strings to create such records), then each parameter of type String passed, has to be of "static nature". This means, that string buffers and their contents are deemed to survive the life-cycle of an application. Usually, C++ string literals are passed in such situation.

Parameters
nameThe name of the exception. (Usually the enum element's C++ name.)
descriptionThe exception's descrption. (Usually a format string.)

Definition at line 89 of file exception.hpp.

Method Details:

◆ Parse()

void Parse ( )

Implementation of EnumRecordPrototype::Parse .

Note
Field ERSerializable::MinimumRecognitionLength is not read from the string, but set to fixed value 0.

Definition at line 51 of file exception.cpp.

Here is the call graph for this function:

The documentation for this struct was generated from the following files: