8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
41 const NString& resourceCategory,
43 strings::util::Token* token,
51 Substring parser= resourcePool.Get( resourceCategory, resourceName
ALIB_DBG(,
false ) );
58 parser= resourcePool.Get( resourceCategory,
NString256() << resourceName << resourceNo++
62 "Resource string(s) \"{}/{}(nn)\" not found when parsing token.",
63 resourceCategory, resourceName )
65 if( parser.IsEmpty() )
68 while( parser.IsNotEmpty() )
70 String actValue= parser.ConsumeToken( outerSeparator );
71 token->Define( actValue, innerSeparator );
75 switch( token->DbgGetError() )
80 errorMessage=
"No token name found.";
83 errorMessage=
"Sensitivity value not found.";
86 errorMessage=
"Error parsing the list of minimum lengths.";
89 errorMessage=
" A maximum of 7 minimum length values was exceeded.";
92 errorMessage=
"The number of given minimum length values is greater than 1 "
93 "but does not match the number of segments in the identifier.";
96 errorMessage=
"More than one minimum length value was given but no "
97 "segmentation scheme could be detected." ;
100 errorMessage=
"A minimum length is specified to be higher than the token "
101 "name, respectively the according segment name.";
104 errorMessage=
"The definition string was not completely consumed.";
107 errorMessage=
"Zero minimum length provided for segment which is not the last\n"
108 "of a camel case token.";
111 default:
ALIB_ERROR(
"RESOURCES",
"Illegal switch state." ) break;
114 if( errorMessage.IsNotEmpty() )
117 "\n(While reading token table.)\n"
118 " Resource category (module name): \"{}\"\n"
119 " Resource name: \"{}\"\n"
120 " Token value parsed: \"{}\"",
121 resourceCategory, resourceName, actValue )
135 for(
int i= 0 ; i < 35 ; ++i )
137 if( resourcePool.Get( resourceCategory,
NString256() << resourceName << (resourceNo + i)
141 "Detected a \"gap\" in numbering of resource strings while parsing "
142 "resource token table: "
143 "From index {} to {}.\n"
144 " Resource category/name: {} / {}",
145 resourceNo - 1, resourceNo + i - 1, resourceCategory, resourceName )
152 "Size mismatch in resourced token table:\n"
153 " Resource category (module name): \"{}\"\n"
154 " Resource name: \"{}\"\n"
155 " Resourced table size: [{}]\n"
156 " Expected table size: [{}]",
157 resourceCategory, resourceName, tableSize, dbgSizeVerifier )
@ ErrorReadingSensitivity
Sensitivity value not found.
@ TooManyMinLengthsGiven
A maximum of 7 minimum length values was exceeded.
@ EmptyName
No token name found.
@ ZeroMinLengthAndNotLastCamelHump
@ ErrorReadingMinLengths
Error parsing the list of minimum lengths.
@ DefinitionStringNotConsumed
The definition string was not completely consumed.
@ MinLenExceedsSegmentLength
#define ALIB_ERROR(domain,...)
#define ALIB_ASSERT_ERROR(cond, domain,...)
constexpr bool IsNotNull(const T &t)
void LoadResourcedTokens(camp::Camp &module, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')
strings::TString< nchar > NString
Type alias in namespace alib.
resources::ResourcePool ResourcePool
Type alias in namespace alib.
strings::TCString< nchar > NCString
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
NLocalString< 256 > NString256
Type alias name for TLocalString<nchar,256>.
characters::character character
Type alias in namespace alib.
strings::TSubstring< character > Substring
Type alias in namespace alib.