8#ifndef HPP_ALIB_STRINGS_UTIL_TOKEN
9#define HPP_ALIB_STRINGS_UTIL_TOKEN 1
27namespace alib {
namespace strings::util {
251 int8_t minLength3= -1, int8_t minLength4= -1, int8_t minLength5= -1,
252 int8_t minLength6= -1, int8_t minLength7= -1 );
267 {
Define( definitionSrc, separator ); }
308 "Error in token definition. Use DbgGetError in debug-compilations!" )
380 "Index ",
NString64() << idx,
" out of range." )
383 return (idx >= 0 && idx <= 6) ?
minLengths[idx] : -1;
434 #if ALIB_ENUMS && ALIB_CAMP
476 const NString& resourceCategory,
485 const NString& resourceCategory,
532 target,
ALIB_DBG(dbgSizeVerifier,) outerSeparator, innerSeparator );
559namespace alib {
namespace strings {
561namespace APPENDABLES {
resources::ResourcePool & GetResourcePool()
NCString ResourceCategory
ALIB_API void detectFormat()
Detects snake_case, kebab-case or CamelCase.
Token()
Parameterless constructor. Creates an "undefined" token.
DbgDefinitionError DbgGetError()
const String & GetDefinitionName() const
ALIB_API void GetExportName(AString &target) const
lang::Case Sensitivity() const
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.
static constexpr Formats ignoreCase
Letter case sensitivity. This is combined with the format bits.
Formats GetFormat() const
ALIB_API void Define(const String &definition, character separator=';')
Formats
Format types detected with detectFormat.
@ 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=';')
Formats format
Defines the "case type" as well as the letter case sensitivity of this token.
@ 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
String exportName
The tokens' optional explicit export name.
int8_t GetMinLength(int idx) const
ALIB_API bool Match(const String &needle)
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
#define ALIB_WARNINGS_RESTORE
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
#define ALIB_ASSERT_ERROR(cond,...)
#define IF_ALIB_ENUMS(...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_REL_DBG(releaseCode,...)
Case
Denotes upper and lower case character treatment.
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.
void operator()(strings::TAString< character, TAllocator > &target, const strings::util::Token &src)