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:
Definition at line 50 of file exception.hpp.
#include <exception.hpp>
Public Field Index: | |
String | DescriptionOrItsResourceName |
Public Field Index: inherited from ERSerializable | |
String | EnumElementName |
The name of the enum element. | |
int | MinimumRecognitionLength |
Public Method Index: | |
ERException () noexcept=default | |
Default constructor leaving the record undefined. | |
ERException (const String &name, const String &description) noexcept | |
ALIB_API void | Parse () |
Public Method Index: inherited from ERSerializable | |
ERSerializable () noexcept=default | |
Defaulted constructor leaving the record undefined. | |
ERSerializable (const String &name, int minLength=0) noexcept | |
ALIB_API void | Parse () |
String DescriptionOrItsResourceName |
The description of the exception.
Definition at line 56 of file exception.hpp.
|
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.
name | The name of the exception. (Usually the enum element's C++ name.) |
description | The exception's descrption. (Usually a format string.) |
Definition at line 73 of file exception.hpp.
void Parse | ( | ) |
Implementation of EnumRecordPrototype::Parse.
0
. Definition at line 28 of file exception.cpp.