10# if !defined (HPP_ALIB_CAMP_MESSAGE_EXCEPTION)
14# if !defined (HPP_ALIB_STRINGS_UTIL_TOKENIZER)
18# if !defined (HPP_ALIB_LANG_FORMAT_FORMATTER_STD)
22# if !defined (HPP_ALIB_LANG_FORMAT_PARAGRAPHS)
26#if !defined(HPP_ALIB_CAMP_MESSAGE_REPORT)
30# if !defined (HPP_ALIB_CAMP_MESSAGE_EXCEPTION)
34# if !defined (HPP_ALIB_ENUMS_RECORDPARSER)
37# if !defined (HPP_ALIB_ENUMS_DETAIL_ENUMRECORDMAP)
40# if !defined (HPP_ALIB_LANG_CAMP_INLINES)
54 ERSerializable::MinimumRecognitionLength= 0;
62 while(*tail !=
nullptr)
66 (*tail)->
next=
nullptr;
81 if( tryRecord ==
nullptr )
83 std::vector<std::pair<integer,const void*>> recordList;
85 if( record.first.RTTI == message->
Type.
TypeID() )
86 recordList.push_back( std::pair<integer,const void*>(record.first.Element, record.second) );
87 if( recordList.size() == 0)
89 ALIB_ERROR(
"EXCEPT",
"No enum records defined for exception enumeration type {!Q<>}.",
94 std::sort( recordList.begin(), recordList.end(),
95 [] (std::pair<integer,const void*>& a, std::pair<integer,const void*>& b )
97 return a.first < b.first;
101 formatter->Format( recordListDump,
102 "Enum record {} not found for exception enumeration type {}.\n"
103 "The following records have been found:\n",
107 for(
auto& pair : recordList )
108 formatter->Format( recordListDump,
" {:2}: {}\n",
111 formatter->Release();
118 if( pool ==
nullptr )
119 message->emplace( message->begin(),
120 enumRecord.DescriptionOrItsResourceName );
122 message->emplace( message->begin(),
124 enumRecord.DescriptionOrItsResourceName
132 auto* result=
Self();
133 while( result->next !=
nullptr )
134 result= result->next;
136 return result->message;
143 while( entry->next !=
nullptr )
155 Enum* result= &entry->message.Type;
156 while( (entry= entry->next) !=
nullptr )
157 if( entry->message.Type.Integral() >= 0 )
158 result= &entry->message.Type;
174 for (
auto entry=
begin(); entry !=
end(); ++entry )
176 text.
Add(
A_CHAR(
"{}{}: {!Q<>}"), (entry->Type.Integral() >= 0 ?
'E' :
'I'), entryNo, entry->Type );
180 formatter->FormatArgs( buf.
Reset(), *entry );
187 tknzr.
Set( buf,
'\n' );
195 formatter->Release();
const String & GetResource(const NString &name)
ALIB_API Message & Back() const
ALIB_API int Size() const
ALIB_API const Enum & Type() const
ALIB_API Message * allocMessageLink()
ALIB_API void finalizeMessage(Message *message, bool hasRecord, ResourcePool *pool, const NString &category)
ALIB_API AString & Format(AString &target) const
virtual const String & Get(const NString &category, const NString &name, bool dbgAssert)=0
ALIB_FORCE_INLINE char * Alloc(size_t size, size_t alignment)
MonoAllocator & Allocator()
detail::ExceptionEntry *& Self()
void DbgDisableBufferReplacementWarning()
TLocalString< TChar, 8 > TrimChars
ALIB_API TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
void Set(const TString< TChar > &src, TChar delimiter, bool skipEmptyTokens=false)
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
#define ALIB_CALLER_PRUNED
const HashMap< EnumRecordKey, const void *, EnumRecordKey::Hash, EnumRecordKey::EqualTo > & getInternalRecordMap()
lang::basecamp::BaseCamp BASECAMP
std::shared_ptr< lang::format::Formatter > SPFormatter
const TRecord & GetRecord()
const TRecord * TryRecord()
const std::type_info & TypeID() const
static ALIB_API void Get(String &result, bool isLastField=false)
String DescriptionOrItsResourceName
Message message
The message,.
ExceptionEntry * next
A pointer to the next message.