Evo C++ Library v0.5.1
|
Evo containers. More...
Classes | |
class | Array< T, TSize > |
Dynamic array container with similar interface to List. More... | |
class | AtomicBufferQueue< T, TSize > |
Fast buffer-based queue, implemented with a ring-buffer. More... | |
class | BitArraySubsetT< TParent > |
A subset of a BitArray. More... | |
class | BitArrayT< T, TSize > |
Dynamic bit array container with similar interface to Array and List. More... | |
class | BufferQueue< T, TSize > |
Fast buffer-based queue, implemented with a ring-buffer. More... | |
class | Capacity |
Optimized container size and capacity calculation. More... | |
struct | Compare< T > |
Comparison object used with containers that order/sort items. More... | |
struct | CompareBase< T > |
Base type for comparison types. More... | |
struct | CompareHash< T > |
Hash object used with containers that hash items. More... | |
struct | CompareI< T > |
Comparison object used with containers that order/sort items (case-insensitive). More... | |
struct | CompareIR< T > |
Comparison object used with containers that order/sort items (case-insensitive, reverse). More... | |
struct | CompareR< T > |
Comparison object used with containers that order/sort items (reverse). More... | |
struct | DataCompare< T, B1, B2 > |
Data comparison helpers. More... | |
struct | DataCopy< T, U > |
Optimized data copy helpers. More... | |
struct | DataEqual< T, B > |
Data equality helper. More... | |
struct | DataFill< T, U > |
Optimized data fill helpers. More... | |
struct | DataHash< T, H, B > |
Optimized data hash helpers. More... | |
struct | DataInit< T, U > |
Optimized data initialization and uninitialization helpers. More... | |
struct | DataType< T > |
Base data type for optimizated data helpers. More... | |
class | EnumIterator< T, F, L > |
Iterator template for sequential enum values. More... | |
struct | EnumMapIterator< T > |
Expanded EnumIterator used with enum traits. More... | |
class | ExceptionSubStringMapList |
SubStringMapList input ordering verification failed, see Exception. More... | |
struct | FmtAttribs |
Formatting attributes (used internally). More... | |
struct | FmtChar |
Explicitly format a repeated character. More... | |
struct | FmtDump |
Explicitly format a hex dump from buffer. More... | |
struct | FmtFieldFloat< T > |
This pairs a FmtFloatT type with FmtSetField for output formatting. More... | |
struct | FmtFieldNum< T > |
This pairs a FmtIntT type with FmtSetField for output formatting. More... | |
struct | FmtFloatT< T > |
Explicitly format a floating pointer number. More... | |
struct | FmtIntT< T > |
Explicitly format an integer. More... | |
struct | FmtPtr |
Explicitly format a pointer. More... | |
struct | FmtSetField |
Holds field and alignment formatting attributes. More... | |
struct | FmtSetFloat |
Holds floating point formatting attributes. More... | |
struct | FmtSetInt |
Holds integer formatting attributes. More... | |
struct | FmtSetNull |
Holds string to use when formatting null values. More... | |
struct | FmtString |
Explicitly format a string. More... | |
struct | FmtStringWrap |
struct | FmtTable |
Text table formatter. More... | |
struct | FmtTableAttribs |
Helper for adjusting FmtTable column attributes. More... | |
struct | FmtTableOut< T, W > |
Output interface for writing text table to stream/string. More... | |
class | IteratorBase< T > |
Base iterator (used internally). More... | |
class | IteratorBi< T > |
Bidirectional iterator. More... | |
class | IteratorFw< T > |
Forward iterator. More... | |
class | IteratorRa< T > |
Random access iterator. More... | |
class | List< T, TSize > |
Sequential list container with random access. More... | |
class | Map< TKey, TValue, TSize > |
Associative container holding key/value pairs for fast lookup. More... | |
class | MapHash< TKey, TValue, THash, TSize > |
Map implemented as a hash table. More... | |
class | MapList< TKey, TValue, TCompare, TSize > |
Map implemented as an ordered list. More... | |
struct | Pair< TA, TB > |
Stores a key/value pair of independent objects or values. More... | |
class | PtrList< T, TSize > |
Sequential list of managed pointers with random access. More... | |
class | Set< TKey, TSize > |
Associative container with unique values for fast lookup. More... | |
class | SetHash< TKey, THash, TSize > |
Set implemented as a hash table. More... | |
class | SetList< TKey, TCompare, TSize > |
Set implemented as an ordered sequential array/list. More... | |
class | String |
String container. More... | |
struct | StringFlt< T, PADDING > |
String fixed-size buffer for formatting a floating point number. More... | |
struct | StringInt< T, PADDING > |
String fixed-size buffer for formatting an integer. More... | |
struct | StrQuoting |
Helpers for determining quoting type to use with string data. More... | |
struct | SubList< T, TSize > |
Reference and access existing list data. More... | |
struct | SubString |
Reference and access existing string data. More... | |
class | SubStringMapList |
References a list of sorted substrings for fast lookup. More... | |
class | UnicodeString |
Unicode string container using UTF-16. More... | |
class | Var |
General purpose variable that can hold a basic value (string, number, bool, etc) or children with nested values (object, list). More... | |
class | VarObject |
Explicit variant of Var used for initializing as an object with an initializer list of key/value pairs (C++11). More... | |
Macros | |
#define | EVO_ENUM_CLASS_MAP(ENUM, ...) |
Helper for creating enum class string/value mappers (C++11). More... | |
#define | EVO_ENUM_CLASS_REMAP(ENUM, REMAP_ARRAY, ...) |
Helper for creating enum class string/value mappers, with unsorted enum remapped to sorted values. More... | |
#define | EVO_ENUM_CLASS_TRAITS(ENUM, TRAITS, ...) |
Helper for creating enum class trait mappers (C++11). More... | |
#define | EVO_ENUM_MAP(ENUM, FIRST_VAL, LAST_VAL, UNKNOWN_VAL, ...) |
Helper for creating enum string/value mappers with explicit first/last/unknown values. More... | |
#define | EVO_ENUM_MAP_PREFIXED(ENUM, PREFIX, ...) EVO_ENUM_MAP(ENUM, (ENUM)((int)(PREFIX ## UNKNOWN) + 1), (ENUM)((int)(PREFIX ## ENUM_END) - 1), PREFIX ## UNKNOWN, __VA_ARGS__) |
Helper for creating enum string/value mappers with prefixed enum values. More... | |
#define | EVO_ENUM_REMAP(ENUM, FIRST_VAL, LAST_VAL, UNKNOWN_VAL, REMAP_ARRAY, ...) |
Helper for creating enum string/value mappers with explicit first/last/unknown values, with unsorted enum remapped to sorted values. More... | |
#define | EVO_ENUM_REMAP_PREFIXED(ENUM, PREFIX, REMAP_ARRAY, ...) EVO_ENUM_REMAP(ENUM, (ENUM)((int)(PREFIX ## UNKNOWN) + 1), (ENUM)((int)(PREFIX ## ENUM_END) - 1), PREFIX ## UNKNOWN, REMAP_ARRAY, __VA_ARGS__) |
Helper for creating enum string/value mappers with prefixed enum values, with unsorted enum remapped to sorted values. More... | |
#define | EVO_ENUM_TRAITS(ENUM, TRAITS, START_VAL, ...) |
Helper for creating enum trait mappers. More... | |
#define | EVO_EXCEPTION_GUARD_END } catch (...) { abort(); } |
End exception guard, catch and abort(). More... | |
#define | EVO_EXCEPTION_GUARD_START try { |
Start exception guard (try block). More... | |
#define | EVO_FIXED_ARRAY_SIZE(ARRAY) (sizeof(evo::impl::FixedArraySizeHelper(ARRAY))) |
Get size of fixed-length array at compile-time. More... | |
Typedefs | |
typedef BitArrayT | BitArray |
Default dynamic bit array container – see BitArrayT. More... | |
typedef BitArraySubsetT< BitArray > | BitArraySubset |
Default subset of a BitArray – see BitArraySubsetT. More... | |
typedef FmtFloatT< float > | FmtFloat |
Explicitly format a floating pointer number. More... | |
typedef FmtFloatT< double > | FmtFloatD |
Explicitly format a floating pointer number. More... | |
typedef FmtFloatT< ldouble > | FmtFloatL |
Explicitly format a floating pointer number. More... | |
typedef FmtIntT< int > | FmtInt |
Explicitly format an integer. More... | |
typedef FmtIntT< int16 > | FmtInt16 |
Explicitly format an integer. More... | |
typedef FmtIntT< int32 > | FmtInt32 |
Explicitly format an integer. More... | |
typedef FmtIntT< int64 > | FmtInt64 |
Explicitly format an integer. More... | |
typedef FmtIntT< int8 > | FmtInt8 |
Explicitly format an integer. More... | |
typedef FmtIntT< long > | FmtLong |
Explicitly format an integer. More... | |
typedef FmtIntT< longl > | FmtLongL |
Explicitly format an integer. More... | |
typedef FmtIntT< short > | FmtShort |
Explicitly format an integer. More... | |
typedef FmtIntT< uint > | FmtUInt |
Explicitly format an integer. More... | |
typedef FmtIntT< uint16 > | FmtUInt16 |
Explicitly format an integer. More... | |
typedef FmtIntT< uint32 > | FmtUInt32 |
Explicitly format an integer. More... | |
typedef FmtIntT< uint64 > | FmtUInt64 |
Explicitly format an integer. More... | |
typedef FmtIntT< uint8 > | FmtUInt8 |
Explicitly format an integer. More... | |
typedef FmtIntT< ulong > | FmtULong |
Explicitly format an integer. More... | |
typedef FmtIntT< ulongl > | FmtULongL |
Explicitly format an integer. More... | |
typedef FmtIntT< ushort > | FmtUShort |
Explicitly format an integer. More... | |
typedef MapHash< String, String > | StrHash |
MapHash using String keys and values. More... | |
typedef String::ListBaseType | StringBase |
Base string typedef. More... | |
typedef MapList< String, String > | StrMapList |
MapList using String keys and values. More... | |
typedef SetHash< String > | StrSetHash |
SetHash using String values. More... | |
typedef SetList< String > | StrSetList |
SetList using String values. More... | |
typedef Var | VarList |
Alias for Var, useful for explicitly passing a list to a VarObject field value (C++11). More... | |
Enumerations | |
enum | CharBreakType { cbtOTHER = 0, cbtWSPACE, cbtQUOTE, cbtBEGIN, cbtEND, cbtWORD } |
Character break type returned by ascii_breaktype(). More... | |
enum | CharType { ctOTHER = 0, ctWSPACE, ctPUNCT, ctDIGIT, ctUPPER, ctLOWER } |
Character type returned by ascii_type(). More... | |
enum | FmtAlign { faCURRENT = 0, fLEFT, fCENTER, fRIGHT } |
Formatting alignment. More... | |
enum | FmtBase { fbCURRENT = 0, fbAUTO = 0, fBIN = 2, fOCT = 8, fDEC = 10, fHEX = 16, fHEXL = 116 } |
Formatting integer base. More... | |
enum | FmtBasePrefix { fbpCURRENT = 0, fPREFIX0, fPREFIX1, fPREFIX2 } |
Formatting integer base prefix type. More... | |
enum | FmtPrecision { fpCURRENT = -2, fPREC_AUTO = -1, fPREC0 = 0, fPREC1, fPREC2, fPREC3, fPREC4, fPREC5, fPREC6 } |
Formatting floating point precision type. More... | |
enum | FmtWidth { fWIDTH0 = 0 } |
Formatting field width. More... | |
enum | IteratorDir { iterNONE, iterFW, iterRV } |
Iterator direction value. More... | |
enum | IteratorPos { iterFIRST, iterLAST, iterEND } |
Iterator position value. More... | |
enum | StringSearchAlg { ssaDEFAULT =0, ssaKMP, ssaBASIC } |
String search algorithm selection. More... | |
enum | UtfMode { umINCLUDE_INVALID, umREPLACE_INVALID, umSKIP_INVALID, umSTRICT } |
UTF decoding mode used to set how to handle invalid character values. More... | |
Functions | |
CharBreakType | ascii_breaktype (char ch) |
Get ASCII character word-break type. More... | |
char | ascii_tolower (char ch) |
Convert ASCII character to lowercase. More... | |
char | ascii_toupper (char ch) |
Convert ASCII character to uppercase. More... | |
CharType | ascii_type (char ch) |
Get ASCII character type. More... | |
template<class T , uint sz> | |
static uint | fixed_array_size (T(&)[sz]) |
Get size of fixed-length array. More... | |
template<class T > | |
FmtTableOut< T, FmtTable::CachedWriter > | fmt_table (T &out, FmtTable &table, FmtTable::Type type=FmtTable::tTEXT) |
Create cached FmtTableOut paired with given string/stream to write to. More... | |
template<class T > | |
FmtTableOut< T, FmtTable::Writer > | fmt_table_nocache (T &out, FmtTable &table, FmtTable::Type type=FmtTable::tTEXT) |
Create cached FmtTableOut paired with given string/stream to write to. More... | |
template<class TMap > | |
SubString | lookupsub (const TMap &map, const typename TMap::Key &key) |
Lookup (find) map value as SubString for given key. More... | |
template<class T > | |
bool | map_contains (const T &map, const typename T::Key &key, const typename T::Value &value) |
Check whether map contains key with matching value. More... | |
template<class T > | |
bool | operator!= (const BitArraySubsetT< BitArrayT< T > > &a, const BitArrayT< T > &b) |
Inequality operator. More... | |
template<class T > | |
bool | operator== (const BitArraySubsetT< BitArrayT< T > > &a, const BitArrayT< T > &b) |
Equality operator. More... | |
template<class TMap > | |
const TMap::mapped_type * | stdlookup (const TMap &map, const typename TMap::key_type &key) |
Lookup (find) STL map value for given key (const). More... | |
template<class TMap > | |
TMap::mapped_type * | stdlookupM (TMap &map, const typename TMap::key_type &key) |
Lookup (find) STL map value for given key (mutable). More... | |
template<class TMap > | |
SubString | stdlookupsub (const TMap &map, const typename TMap::key_type &key) |
Lookup (find) STL map value as SubString for given key. More... | |
bool | str_scan_backtickdel (const char *str, const char *end) |
Scan string for a Backtick + DEL pair. More... | |
template<class T > | |
const char * | str_scan_decimal (T &num, const char *str, const char *end) |
Scan string pointer for decimal number and return stop pointer. More... | |
const char * | str_scan_delim (const char *str, const char *end, char delim1, char delim2) |
Scan string pointer for next delimiter and return stop pointer. More... | |
const char * | str_scan_delim (const char *str, const char *end, const char *delims, uint delim_count) |
Scan string pointer for next delimiter and return stop pointer. More... | |
const char * | str_scan_delim_r (const char *str, const char *end, char delim1, char delim2) |
Scan string pointer for next delimiter in reverse and return new end after stop pointer. More... | |
const char * | str_scan_delim_r (const char *str, const char *end, const char *delims, uint delim_count) |
Scan string pointer for next delimiter in reverse and return new end after stop pointer. More... | |
const char * | str_scan_endq (const char *&startq, const char *&endq, const char *str, const char *end) |
Scan string pointer and extract quoted or unquoted text. More... | |
const char * | str_scan_endq (const char *&startq, const char *&endq, const char *str, const char *end, char delim) |
Scan string pointer and extract quoted or unquoted text with a delimiter. More... | |
const char * | str_scan_endq (const char *&startq, const char *&endq, const char *str, const char *end, char delim1, char delim2) |
Scan string pointer and extract quoted or unquoted text with 2 possible delimiters. More... | |
const char * | str_scan_endq (const char *&startq, const char *&endq, const char *str, const char *end, const char *delims, uint delim_count, char ws_delim=0) |
Scan string pointer and extract quoted or unquoted text with multiple possible delimiters. More... | |
const char * | str_scan_endq_r (const char *&startq, const char *&endq, const char *str, const char *end, char delim) |
Scan string pointer in reverse and extract quoted or unquoted text with a delimiter and return new end after stop pointer. More... | |
const char * | str_scan_endq_r (const char *&startq, const char *&endq, const char *str, const char *end, const char *delims, uint delim_count, char ws_delim=0) |
Scan string pointer in reverse and extract quoted or unquoted text with multiple possible delimiters and return new end after stop pointer. More... | |
template<class T > | |
const char * | str_scan_hex (T &num, const char *str, const char *end) |
Scan string pointer for hex number and return stop pointer. More... | |
const char * | str_scan_ndelim (const char *str, const char *end, char delim1, char delim2) |
Scan string pointer for next non-delimiter and return stop pointer. More... | |
const char * | str_scan_ndelim_r (const char *str, const char *end, char delim1, char delim2) |
Scan string pointer for next non-delimiter in reverse and return new end after stop pointer. More... | |
const char * | str_scan_nws (const char *str, const char *end) |
Scan string pointer for next non-whitespace character and return stop pointer. More... | |
const char * | str_scan_nws (const char *str, const char *end, char delim) |
Scan string pointer for next delimiter or non-whitespace character and return stop pointer. More... | |
const char * | str_scan_nws_r (const char *str, const char *end) |
Scan string pointer for next non-whitespace character in reverse and return new end after stop pointer. More... | |
const char * | str_scan_nws_r (const char *str, const char *end, char delim) |
Scan string pointer for next delimiter or non-whitespace character and return stop pointer. More... | |
const char * | str_scan_to (uint maxlen, const char *str, const char *end, char ch) |
Scan string pointer for char and return stop pointer. More... | |
const char * | str_scan_to (uint maxlen, const char *str, const char *end, char ch1, char ch2) |
Scan string pointer for either of 2 chars and return stop pointer. More... | |
const char * | string_memrchr (const char *str, char ch, size_t size) |
Evo implementation of memrchr() to search for character in reverse. More... | |
int | utf16_compare (const wchar16 *str1, ulong len1, const wchar16 *str2, ulong len2) |
Compare two non-terminated UTF-16 strings. More... | |
int | utf16_compare (const wchar16 *str1, ulong len1, const wchar16 *str2) |
Compare a non-terminated UTF-16 string with a terminated UTF-16 string. More... | |
int | utf16_compare (const wchar16 *str1, const wchar16 *str2) |
Compare two terminated UTF-16 strings. More... | |
int | utf16_compare8 (const wchar16 *str1, ulong len1, const char *str2, ulong len2) |
Compare a non-terminated UTF-16 string to a non-terminated UTF-8 string. More... | |
int | utf16_compare8 (const wchar16 *str1, ulong len1, const char *str2) |
Compare a non-terminated UTF-16 string to a terminated UTF-8 string. More... | |
int | utf16_compare8 (const wchar16 *str1, const char *str2) |
Compare a terminated UTF-16 string to a terminated UTF-8 string. More... | |
ulong | utf16_count (const wchar16 *str, const wchar16 *end, UtfMode mode=umREPLACE_INVALID) |
Count Unicode character values in UTF-16 string. More... | |
const wchar16 * | utf16_min (const wchar16 *str, const wchar16 *end, bool strict=false, uint mincount=1) |
Scan for UTF-16 surrogate pairs, which each require a pair of wchar16 values (4 bytes). More... | |
const wchar16 * | utf16_scan (wchar32 &code, const wchar16 *str, const wchar16 *end, UtfMode mode=umREPLACE_INVALID) |
Scan for next Unicode character in UTF-16 string. More... | |
const wchar16 * | utf16_scan_term (wchar32 &code, const wchar16 *str, UtfMode mode=umREPLACE_INVALID) |
Scan for next Unicode character in terminated UTF-16 string. More... | |
ulong | utf16_strlen (const wchar16 *str) |
Find terminated UTF-16 string length. More... | |
ulong | utf16_to8 (const wchar16 *&str, const wchar16 *end, char *outbuf=NULL, ulong outsize=0, UtfMode mode=umREPLACE_INVALID) |
Convert UTF-16 string to UTF-8 string. More... | |
int | utf8_compare (const char *str1, ulong len1, const char *str2, ulong len2) |
Compare two non-terminated UTF-8 strings. More... | |
int | utf8_compare (const char *str1, ulong len1, const char *str2) |
Compare non-terminated and terminated UTF-8 strings. More... | |
int | utf8_compare (const char *str1, const char *str2) |
Compare two terminated UTF-8 strings. More... | |
ulong | utf8_count (const char *str, const char *end, UtfMode mode=umREPLACE_INVALID) |
Count Unicode character values in UTF-8 string. More... | |
const char * | utf8_min (const char *str, const char *end, bool strict=false, ulong mincount=1, uint minsize=2) |
Scan for UTF-8 multi-byte characters of at least minsize. More... | |
const char * | utf8_scan (wchar32 &code, const char *str, const char *end, UtfMode mode=umREPLACE_INVALID) |
Scan for next Unicode character in UTF-8 string. More... | |
const char * | utf8_scan_term (wchar32 &code, const char *str, UtfMode mode=umREPLACE_INVALID) |
Scan for next Unicode character in terminated UTF-8 string. More... | |
ulong | utf8_to16 (const char *&str, const char *end, wchar16 *outbuf=NULL, ulong outsize=0, UtfMode mode=umREPLACE_INVALID) |
Convert UTF-8 string to UTF-16 string. More... | |
Variables | |
static const wchar16 | UNICODE_REPLACEMENT_CHAR = 0xFFFD |
Unicode code point for "Replacement Character" used when decoding invalid UTF bytes or values. More... | |
Evo containers.
#define EVO_ENUM_CLASS_MAP | ( | ENUM, | |
... | |||
) |
Helper for creating enum class string/value mappers (C++11).
ENUM | Enum type to create mappings for |
... | Sorted list of string literals to map to each enum value – ex: "a", "b", "c" |
#define EVO_ENUM_CLASS_REMAP | ( | ENUM, | |
REMAP_ARRAY, | |||
... | |||
) |
Helper for creating enum class string/value mappers, with unsorted enum remapped to sorted values.
(C++11).
REMAP_ARRAY
to map an unsorted enum to sorted values – the data should be constant and staticENUM | Enum type to create mappings for |
REMAP_ARRAY | Pointer to array of ENUM values sorted so they match the sorted string literals that follow |
... | Sorted list of string literals to map to each enum value – ex: "a", "b", "c" |
#define EVO_ENUM_CLASS_TRAITS | ( | ENUM, | |
TRAITS, | |||
... | |||
) |
Helper for creating enum class trait mappers (C++11).
TRAITS
values mapped to enum valuesENUM | Enum type to create traits for |
TRAITS | Traits type to create for each enum value, usually named after ENUM with suffix Traits |
... | List of initializers for TRAITS values matching enum class values starting at ENUM::UNKNOWN |
#define EVO_ENUM_MAP | ( | ENUM, | |
FIRST_VAL, | |||
LAST_VAL, | |||
UNKNOWN_VAL, | |||
... | |||
) |
Helper for creating enum string/value mappers with explicit first/last/unknown values.
ENUM | Enum type to create traits for |
FIRST_VAL | First enum value to map to, maps to first string |
LAST_VAL | Last enum value to map to, maps to last string – must be >= first_enum |
UNKNOWN_VAL | Unknown enum value to use if key not found or result out of range |
... | Sorted list of string literals to map to each enum value – ex: "a", "b", "c" |
#define EVO_ENUM_MAP_PREFIXED | ( | ENUM, | |
PREFIX, | |||
... | |||
) | EVO_ENUM_MAP(ENUM, (ENUM)((int)(PREFIX ## UNKNOWN) + 1), (ENUM)((int)(PREFIX ## ENUM_END) - 1), PREFIX ## UNKNOWN, __VA_ARGS__) |
Helper for creating enum string/value mappers with prefixed enum values.
ENUM | Enum type to create mappings for |
PREFIX | Prefix for enum values, used to find UNKNOWN and ENUM_END values |
... | Sorted list of string literals to map to each enum value – ex: "a", "b", "c" |
#define EVO_ENUM_REMAP | ( | ENUM, | |
FIRST_VAL, | |||
LAST_VAL, | |||
UNKNOWN_VAL, | |||
REMAP_ARRAY, | |||
... | |||
) |
Helper for creating enum string/value mappers with explicit first/last/unknown values, with unsorted enum remapped to sorted values.
REMAP_ARRAY
to map an unsorted enum to sorted values – the data should be constant and staticENUM | Enum type to create traits for |
FIRST_VAL | First enum value to map to, maps to first string |
LAST_VAL | Last enum value to map to, maps to last string – must be >= first_enum |
UNKNOWN_VAL | Unknown enum value to use if key not found or result out of range |
REMAP_ARRAY | Pointer to array of ENUM values sorted so they match the sorted string literals that follow |
... | Sorted list of string literals to map to each enum value – ex: "a", "b", "c" |
#define EVO_ENUM_REMAP_PREFIXED | ( | ENUM, | |
PREFIX, | |||
REMAP_ARRAY, | |||
... | |||
) | EVO_ENUM_REMAP(ENUM, (ENUM)((int)(PREFIX ## UNKNOWN) + 1), (ENUM)((int)(PREFIX ## ENUM_END) - 1), PREFIX ## UNKNOWN, REMAP_ARRAY, __VA_ARGS__) |
Helper for creating enum string/value mappers with prefixed enum values, with unsorted enum remapped to sorted values.
REMAP_ARRAY
to map an unsorted enum to sorted values – the data should be constant and staticENUM | Enum type to create mappings for |
PREFIX | Prefix for enum values, used to find UNKNOWN and ENUM_END values |
REMAP_ARRAY | Pointer to array of ENUM values sorted so they match the sorted string literals that follow |
... | Sorted list of string literals to map to each enum value – ex: "a", "b", "c" |
#define EVO_ENUM_TRAITS | ( | ENUM, | |
TRAITS, | |||
START_VAL, | |||
... | |||
) |
Helper for creating enum trait mappers.
TRAITS
values mapped to enum valuesENUM | Enum type to create traits for |
TRAITS | Traits type to create for each enum value, usually named after ENUM with suffix Traits |
START_VAL | Start enum value used as the starting point of enum values – usually this is the "UNKNOWN" enum value |
... | List of initializers for TRAITS values matching enum values starting at START_VAL |
#define EVO_EXCEPTION_GUARD_END } catch (...) { abort(); } |
End exception guard, catch and abort().
#define EVO_EXCEPTION_GUARD_START try { |
Start exception guard (try block).
#define EVO_FIXED_ARRAY_SIZE | ( | ARRAY | ) | (sizeof(evo::impl::FixedArraySizeHelper(ARRAY))) |
Get size of fixed-length array at compile-time.
typedef BitArraySubsetT<BitArray> BitArraySubset |
Default subset of a BitArray – see BitArraySubsetT.
Explicitly format a floating pointer number.
Example using FmtFloat
Explicitly format a floating pointer number.
Example using FmtFloat
Explicitly format a floating pointer number.
Example using FmtFloat
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
Explicitly format an integer.
Example using FmtInt
typedef String::ListBaseType StringBase |
Base string typedef.
typedef MapList<String,String> StrMapList |
typedef SetHash<String> StrSetHash |
typedef SetList<String> StrSetList |
enum CharBreakType |
Character break type returned by ascii_breaktype().
enum CharType |
Character type returned by ascii_type().
enum FmtAlign |
Formatting alignment.
enum FmtBase |
Formatting integer base.
enum FmtBasePrefix |
Formatting integer base prefix type.
enum FmtPrecision |
Formatting floating point precision type.
enum FmtWidth |
Formatting field width.
Enumerator | |
---|---|
fWIDTH0 |
enum IteratorDir |
enum IteratorPos |
enum StringSearchAlg |
enum UtfMode |
UTF decoding mode used to set how to handle invalid character values.
Enumerator | |
---|---|
umINCLUDE_INVALID | Include invalid characters – try to use as-is (dangerous) |
umREPLACE_INVALID | Replace invalid characters with UNICODE_REPLACEMENT_CHAR. |
umSKIP_INVALID | Skip invalid characters. |
umSTRICT | Stop or error on invalid character. |
|
inline |
Get ASCII character word-break type.
ch | Character to check |
|
inline |
Convert ASCII character to lowercase.
ch | Character to check |
|
inline |
Convert ASCII character to uppercase.
ch | Character to check |
|
inline |
Get ASCII character type.
ch | Character to check |
|
static |
Get size of fixed-length array.
|
inline |
Create cached FmtTableOut paired with given string/stream to write to.
<< fFLUSH
then to let the destructor flush and possibly throwT | String/Stream type to use, inferred from out argument |
out | Output string/stream to write to |
table | FmtTable instance to use for column information |
type | Output type to use – see FmtTable::Type |
|
inline |
Create cached FmtTableOut paired with given string/stream to write to.
table
T | String/Stream type to use, inferred from out argument |
out | Output string/stream to write to |
table | FmtTable instance to use for column information |
type | Output type to use – see FmtTable::Type |
|
inline |
Lookup (find) map value as SubString for given key.
TMap | Evo Map container |
map | Map to use |
key | Key to find |
|
inline |
Check whether map contains key with matching value.
operator==()
T | Map type, inferred from arg |
map | Map to check |
key | Key to check |
value | Value to check for |
|
inline |
Inequality operator.
a | First subset to compare |
b | Second subset to compare |
|
inline |
Equality operator.
a | First subset to compare |
b | Second subset to compare |
|
inline |
Lookup (find) STL map value for given key (const).
TMap | STL map container |
map | Map to use |
key | Key to find |
|
inline |
Lookup (find) STL map value for given key (mutable).
TMap | STL map container |
map | Map to use |
key | Key to find |
|
inline |
Lookup (find) STL map value as SubString for given key.
TMap | STL map container |
map | Map to use |
key | Key to find |
|
inline |
Scan string for a Backtick + DEL pair.
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
|
inline |
Scan string pointer for decimal number and return stop pointer.
num | Stores parsed number (not reset to 0) [in/out] |
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
|
inline |
Scan string pointer for next delimiter and return stop pointer.
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
delim1 | First delimiter to recognize |
delim2 | Second delimiter to recognize |
end
if whole string was scanned, otherwise this points to the next delimiter
|
inline |
Scan string pointer for next delimiter and return stop pointer.
delim_count > 16
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
delims | Delimiters to scan for |
delim_count | Number of delimiter to scan for, must not be 0 |
end
if whole string was scanned, otherwise this points to the next delimiter
|
inline |
Scan string pointer for next delimiter in reverse and return new end after stop pointer.
end
pointer, which points to the character after a delimiterstr | String pointer to scan, must not be NULL |
end | End pointer to stop scanning, must be >= str |
delim1 | First delimiter to recognize |
delim2 | Second delimiter to recognize |
str
if whole string was scanned, otherwise this points to the next char after a delimiter
|
inline |
Scan string pointer for next delimiter in reverse and return new end after stop pointer.
end
pointer, which points to the character after a delimiterdelim_count > 16
str | String pointer to scan, must not be NULL |
end | End pointer to stop scanning, must be >= str |
delims | Delimiters to scan for |
delim_count | Number of delimiter to scan for, must not be 0 |
str
if whole string was scanned, otherwise this points to the next char after a delimiter
|
inline |
Scan string pointer and extract quoted or unquoted text.
startq | Set to start of quoted text (without quote chars) [out] |
endq | Set to end of quoted text (without quote chars) [out] |
str | String pointer to scan, must not be null |
end | Pointer to stop scanning, must be >= str |
end
if whole string was scanned
|
inline |
Scan string pointer and extract quoted or unquoted text with a delimiter.
startq | Set to start of quoted text (without quote chars), same as str if unquoted [out] |
endq | Set to end of quoted text (without quote chars) [out] |
str | String pointer to scan, must not be null |
end | Pointer to stop scanning, must be >= str |
delim | Delimiter that ends the quoted text, may be a whitespace char (space, tab, newline) |
end
if whole string was scanned, otherwise this will point to a delim
|
inline |
Scan string pointer and extract quoted or unquoted text with 2 possible delimiters.
startq | Set to start of quoted text (without quote chars) [out] |
endq | Set to end of quoted text (without quote chars) [out] |
str | String pointer to scan, must not be null |
end | Pointer to stop scanning, must be >= str |
delim1 | Delimiter that may end the quoted text, must not be a whitespace character (space, tab, newline) |
delim2 | Another delimiter that may end the quoted text, must not be a whitespace character (space, tab, newline) |
end
if whole string was scanned, otherwise this will point to a delim
|
inline |
Scan string pointer and extract quoted or unquoted text with multiple possible delimiters.
delim_count > 16
startq | Set to start of quoted text (without quote chars) [out] |
endq | Set to end of quoted text (without quote chars) [out] |
str | String pointer to scan, must not be null |
end | Pointer to stop scanning, must be >= str |
delims | Delimiters that may end the quoted text, if this contains a whitespace char (space, tab, newline) then ws_delim must be set too – more than 1 whitespace delimiter is not supported |
delim_count | Number of delimiters in delims , must be greater than 0 |
ws_delim | Use to specify a whitespace delimiter in delims , 0 if no whitespace delim – this is used to handle whitespace correctly between an end-quote and a delimiter |
end
if whole string was scanned, otherwise this will point to a delim
|
inline |
Scan string pointer in reverse and extract quoted or unquoted text with a delimiter and return new end after stop pointer.
end
pointer, which points to the character after a delimiterstartq | Set to start of quoted text (without quote chars) [out] |
endq | Set to end of quoted text (without quote chars), same as end if unquoted [out] |
str | String beginning pointer to stop scan, must not be null |
end | End pointer to start scanning in reverse, must be >= str |
delim | Delimiter that ends the quoted text, may be a whitespace char (space, tab, newline) |
str
if whole string was scanned, otherwise this points to the next char after a delimiter
|
inline |
Scan string pointer in reverse and extract quoted or unquoted text with multiple possible delimiters and return new end after stop pointer.
end
pointer, which points to the character after a delimiterdelim_count > 16
startq | Set to start of quoted text (without quote chars) [out] |
endq | Set to end of quoted text (without quote chars), same as end if unquoted [out] |
str | String beginning pointer to stop scan, must not be null |
end | End pointer to start scanning in reverse, must be >= str |
delims | Delimiters that may end the quoted text, if this contains a whitespace char (space, tab, newline) then ws_delim must be set too – more than 1 whitespace delimiter is not supported |
delim_count | Number of delimiters in delims , must be greater than 0 |
ws_delim | Use to specify a whitespace delimiter in delims , 0 if no whitespace delim – this is used to handle whitespace correctly between an end-quote and a delimiter |
str
if whole string was scanned, otherwise this points to the next char after a delimiter
|
inline |
Scan string pointer for hex number and return stop pointer.
num | Stores parsed number (not reset to 0) [in/out] |
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
|
inline |
Scan string pointer for next non-delimiter and return stop pointer.
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
delim1 | First delimiter to recognize |
delim2 | Second delimiter to recognize |
end
if whole string was scanned, otherwise this points to the next non-delimiter character
|
inline |
Scan string pointer for next non-delimiter in reverse and return new end after stop pointer.
end
pointer, which points to the character after a non-delimiterstr | String pointer to scan, must not be NULL |
end | End pointer to stop scanning, must be >= str |
delim1 | First delimiter to recognize |
delim2 | Second delimiter to recognize |
str
if whole string was scanned, otherwise this points to the next char after a non-delimiter
|
inline |
Scan string pointer for next non-whitespace character and return stop pointer.
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
end
if whole string was scanned, otherwise this points to the next non-whitespace character
|
inline |
Scan string pointer for next delimiter or non-whitespace character and return stop pointer.
delim
is itself a whitespace characterstr | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
delim | Delimiter to stop at, which may be a whitespace character |
end
if whole string was scanned, otherwise this points to the next non-whitespace character
|
inline |
Scan string pointer for next non-whitespace character in reverse and return new end after stop pointer.
end
pointer, which points to the character after a non-whitespacestr | String pointer to scan, must not be NULL |
end | End pointer to stop scanning, must be >= str |
str
if whole string was scanned, otherwise this points to the next char after a non-whitespace character
|
inline |
Scan string pointer for next delimiter or non-whitespace character and return stop pointer.
delim
is itself a whitespace characterstr | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
delim | Delimiter to stop at, which may be a whitespace character |
end
if whole string was scanned, otherwise this points to the next non-whitespace character
|
inline |
Scan string pointer for char and return stop pointer.
maxlen | Max allowed length to scan before returning an error, ignored if 0 |
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
ch | Char to scan for |
end
if whole string was scanned, NULL if maxlen
exceeded and ch
not found within maxlen
|
inline |
Scan string pointer for either of 2 chars and return stop pointer.
maxlen | Max allowed length to scan before returning an error, ignored if 0 |
str | String pointer to scan, must not be NULL |
end | Pointer to stop scanning, must be >= str |
ch1 | First char to scan for |
ch2 | Second char to scan for |
end
if whole string was scanned, NULL if maxlen exceeded
|
inline |
Evo implementation of memrchr() to search for character in reverse.
NULL
if not foundmemrchr()
(GNU C extension) when possible, otherwise this falls back to an equivalent implementationstr | String pointer to search |
ch | Character to search for |
size | String size to search, search starts at the end |
ch
, NULL if not found
|
inline |
Compare two non-terminated UTF-16 strings.
str1 | First string to compare, must not be NULL |
len1 | First string length |
str2 | Second string to compare, must not be NULL |
len2 | Second string length |
|
inline |
Compare a non-terminated UTF-16 string with a terminated UTF-16 string.
str1 | First string to compare, must not be NULL |
len1 | First string length |
str2 | Second string to compare, must be terminated, must not be NULL |
|
inline |
Compare two terminated UTF-16 strings.
str1 | First string to compare, must be terminated, must not be NULL |
str2 | Second string to compare, must be terminated, must not be NULL |
|
inline |
Compare a non-terminated UTF-16 string to a non-terminated UTF-8 string.
str1 | First string to compare, must not be NULL |
len1 | First string length |
str2 | Second string to compare, must not be NULL |
len2 | Second string length |
|
inline |
Compare a non-terminated UTF-16 string to a terminated UTF-8 string.
str1 | First string to compare, must not be NULL |
len1 | First string length |
str2 | Second string to compare, must be terminated, must not be NULL |
|
inline |
Compare a terminated UTF-16 string to a terminated UTF-8 string.
str1 | First string to compare, must be terminated, must not be NULL |
str2 | Second string to compare, must be terminated, must not be NULL |
|
inline |
Count Unicode character values in UTF-16 string.
str | Pointer to string to scan, must not be NULL |
end | Pointer to end of string to scan, must be >= str |
mode | How to handle invalid UTF-16 values:
|
|
inline |
Scan for UTF-16 surrogate pairs, which each require a pair of wchar16 values (4 bytes).
str | Pointer to string to search, must not be NULL |
end | Pointer to end of string to scan, must be >= str |
strict | Whether to stop counting on invalid UTF-16 value, false to skip/ignore invalid UTF-16 values |
mincount | Minimum number of surrogate pairs to look for, must be positive |
mincount
surrogate pairs found
|
inline |
Scan for next Unicode character in UTF-16 string.
code | Set to full Unicode character code scanned, or error code on error (see return value) [out] |
str | Pointer to string to scan, must not be ULL |
end | Pointer to end of string to scan |
mode | How to handle invalid UTF-16 values:
|
|
inline |
Scan for next Unicode character in terminated UTF-16 string.
code | Set to full Unicode character code scanned, or error code on error (see return value) [out] |
str | Pointer to string to scan, muts be terminated, must not be ULL |
mode | How to handle invalid UTF-16 values:
|
|
inline |
Find terminated UTF-16 string length.
str | Pointer to string, must be NULL terminated, NULL for none |
|
inline |
Convert UTF-16 string to UTF-8 string.
str | Pointer to input UTF-16 string to convert, set to stopping point on return, must not be NULL [in/out] |
end | Pointer to stop input at (end of input, exclusive), must be >= str |
outbuf | Output buffer to write UTF-8 string to, NULL to scan without writing |
outsize | Output buffer size in bytes, ignored if outbuf=NULL |
mode | How to handle invalid UTF-16 values:
|
|
inline |
Compare two non-terminated UTF-8 strings.
str1 | First string to compare, can be NULL |
len1 | First string length |
str2 | Second string to compare, can be NULL |
len2 | Second string length |
|
inline |
Compare non-terminated and terminated UTF-8 strings.
str1 | First string to compare, can be NULL |
len1 | First string length |
str2 | Second string to compare, must be terminated, can be NULL |
|
inline |
Compare two terminated UTF-8 strings.
str1 | First string to compare, must be terminated, can be NULL |
str2 | Second string to compare, must be terminated, can be NULL |
|
inline |
Count Unicode character values in UTF-8 string.
str | Pointer to string to scan, must not be NULL |
end | Pointer to end of string to scan, must be >= str |
mode | How to handle invalid UTF-8 bytes:
|
|
inline |
Scan for UTF-8 multi-byte characters of at least minsize.
minsize
to set the multi-byte characters to stop at – character sizes smaller than this are ignoredstr | Pointer to string to search, must not be NULL |
end | Pointer to end of string to scan, must be >= str |
strict | Whether to stop counting on invalid UTF-8 byte, false to skip/ignore invalid UTF-8 bytes |
mincount | Minimum number of multi-byte values to look for, must be positive |
minsize | Minimum number of bytes to count as multi-byte value, must be 2-4 (inclusive) |
|
inline |
Scan for next Unicode character in UTF-8 string.
code | Set to full Unicode character code scanned, or error code on error (see return value) [out] |
str | Pointer to string to scan, must not be NULL |
end | Pointer to end of string to scan, must be >= str |
mode | How to handle invalid UTF-8 bytes:
|
|
inline |
Scan for next Unicode character in terminated UTF-8 string.
code | Set to full Unicode character code scanned, or error code on error (see return value) [out] |
str | Pointer to string to scan, must be terminated, must not be NULL |
mode | How to handle invalid UTF-8 bytes:
|
|
inline |
Convert UTF-8 string to UTF-16 string.
str | Pointer to input UTF-8 string to convert, set to stopping point on return, must not be NULL [in/out] |
end | Pointer to stop input at (end of input, exclusive) |
outbuf | Output buffer to write UTF-16 string to, NULL to scan without writing |
outsize | Output buffer size as wchar16 count (not bytes), ignored if outbuf=NULL |
mode | How to handle invalid UTF-8 bytes and values that convert to reserved UTF-16 surrogate values:
|
|
static |
Unicode code point for "Replacement Character" used when decoding invalid UTF bytes or values.