8 ERSerializable::MinimumRecognitionLength= 0;
15 while(*tail !=
nullptr)
19 (*tail)->next=
nullptr;
21 return &(*tail)->message;
35 if( tryRecord ==
nullptr ) {
36 std::vector<std::pair<integer,const void*>> recordList;
38 if( record.first.RTTI == message->
Type.
TypeID() )
39 recordList.push_back( std::pair<integer,const void*>(record.first.Element, record.second) );
40 if( recordList.size() == 0) {
41 ALIB_ERROR(
"EXCEPT",
"No enum records defined for exception enumeration "
42 "type {!Q<>}.", message->
Type.
TypeID().name() )
44 std::sort( recordList.begin(), recordList.end(),
45 [] ( std::pair<integer,const void*>& a, std::pair<integer,const void*>& b )
46 { return a.first < b.first;});
47 std::vector<std::any> args; args.reserve(32);
48 args.emplace_back(
"Enum record {} not found for exception enumeration type {}.\n"
49 "The following records have been found:\n" );
53 for(
auto& pair : recordList ) {
54 args.emplace_back(
" {}: {}\n" );
55 args.emplace_back( pair.first );
63 message->emplace( message->begin(),
64 enumRecord.DescriptionOrItsResourceName );
66 message->emplace( message->begin(),
68 enumRecord.DescriptionOrItsResourceName
75 while( result->next !=
nullptr )
78 return result->message;
84 while( entry->next !=
nullptr ) {
94 Enum* result= &entry->message.Type;
95 while( (entry= entry->next) !=
nullptr )
96 if( entry->message.Type.Integral() >= 0 )
97 result= &entry->message.Type;
112 formatter.GetArgContainer();
114 for (
auto entryIt=
begin(); entryIt !=
end(); ++entryIt ) {
115 text.
Add(
A_CHAR(
"{}{}: {!Q<>}"), (entryIt->Type.Integral() >= 0 ?
'E' :
'I'), entryNo, entryIt->Type );
119 formatter.FormatArgs( buf.
Reset(), *entryIt );
124 buf <<
BASECAMP.GetResource(
"ExcFmtExc");
126 buf <<
A_CHAR(
"\nAn exception occurred while formatting another (!) exception:\n" );
130 tknzr.
Set( buf,
'\n' );
135 text.
Add( entryIt->CI );
#define ALIB_ERROR(domain,...)
#define ALIB_LOCK_RECURSIVE_WITH(lock)
#define ALIB_CALLER_PRUNED
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
AString & Format(AString &target) const
Message * allocMessageLink()
const Enum & Type() const
void finalizeMessage(Message *message, bool hasRecord, ResourcePool *pool, const NString &category)
Exception(const Exception &) noexcept=default
Deleted copy constructor. Exceptions must be caught only as references.
AllocatorType & GetAllocator() noexcept
virtual const String & Get(const NString &category, const NString &name, bool dbgAssert)=0
void DbgDisableBufferReplacementWarning()
void Set(const TString< TChar > &src, TChar delimiter, bool skipEmptyTokens=false)
TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
TLocalString< TChar, 8 > TrimChars
void raise(const CallerInfo &ci, int type, std::string_view domain, const std::span< std::any > &args)
const TRecord * TryRecord(Enum e)
const TRecord & GetRecord(Enum e)
HashMap< MonoAllocator, EnumRecordKey, const void *, EnumRecordKey::Hash, EnumRecordKey::EqualTo > & getInternalRecordMap()
strings::TString< nchar > NString
Type alias in namespace #"%alib".
format::Formatter Formatter
Type alias in namespace #"%alib".
resources::ResourcePool ResourcePool
Type alias in namespace #"%alib".
strings::util::TTokenizer< character > Tokenizer
Type alias in namespace #"%alib".
camp::Basecamp BASECAMP
The singleton instance of ALib Camp class #"Basecamp".
LocalString< 1024 > String1K
Type alias name for #"TLocalString;TLocalString<character,1024>".
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace #"%alib".
format::Paragraphs Paragraphs
Type alias in namespace #"%alib".
boxing::Enum Enum
Type alias in namespace #"%alib".
TIntegral Integral() const
const std::type_info & TypeID() const
String EnumElementName
The name of the enum element.
static void Get(String &result, bool isLastField=false)
String DescriptionOrItsResourceName
ExceptionEntry * next
A pointer to the next message.