ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
token.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header file is part of module \alib_strings of the \aliblong.
4///
5/// \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6/// Published under \ref mainpage_license "Boost Software License".
7//==================================================================================================
8#ifndef HPP_ALIB_STRINGS_UTIL_TOKEN
9#define HPP_ALIB_STRINGS_UTIL_TOKEN 1
10#pragma once
11#if !defined(DOXYGEN)
12# include "alib/alib.hpp"
13#endif
16#if ALIB_CAMP
18#endif
19#if ALIB_BOXING
20# include "alib/boxing/boxing.hpp"
21#endif
22#if ALIB_ENUMS
23# include "alib/enums/bitwise.hpp"
24#endif
25
26
27namespace alib { namespace strings::util {
28
29
30//==================================================================================================
31/// Tokens in the context of \alib_strings_nl, are human-readable "words" or "symbols" that
32/// represent a certain value or entity of a software. Tokens may be used with configuration files,
33/// mathematical or general expressions, programming languages, communication protocols and so forth.
34///
35/// This struct contains attributes to describe a token, a method to parse the attributes from a
36/// (resource) string and finally method #Match that matches a given string against the token
37/// definition.
38///
39/// ## %Token Format: ##
40/// With the construction, respectively the \ref Define "definition" of a token, special formats are
41/// detected. These formats are:
42/// - <em>"snake_case"</em><br>
43/// - <em>"kebab-case"</em><br>
44/// - <em>"CamelCase"</em><br>
45///
46/// \note
47/// Information about such case formats is given in this
48/// \https{Wikipedia article,en.wikipedia.org/wiki/Letter_case#Special_case_styles}.
49///
50/// \note
51/// If the name indicates a mix of \e snake_case, \e kebab-case or \e CamelCase formats
52/// (e.g., \e "System_Propery-ValueTable"), then snake_case supersedes both others and kebab-case
53/// supersedes CamelCase.
54///
55/// The format detection is only performed when more than one minimum length is given. In this case,
56/// the number of "segments" (e.g., "camel humps") has to match the number of length values.
57///
58///
59/// ## Character Case Sensitivity: ##
60/// Independent of the token format (normal or snake_case, kebab-case, CamelCase), character case
61/// sensitivity can be chosen. With \e CamelCase and case-sensitive parsing, the first character of
62/// the first hump may be defined lower or upper case (called "lowerCamelCase" vs. "UpperCamelCase").
63///
64/// If none of the special formats is detected, the tokens can optionally be abbreviated by just
65/// providing a minimum amount of starting characters as specified by the then single entry
66/// in #minLengths.
67/// Otherwise, each segment of the token (e.g., "camel hump") can (again optionally) be shortened
68/// on its own.
69/// As an example, if for token <c>"SystemProperty"</c> the minimum lengths given are
70/// \c 3 and \c 4, the minimum abbreviation is <c>"SysProp"</c>, while <c>"SystProper"</c> also
71/// matches.<br>
72///
73///
74/// ## Limitation To Seven Segments: ##
75/// This class supports minimum length definitions for up to \c 7 "camel humps", respectively
76/// segments. Should a name contain even more segments, those cannot be abbreviated.
77/// Providing more than \c 7 values for minimum segment lengths with the definition string results
78/// in a definition error (see below).
79///
80///
81/// ## Special Treatment For CamelCase: ##
82/// ### Omitable Last Camel Hump: ####
83/// The minimum length values provided must be greater than \c 0, with one exception:
84/// With \e CamelCase format and case-insensitive definition, the last "camel hump" may have a
85/// minimum length of \c 0 and hence may be omitted when matched.
86/// If so, the "normalized" version of the token, which can be received by
87/// \alib{strings;T_Append;appending} an instance to an \alib{strings;TAString;AString}, will have
88/// the last letter of the defined name converted to lower case.<br>
89/// The rationale for this specific approach is to support the English plural case. This can be best
90/// explained in a sample. If a token was defined using definition string:
91///
92/// "MilliSecondS Ignore 1 1 0"
93///
94/// then all of the following words match:
95///
96/// milliseconds
97/// MilliSecs
98/// millis
99/// MSec
100/// MSecs
101/// MSs
102/// ms
103///
104/// In the case that the rightfully (normalized) spelled token name is to be written, then with
105/// the last character converted to lower case, the token becomes
106///
107/// MilliSeconds
108///
109/// This is performed with methods #GetExportName (which is also used by the specialization of
110/// functor \alib{strings;T_Append} for this type.
111/// Hence, when appending a \b Token to an \b AString, if omitable, the last character
112/// of the token name is converted to lower case.
113///
114/// If the above is not suitable, or for any other reasons a different "normalized" name is wanted
115/// when writing the token, then method #Define offers a next mechanism to explicitly define
116/// any custom string to be written.
117///
118/// ### Rollback: ####
119/// \e CamelCase supports a simple "rollback" mechanism, which is needed for example for token
120///
121/// "SystemTemperature Ignore 1 1 0"
122///
123/// and given match argument
124///
125/// system
126///
127/// All six characters are matching the first hump, but then there are not characters left to
128/// match the start of the second hump \c "Temperature". In this case, a loop of retries is
129/// performed by rolling back characters from the back of the hump (\c 'm') and ending with the
130/// first optional character of that hump (\c 'y'). The loop will be broken when
131/// character \c 't' is found.
132///
133/// However: This is not continued in the case that the term that was rolled back does not match,
134/// yet. This means, that certain (very unlikely!) tokens, with nested repeating character sequences
135/// in camel humps, cannot be abbreviated to certain (unlikely wanted) lengths.
136///
137/// ## Handling Definition Errors: ###
138///
139/// The definition strings passed to method #Define are considered static (resourced) data.
140/// In other words, this definition data should be compile-time defined and not be customizable
141/// by end-users, but only by experts.
142/// Therefore, only in debug-compilations of the library, a due testing of correctness of the
143/// definitions is available.
144///
145/// The source code of static utility method #LoadResourcedTokens demonstrates how error
146/// codes defined with enumeration #DbgDefinitionError can be handled in debug-compilations
147/// by raising debug-assertions.
148//==================================================================================================
149class Token
150{
151 public:
152 /// Format types detected with #detectFormat.
153 enum class Formats : int8_t
154 {
155 Normal = 0, ///< Normal, optionally abbreviated words.
156 SnakeCase = 2, ///< snake_case using underscores.
157 KebabCase = 4, ///< kebab-case using hyphens.
158 CamelCase = 8, ///< UpperCamelCase or lowerCamelCase.
159 };
160
161#if ALIB_DEBUG
162 /// Error codes which which are written in field #format in the case that method #Define
163 /// suffers a parsing error.<br>
164 /// This enum, as well as the error detection is only available in debug-compilations
165 /// of the library.
166 enum class DbgDefinitionError : int8_t
167 {
168 OK = 0, ///< All is fine.
169 EmptyName = - 1, ///< No token name found.
170 ErrorReadingSensitivity = - 2, ///< Sensitivity value not found.
171 ErrorReadingMinLengths = - 3, ///< Error parsing the list of minimum lengths.
172 TooManyMinLengthsGiven = - 4, ///< A maximum of \c 7 minimum length values was exceeded.
173 InconsistentMinLengths = - 5, ///< The number of given minimum length values is greater than \c 1
174 ///< but does not match the number of segments in the identifier.
175 NoCaseSchemeFound = - 6, ///< More than one minimum length value was given but no
176 ///< segmentation scheme could be detected.
177 MinLenExceedsSegmentLength = - 7, ///< A minimum length is specified to be higher than the token
178 ///< name, respectively the according segment name.
179 DefinitionStringNotConsumed = - 8, ///< The definition string was not completely consumed.
180 ZeroMinLengthAndNotLastCamelHump= - 9, ///< A minimum length of \c 0 was specified for a segment that is not
181 ///< a last camel case hump.
182 };
183#endif
184 protected:
185
186 /// The tokens' definition string part.
188
189 /// The tokens' optional explicit export name.
191
192
193 /// Defines the "case type" as well as the letter case sensitivity of this token.
195
196 /// The minimum abbreviation length per segment. If only one is given (second is \c -1), then
197 /// field #Format indicates normal tokens.
198 /// Otherwise, the token is either snake_case, kebab-case or CamelCase.
199 int8_t minLengths[7] = {0,0,0,0,0,0,0};
200
201
202 /// Letter case sensitivity. This is combined with the format bits.
203 static constexpr Formats ignoreCase = Formats(1);
204
205
206 // #############################################################################################
207 // Constructors
208 // #############################################################################################
209 public:
210 /// Parameterless constructor. Creates an "undefined" token.
213
214 //==========================================================================================
215 /// Constructor used with function names that do not contain snake_case, kebab-case or
216 /// CamelCase name scheme.
217 /// \note Of course, the name may follow such scheme. With this constructor, it just will not
218 /// be detected.
219 /// @param name The function name.
220 /// @param sensitivity The letter case sensitivity of reading the function name.
221 /// @param minLength The minimum starting portion of the function name to read..
222 /// @param exportName An optional export name. If \b not given, the \p{name} is
223 /// used with method #GetExportName.
224 //==========================================================================================
226 Token(const String& name, lang::Case sensitivity, int8_t minLength,
227 const String& exportName= NULL_STRING );
228
229
230 //==========================================================================================
231 /// Constructor with at least two minimum length values, used to define tokens that follow
232 /// snake_case, kebab-case or CamelCase naming schemes.
233 ///
234 /// @param name The function name.
235 /// @param sensitivity The letter case sensitivity of reading the function name.
236 /// @param minLength1 The minimum starting portion of the first segment to read.
237 /// @param minLength2 The minimum starting portion of the second segment to read.
238 /// @param minLength3 The minimum starting portion of the third segment to read.
239 /// Defaults to \c 1.
240 /// @param minLength4 The minimum starting portion of the fourth segment to read.
241 /// Defaults to \c 1.
242 /// @param minLength5 The minimum starting portion of the fifth segment to read.
243 /// Defaults to \c 1.
244 /// @param minLength6 The minimum starting portion of the sixth segment to read.
245 /// Defaults to \c 1.
246 /// @param minLength7 The minimum starting portion of the seventh segment to read.
247 /// Defaults to \c 1.
248 //==========================================================================================
250 Token( const String& name, lang::Case sensitivity, int8_t minLength1, int8_t minLength2,
251 int8_t minLength3= -1, int8_t minLength4= -1, int8_t minLength5= -1,
252 int8_t minLength6= -1, int8_t minLength7= -1 );
253
254#if ALIB_ENUMS
255 //==========================================================================================
256 /// Constructor using a (usually resourced) string to read the definitions.
257 /// Invokes #Define.
258 ///
259 /// @param definitionSrc The input string.
260 /// @param separator Separation character used to parse the input.
261 /// Defaults to <c>';'</c>.
262 ///
263 /// \par Module Dependencies
264 /// This method is only available if module \alib_enums is included in the \alibdist.
265 //==========================================================================================
266 Token( const String& definitionSrc, character separator = ';' )
267 { Define( definitionSrc, separator ); }
268#endif
269
270 // #############################################################################################
271 // Interface
272 // #############################################################################################
273 public:
274 #if ALIB_DEBUG
275 //======================================================================================
276 /// Tests if this token was well defined.
277 ///
278 /// \note
279 /// This method is only available in debug-compilations.
280 /// Definition strings are considered static data (preferably resourced).
281 /// Therefore, in debug-compilations, this method should be invoked and with that,
282 /// the consistency of the resources be tested. In the case of failure, a debug
283 /// assertion should be raised.
284 ///
285 /// @return \alib{strings::util::Token;DbgDefinitionError::OK}, if this token is well
286 /// defined, a different error code otherwise.
287 //======================================================================================
293 #endif
294
295 //==========================================================================================
296 /// Returns the definition name used for parsing the token.
297 ///
298 /// \note
299 /// To receive the "normalized" name of this token, method #GetExportName can be used, or
300 /// a token can simply be \ref alib_strings_assembly_ttostring "appended" to an
301 /// instance of type \alib{strings;TAString;AString}.
302 ///
303 /// @return This token's #definitionName.
304 //==========================================================================================
306 {
307 ALIB_ASSERT_ERROR( int8_t(format) >= 0, "STRINGS/TOK"
308 "Error in token definition. Use DbgGetError in debug-compilations!" )
309 return definitionName;
310 }
311
312 //==========================================================================================
313 /// If field #exportName is not \e nulled (hence explicitly given with resourced definition
314 /// string or with a constructor), this is appended.
315 ///
316 /// Otherwise appends the result of \alib{strings::util;Token::GetDefinitionName} to
317 /// the \p{target}. If the token is defined \e CamelCase and the minimum length of the last
318 /// segment is defined \c 0, then the last character written is converted to lower case.
319 ///
320 /// As a result, in most cases it is \b not necessary to provide a specific #exportName
321 /// with the definition. Instead, this method should provide a reasonable output.
322 ///
323 /// \see Documentation section <b>Omitable Last Camel Hump</b> of this classes'
324 /// \alib{strings::util;Token;documentation}, for more information about why the
325 /// character conversion to lower case might be performed.
326 ///
327 /// @param target The \b AString that method \b Append was invoked on.
328 //==========================================================================================
330 void GetExportName(AString& target) const;
331
332 //==========================================================================================
333 /// Returns the format of this token.
334 ///
335 /// \note Same as methods #Sensitivity and #GetMinLength, this method is usually not
336 /// of interest to standard API usage.
337 /// These three informational methods are rather provided to support the unit tests.
338 /// @return This token's format, used with method #Match.
339 //==========================================================================================
341 {
342 ALIB_ASSERT_ERROR( int8_t(format) >= 0, "STRINGS/TOK",
343 "Error ", NString64(int8_t(format)), " in definition of token \"",
344 NString128(definitionName), "\". Use DbgGetError in debug-compilations!" )
345 return Formats( int8_t(format) & ~int8_t(ignoreCase) );
346 }
347
348 //==========================================================================================
349 /// Returns the letter case sensitivity of this token.
350 ///
351 /// \note Same as methods #GetFormat and #GetMinLength, this method is usually not
352 /// of interest to standard API usage.
353 /// These three informational methods are rather provided to support the unit tests.
354 /// @return The letter case sensitivity used with method #Match.
355 //==========================================================================================
357 { return (int(format) & 1 ) == 1 ? lang::Case::Ignore : lang::Case::Sensitive; }
358
359 //==========================================================================================
360 /// Returns the minimum length to be read. In case that this token is not of
361 /// snake_case, kebab-case or CamelCase naming scheme, only \c 0 is allowed for parameter
362 /// \p{idx} and this defines the minimal abbreviation length. If one of the naming schemes
363 /// applies, parameter \p{idx} may be as high as the number of segments found in the
364 /// name (and a maximum of \c 6, as this class supports only up to seven segments).
365 ///
366 /// The first index that exceeds the number of segments, will return \c -1 for the length.
367 /// If even higher index values are requested, then the returned value is undefined.
368 ///
369 /// @param idx The index of the minimum length to receive.
370 ///
371 /// \note Same as methods #GetFormat and #Sensitivity, this method is usually not
372 /// of interest to standard API usage.
373 /// These three informational methods are rather provided to support the unit tests.
374 ///
375 /// @return The minimum length of segment number \p{idx}.
376 //==========================================================================================
377 int8_t GetMinLength( int idx ) const
378 {
379 ALIB_ASSERT_ERROR( idx >= 0 && idx <= 6 , "STRINGS/TOK",
380 "Index ", NString64() << idx, " out of range." )
381
383 return (idx >= 0 && idx <= 6) ? minLengths[idx] : -1;
385 }
386
387 #if ALIB_ENUMS
388 //==========================================================================================
389 /// Defines or redefines this token by parsing the attributes from the given substring.
390 /// This method is usually invoked by code that loads tokens and other data from
391 /// \alib{lang::resources;ResourcePool;resources} of \alib {lang;Camp} objects.
392 ///
393 /// The expected format is defined as a list of the following values, separated by
394 /// the character given with parameter \p{separator}:
395 /// - The #definitionName of the token. Even if letter case is ignored, this should contain
396 /// the name in "normalized" format, as it may be used with #GetExportName, if no specific
397 /// name to export is given.
398 /// - Letter case sensitivity. This can be "Sensitive" or "Ignore"
399 /// (respectively what is defined with resourced
400 /// \ref alib_enums_records "ALib Enum Records" of type \alib{lang::Case}),
401 /// can be abbreviated to just one character (i.e., <c>'s'</c> and
402 /// <c>'i'</c>) and itself is not parsed taking letter case into account.
403 /// - Optionally the standard export string used with method #GetExportName and when
404 /// appended to an \b AString. Output names defined with this function must not start
405 /// with a digit, because a digit in this position of \p{definition}, indicates that
406 /// no export name is given.
407 /// - The list of minimum length for each segment of the name. The number of values have
408 /// to match the number of segments. A value of \c 0 specifies that no abbreviation
409 /// must be done and therefore is the same as specifying the exact length of the segment.
410 ///
411 /// \note The given \p{definition} string has to survive the use of the token, which
412 /// is naturally true if the string resides in resources. (String contents is not
413 /// copied. Instead, this class later refers to substrings of given \p{definition}.)
414 ///
415 /// @param definition The input string.
416 /// @param separator Separation character used to parse the input.
417 /// Defaults to <c>';'</c>.
418 ///
419 /// \par Module Dependencies
420 /// This method is only available if module \alib_enums is included in the \alibdist.
421 //==========================================================================================
423 void Define( const String& definition, character separator = ';' );
424 #endif
425 //==========================================================================================
426 /// Matches a given string with this token. See this class's description for details.
427 ///
428 /// @param needle The potentially abbreviated input string to match.
429 /// @return \c true if \p{needle} matches this token, \c false otherwise.
430 //==========================================================================================
432 bool Match( const String& needle );
433
434 #if ALIB_ENUMS && ALIB_CAMP
435 #if DOXYGEN
436 //==========================================================================================
437 /// Static utility function that defines a table of token objects from external resourced
438 /// strings.
439 ///
440 /// It is possible to provide the table lines in two ways:
441 /// - In one resource string: In this case, parameter \p{outerDelim} has to specify
442 /// the delimiter that separates the records.
443 /// - In an array of resource strings: If the resource string as given is not defined, this
444 /// method appends an integral index starting with \c 0 to the resource name, parses
445 /// a single record and increments the index.
446 /// Parsing ends when a resource with a next higher index is not found.
447 ///
448 /// The second option is recommended for larger token sets. While the separation causes
449 /// some overhead in a resource backend, the external (!) management (translation,
450 /// manipulation, etc.) is most probably simplified with this approach.
451 ///
452 /// \note
453 /// The length of the given table has to fit to the number of entries found in
454 /// the resource pool. To ensure this, with debug-builds, parameter \p{dbgSizeVerifier}
455 /// has to be provided (preferably by using macro \ref ALIB_DBG "ALIB_DBG(, N)").
456 ///
457 /// @param resourcePool The resource pool to load the resource from.
458 /// @param resourceCategory The resource category.
459 /// @param resourceName The resource name.
460 /// @param target The table to fill.
461 /// @param dbgSizeVerifier This parameter has to be specified only in debug-builds and
462 /// provides the expected size of the resourced table.
463 /// To be surrounded by macro #ALIB_DBG (not to be given in
464 /// release-builds.)
465 /// @param outerSeparator The character that separates the entries.
466 /// Defaults to <c>','</c>.
467 /// @param innerSeparator The character that separates the values of an entry.
468 /// Defaults to <c>' '</c> (space).
469 ///
470 /// \par Module Dependencies
471 /// This method is only available if module \alib_enums as well as module \alib_basecamp
472 /// is included in the \alibdist.
473 //==========================================================================================
474 ALIB_API static
476 const NString& resourceCategory,
477 const NString& resourceName,
478 strings::util::Token* target,
479 int dbgSizeVerifier,
480 character outerSeparator = ',',
481 character innerSeparator = ' ' );
482 #else
483 ALIB_API static
485 const NString& resourceCategory,
486 const NString& resourceName,
487 strings::util::Token* target,
488 ALIB_DBG( int dbgSizeVerifier, )
489 character outerSeparator = ',' ,
490 character innerSeparator = ' ' );
491 #endif
492 #endif
493
494 #if ALIB_CAMP
495 #if DOXYGEN
496 //==========================================================================================
497 /// Shortcut to #LoadResourcedTokens that accepts a module and uses its resource pool
498 /// and resource category.
499 ///
500 /// @param module The \alibcamp to load the resource from.
501 /// @param resourceName The resource name.
502 /// @param target The table to fill.
503 /// @param dbgSizeVerifier This parameter has to be specified only in debug comilations and
504 /// provides the expected size of the resourced table.
505 /// To be surrounded by macro #ALIB_DBG (not to be given in
506 /// release-builds.)
507 /// @param outerSeparator The character that separates the entries.
508 /// Defaults to <c>','</c>.
509 /// @param innerSeparator The character that separates the values of an entry.
510 /// Defaults to <c>' '</c> (space).
511 ///
512 /// \par Module Dependencies
513 /// This method is only available if module \alib_basecamp is included in the \alibdist.
514 //==========================================================================================
515 static inline
517 const NString& resourceName,
518 strings::util::Token* target,
519 int dbgSizeVerifier,
520 character outerSeparator = ',',
521 character innerSeparator = ' ' );
522 #else
523 static
524 void LoadResourcedTokens( lang::Camp& module,
525 const NString& resourceName,
526 strings::util::Token* target,
527 ALIB_DBG( int dbgSizeVerifier, )
528 character outerSeparator = ',',
529 character innerSeparator = ' ' )
530 {
531 LoadResourcedTokens( module.GetResourcePool(), module.ResourceCategory, resourceName,
532 target, ALIB_DBG(dbgSizeVerifier,) outerSeparator, innerSeparator );
533 }
534 #endif
535
536 #endif
537
538
539 protected:
540 //==========================================================================================
541 /// Detects snake_case, kebab-case or CamelCase.
542 //==========================================================================================
544 void detectFormat();
545
546}; // struct Token
547
548} // namespace alib[::strings::util]
549
550/// Type alias in namespace \b alib.
552
553} // namespace [alib]
554
555#if ALIB_BOXING
557#endif
558
559namespace alib { namespace strings {
560#if DOXYGEN
561namespace APPENDABLES {
562#endif
563 //==============================================================================================
564 /// Specialization of functor \alib{strings;T_Append} for type \alib{strings::util;Token}.
565 //==============================================================================================
566 template<typename TAllocator> struct T_Append<strings::util::Token, alib::character,TAllocator>
567 {
568 /// Appends the result of \alib{strings::util;Token::GetExportName} to the \p{target}.
569 /// @param target The \b AString that method \b Append was invoked on.
570 /// @param src The \b Token to append.
572 { src.GetExportName(target); }
573 };
574#if DOXYGEN
575} // namespace alib::strings[::APPENDABLES]
576#endif
577}} // namespace [alib::strings]
578
580
581#endif // HPP_ALIB_STRINGS_UTIL_TOKEN
582
resources::ResourcePool & GetResourcePool()
Definition camp.hpp:254
NCString ResourceCategory
Definition camp.hpp:119
ALIB_API void detectFormat()
Detects snake_case, kebab-case or CamelCase.
Definition token.cpp:175
Token()
Parameterless constructor. Creates an "undefined" token.
Definition token.hpp:211
DbgDefinitionError DbgGetError()
Definition token.hpp:288
const String & GetDefinitionName() const
Definition token.hpp:305
ALIB_API void GetExportName(AString &target) const
Definition token.cpp:58
lang::Case Sensitivity() const
Definition token.hpp:356
static void LoadResourcedTokens(lang::Camp &module, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')
String definitionName
The tokens' definition string part.
Definition token.hpp:187
static constexpr Formats ignoreCase
Letter case sensitivity. This is combined with the format bits.
Definition token.hpp:203
Formats GetFormat() const
Definition token.hpp:340
ALIB_API void Define(const String &definition, character separator=';')
Definition token.cpp:86
Formats
Format types detected with detectFormat.
Definition token.hpp:154
@ CamelCase
UpperCamelCase or lowerCamelCase.
@ SnakeCase
snake_case using underscores.
@ Normal
Normal, optionally abbreviated words.
@ KebabCase
kebab-case using hyphens.
static ALIB_API void LoadResourcedTokens(lang::resources::ResourcePool &resourcePool, const NString &resourceCategory, const NString &resourceName, strings::util::Token *target, int dbgSizeVerifier, character outerSeparator=',', character innerSeparator=' ')
Token(const String &definitionSrc, character separator=';')
Definition token.hpp:266
Formats format
Defines the "case type" as well as the letter case sensitivity of this token.
Definition token.hpp:194
@ ErrorReadingSensitivity
Sensitivity value not found.
@ TooManyMinLengthsGiven
A maximum of 7 minimum length values was exceeded.
@ ErrorReadingMinLengths
Error parsing the list of minimum lengths.
@ DefinitionStringNotConsumed
The definition string was not completely consumed.
String exportName
The tokens' optional explicit export name.
Definition token.hpp:190
int8_t GetMinLength(int idx) const
Definition token.hpp:377
ALIB_API bool Match(const String &needle)
Definition token.cpp:314
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
Definition bitwise.hpp:109
#define ALIB_WARNINGS_RESTORE
Definition alib.hpp:849
#define ALIB_API
Definition alib.hpp:639
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
Definition vtable.inl:460
#define ALIB_ASSERT_ERROR(cond,...)
Definition alib.hpp:1271
#define IF_ALIB_ENUMS(...)
Definition alib.hpp:288
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
Definition alib.hpp:760
#define ALIB_DBG(...)
Definition alib.hpp:390
#define ALIB_REL_DBG(releaseCode,...)
Definition alib.hpp:392
Case
Denotes upper and lower case character treatment.
Definition alib.cpp:69
NLocalString< 128 > NString128
Type alias name for TLocalString<nchar,128>.
NLocalString< 64 > NString64
Type alias name for TLocalString<nchar,64>.
characters::character character
Type alias in namespace alib.
constexpr String NULL_STRING
A nulled string of the default character type.
Definition string.hpp:2549
void operator()(strings::TAString< character, TAllocator > &target, const strings::util::Token &src)
Definition token.hpp:571