|
Evo C++ Library v0.5.1
|
#include <evo/substring.h>

Reference and access existing string data.
Use to explictly reference string data, split/tokenize string data, and to convert to other types.
string_view from C++17C++11:
Note: Including this automatically includes evo/string.h too
Output:
Public Types | |
| typedef void | EvoContainerType |
| Identify Evo container type. More... | |
| typedef char | Item |
| Item type (same as Value) More... | |
| typedef DataCopy< char >::PassType | ItemVal |
| Item type as parameter (POD types passed by value, otherwise by const-ref) More... | |
| typedef IteratorRa< ThisType >::Const | Iter |
| Iterator (const) - IteratorRa. More... | |
| typedef Size | Key |
| Key type (item index) More... | |
| typedef ListBase< char, Size > | ListBaseType |
| List base type for any Evo list More... | |
| typedef StrSizeT | Size |
| List size integer type. More... | |
| typedef ListBaseType | StringBase |
| Alias for ListBaseType. More... | |
| typedef SubList< char, Size > | SubListType |
| SubList base type More... | |
| typedef SubString | ThisType |
| This string type. More... | |
| typedef char | Value |
| Value type (same as Item) More... | |
Public Member Functions | |
| SubString () | |
| Default constructor sets as null. More... | |
| SubString (const ThisType &str) | |
| Copy constructor. More... | |
| SubString (const StringBase &str) | |
| Copy constructor. More... | |
| SubString (const StringBase &str, Key index, Size size=ALL) | |
| Copy constructor. More... | |
| SubString (const StringBase *str) | |
| Copy constructor. More... | |
| SubString (const char *data, Size size) | |
| Constructor to reference string data. More... | |
| SubString (const char *data) | |
| Constructor to reference terminated string. More... | |
| SubString (SubString &&src) | |
| Move constructor (C++11). More... | |
| const SubString & | asconst () const |
| Explicitly use a const reference to this. More... | |
| Iter | begin () const |
| Get iterator at first item (const). More... | |
| Bool | boolval () const |
| Convert to bool value. More... | |
| Iter | cbegin () const |
| Get iterator at first item (const). More... | |
| Iter | cend () const |
| Get iterator at end (const). More... | |
| SubString & | clear () |
| Clear by removing all items. More... | |
| template<class T > | |
| int | compare (const ListBase< wchar16, T > &str) |
| Comparison against UTF-16 string. More... | |
| int | compare (const StringBase &data) const |
| Comparison. More... | |
| bool | contains (ItemVal item) const |
| Check whether contains given item. More... | |
| bool | contains (char ch) const |
| Check whether this contains given character. More... | |
| bool | contains (const char *str, Size size) const |
| Check whether this contains given string. More... | |
| bool | contains (const StringBase &str) const |
| Check whether contains given string. More... | |
| template<class C > | |
| C | convert () const |
| Convert string to value of given type. More... | |
| template<class C > | |
| SubString & | convert_set (C value) |
| Convert value to string, replacing current string. More... | |
| const char * | cstr (String &buffer) const |
| Get terminated string pointer, using given string buffer if needed (const). More... | |
| const char * | data () const |
| Get data pointer. More... | |
| bool | empty () const |
| Get whether empty. More... | |
| Iter | end () const |
| Get iterator at end (const). More... | |
| bool | ends (ItemVal item) const |
| Check if this ends with given item. More... | |
| bool | ends (const Item *items, Size size) const |
| Check if this ends with given items. More... | |
| bool | ends (const ListBaseType &items) const |
| Check if this ends with given items. More... | |
| bool | ends (const char *str) const |
| Check if ends with given terminated string. More... | |
| Key | find (char ch) const |
| Find first occurrence of character with forward search. More... | |
| Key | find (char ch, Key start, Key end=END) const |
| Find first occurrence of character with forward search. More... | |
| Key | find (const char *pattern, uint pattern_size, Key start=0, Key end=END) const |
| Find first occurrence of pattern string. More... | |
| Key | find (StringSearchAlg alg, const char *pattern, uint pattern_size, Key start=0, Key end=END) const |
| Find first occurrence of pattern string using specified algorithm. More... | |
| Key | find (const StringBase &pattern, Key start=0, Key end=END) const |
| Find first occurrence of pattern string. More... | |
| Key | find (StringSearchAlg alg, const StringBase &pattern, Key start=0, Key end=END) const |
| Find first occurrence of pattern string using specified algorithm. More... | |
| Key | find (ItemVal item, Key start, Key end) const |
| Find first occurrence of item with forward search. More... | |
| Key | findany (const char *chars, Size count, Key start=0, Key end=END) const |
| Find first occurrence of any given characters with forward search. More... | |
| Key | findany (const StringBase &chars, Key start=0, Key end=END) const |
| Find first occurrence of any given characters with forward search. More... | |
| Key | findany (const char *items, Size count, Key start, Key end) const |
| Find first occurrence of any given items with forward search. More... | |
| Key | findanybut (const char *chars, Size count, Key start=0, Key end=END) const |
| Find first occurrence of any character not listed with forward search. More... | |
| Key | findanybut (const StringBase &chars, Key start=0, Key end=END) const |
| Find first occurrence of any character not listed with forward search. More... | |
| Key | findanybutr (const char *chars, Size count, Key start=0, Key end=END) const |
| Find last occurrence of any character not listed with reverse search. More... | |
| Key | findanybutr (const StringBase &chars, Key start=0, Key end=END) const |
| Find last occurrence of any character not listed with reverse search. More... | |
| Key | findanyr (const char *chars, Size count, Key start=0, Key end=END) const |
| Find last occurrence of any given characters with reverse search. More... | |
| Key | findanyr (const StringBase &chars, Key start=0, Key end=END) const |
| Find last occurrence of any given characters with reverse search. More... | |
| Key | findanyr (const char *items, Size count, Key start, Key end) const |
| Find last occurrence of any given items with reverse search. More... | |
| Key | findnonword (Key start=0, Key end=END) const |
| Find first non-word word character. More... | |
| Key | findnonwordr (Key start=0, Key end=END) const |
| Find last non-word character with reverse search. More... | |
| Key | findr (char ch) const |
| Find last occurrence of character with reverse search. More... | |
| Key | findr (char ch, Key start, Key end=END) const |
| Find last occurrence of character with reverse search. More... | |
| Key | findr (const char *pattern, uint pattern_size, Key start=0, Key end=END) const |
| Find last occurrence of pattern string with reverse search. More... | |
| Key | findr (StringSearchAlg alg, const char *pattern, uint pattern_size, Key start=0, Key end=END) const |
| Find last occurrence of pattern string with reverse search. More... | |
| Key | findr (const StringBase &pattern, Key start=0, Key end=END) const |
| Find last occurrence of pattern string with reverse search. More... | |
| Key | findr (StringSearchAlg alg, const StringBase &pattern, Key start=0, Key end=END) const |
| Find last occurrence of pattern string with reverse search. More... | |
| Key | findr (ItemVal item, Key start, Key end) const |
| Find last occurrence of item with reverse search. More... | |
| Key | findword (Key start=0, Key end=END) const |
| Find first word character. More... | |
| Key | findwordr (Key start=0, Key end=END) const |
| Find last word character with reverse search. More... | |
| const char * | first () const |
| Get first item (const). More... | |
| bool | getbool (Error &error) const |
| Convert to bool value for given boolean type. More... | |
| template<class T > | |
| T | getbool () const |
| Convert to bool value for given boolean type. More... | |
| template<class T > | |
| T | getnum (Error &error, int base=0) const |
| Convert to number value for given integer type. More... | |
| template<class T > | |
| T | getnum (int base=0) const |
| Convert to number value for given integer type. More... | |
| template<class T > | |
| T | getnumf (Error &error) const |
| Convert to floating point number value for given type. More... | |
| template<class T > | |
| T | getnumf () const |
| Convert to floating point number value for given type. More... | |
| ulong | hash (ulong seed) const |
| Get data hash value. More... | |
| Key | iend (Size offset) const |
| Get index from last item using offset. More... | |
| const char & | item (Key index) const |
| Get item at position. More... | |
| const char * | last () const |
| Get last item (const). More... | |
| bool | null () const |
| Get whether null. More... | |
| Int | num (int base=0) const |
| Convert to number value (signed). More... | |
| Float | numf () const |
| Convert to number value (floating point). More... | |
| FloatD | numfd () const |
| Convert to number value (double floating point). More... | |
| FloatL | numfl () const |
| Convert to number value (ldouble floating point). More... | |
| Long | numl (int base=0) const |
| Convert to number value (signed long). More... | |
| LongL | numll (int base=0) const |
| Convert to number value (signed long-long). More... | |
| UInt | numu (int base=0) const |
| Convert to number value (unsigned). More... | |
| ULong | numul (int base=0) const |
| Convert to number value (unsigned long). More... | |
| ULongL | numull (int base=0) const |
| Convert to number value (unsigned long-long). More... | |
| template<class T > | |
| bool | operator!= (const ListBase< wchar16, T > &str) |
| Inequality operator to compare against UTF-16 string. More... | |
| bool | operator!= (const char *str) const |
| Inequality operator. More... | |
| bool | operator!= (const StringBase &data) const |
| Inequality operator. More... | |
| SubString & | operator= (SubString &&src) |
| Move assignment operator (C++11). More... | |
| SubString & | operator= (const SubString &src) |
| Assignment operator. More... | |
| SubString & | operator= (const StringBase &data) |
| Assignment operator sets as reference to source data. More... | |
| SubString & | operator= (const StringBase *data) |
| Assignment operator sets as reference to source data from pointer. More... | |
| SubString & | operator= (const char *data) |
| Assignment operator sets as reference to terminated string. More... | |
| SubString & | operator= (const ValNull &val) |
| Assignment operator sets as null. More... | |
| SubString & | operator= (const ValEmpty &val) |
| Assignment operator sets as null. More... | |
| template<class T > | |
| bool | operator== (const ListBase< wchar16, T > &str) |
| Equality operator to compare against UTF-16 string. More... | |
| bool | operator== (const char *str) const |
| Equality operator. More... | |
| bool | operator== (const StringBase &data) const |
| Equality operator. More... | |
| const char & | operator[] (Key index) const |
| Get item at position. More... | |
| SubString & | set (const char *data) |
| Set as reference to terminated string. More... | |
| SubString & | set () |
| Set as null. More... | |
| SubString & | set (const StringBase &data) |
| Set as reference to source data. More... | |
| SubString & | set (const StringBase &data, Key index, Key size=ALL) |
| Set as reference to source data. More... | |
| SubString & | set (const StringBase *data) |
| Set as reference to source data by pointer. More... | |
| SubString & | set (const char *data, Size size) |
| Set as reference to data pointer. More... | |
| SubString & | set2 (const StringBase &data, Key index1, Key index2) |
| Set as reference to subset of source data using start/end positions. More... | |
| SubString & | setempty () |
| Set as empty but not null. More... | |
| bool | shared () const |
| Get whether shared (false). More... | |
| Size | size () const |
| Get size. More... | |
| SubString & | slice (Key index) |
| Slice beginning items. More... | |
| SubString & | slice (Key index, Size size) |
| Slice to given subset. More... | |
| SubString & | slice2 (Key index1, Key index2) |
| Slice to given subset using start/end positions. More... | |
| template<class T1 , class T2 > | |
| bool | split (char delim, T1 &left, T2 &right) const |
| Split at first occurrence of delimiter into left/right substrings. More... | |
| template<class T1 > | |
| bool | split (char delim, T1 &left) const |
| Split at first occurrence of delimiter into left substring. More... | |
| template<class T2 > | |
| bool | split (char delim, ValNull left, T2 &right) const |
| Split at first occurrence of delimiter into right substring. More... | |
| template<class Tok , class C > | |
| C::Size | split (C &items, char delim=',') const |
| Split delimited string into item list using given tokenizer. More... | |
| template<class T1 , class T2 > | |
| bool | splitat (Key index, T1 &left, T2 &right) const |
| Split into left/right sublists at index. More... | |
| template<class T1 > | |
| bool | splitat (Key index, T1 &left) const |
| Split into left sublist at index. More... | |
| template<class T2 > | |
| bool | splitat (Key index, ValNull left, T2 &right) const |
| Split into right sublist at index. More... | |
| bool | splitat_setl (Key index) |
| Split at index and set as left sublist. More... | |
| template<class T2 > | |
| bool | splitat_setl (Key index, T2 &right) |
| Split at index, set as left sublist, and save right sublist. More... | |
| bool | splitat_setr (Key index) |
| Split at index and set as right sublist. More... | |
| template<class T1 > | |
| bool | splitat_setr (Key index, T1 &left) |
| Split at index, set as right sublist, and save left sublist. More... | |
| template<class T1 , class T2 > | |
| bool | splitr (char delim, T1 &left, T2 &right) const |
| Split at last occurrence of delimiter into left/right substrings. More... | |
| template<class T1 > | |
| bool | splitr (char delim, T1 &left) const |
| Split at last occurrence of delimiter into left substring. More... | |
| template<class T2 > | |
| bool | splitr (char delim, ValNull left, T2 &right) const |
| Split at last occurrence of delimiter into right substring. More... | |
| bool | starts (ItemVal item) const |
| Check if this starts with given item. More... | |
| bool | starts (const Item *items, Size size) const |
| Check if starts with given items. More... | |
| bool | starts (const ListBaseType &items) const |
| Check if this starts with given items. More... | |
| bool | starts (const char *str) const |
| Check if starts with given terminated string. More... | |
| SubString & | strip () |
| Strip left (beginning) and right (ending) whitespace (spaces and tabs). More... | |
| SubString & | strip (char ch) |
| Strip left (beginning) and right (ending) occurences of character. More... | |
| SubString & | strip2 () |
| Strip left (beginning) and right (ending) whitespace from string, including newlines. More... | |
| SubString & | strip_newlines () |
| Strip left (beginning) and right (ending) newlines from string. More... | |
| SubString & | stripl () |
| Strip left (beginning) whitespace (spaces and tabs). More... | |
| SubString & | stripl (char ch, Size max=ALL) |
| Strip left (beginning) occurrences of character. More... | |
| SubString & | stripl (const char *str, Size strsize, Size max=ALL) |
| Strip left (beginning) occurrences of string. More... | |
| SubString & | stripl2 () |
| Strip left (beginning) whitespace from string, including newlines. More... | |
| SubString & | stripl_newlines () |
| Strip all left (beginning) newlines from string. More... | |
| SubString & | stripl_newlines (Size max) |
| Strip left (beginning) newlines from string. More... | |
| SubString & | stripr () |
| Strip right (ending) whitespace (spaces and tabs). More... | |
| SubString & | stripr (char ch, Size max=ALL) |
| Strip right (ending) occurences of character. More... | |
| SubString & | stripr (const char *str, Size strsize, Size max=ALL) |
| Strip right (ending) occurences of string. More... | |
| SubString & | stripr2 () |
| Strip right (ending) whitespace (including newlines) from string. More... | |
| SubString & | stripr_newlines () |
| Strip all right (ending) newlines from string. More... | |
| SubString & | stripr_newlines (Size max) |
| Strip right (ending) newlines from string. More... | |
| void | swap (ThisType &list) |
| Swap with another sublist. More... | |
| void | swap (StringBase &list) |
| Swap with another sublist. More... | |
| template<class StringT > | |
| bool | token (StringT &value, char delim) |
| Extract next token from string. More... | |
| template<class StringT > | |
| bool | token_any (StringT &value, Char &found_delim, const char *delims, Size count) |
| Extract next token from string using any of given delimiters. More... | |
| template<class StringT > | |
| bool | token_line (StringT &line) |
| Extract next line from string. More... | |
| template<class StringT > | |
| bool | tokenr (StringT &value, char delim) |
| Extract next token from string in reverse (from end of string). More... | |
| template<class StringT > | |
| bool | tokenr_any (StringT &value, Char &found_delim, const char *delims, Size count) |
| Extract next token from string in reverse (from end of string) using any of given delimiters. More... | |
| template<class StringT > | |
| bool | tokenr_line (StringT &line) |
| Extract next line from string in reverse (from end of string). More... | |
| SubString & | triml (Size size) |
| Trim left (beginning) items. More... | |
| SubString & | trimr (Size size) |
| Trim right (ending) items. More... | |
| SubString & | truncate (Size size) |
| Truncate to given size. More... | |
| SubString & | unshare () |
| Make data unique – no-op. More... | |
Public Attributes | |
| char * | data_ |
| Data pointer, NULL if null. More... | |
| StrSizeT | size_ |
| Data size as item count, 0 if empty or null. More... | |
|
inherited |
Identify Evo container type.
|
inherited |
Item type (same as Value)
Item type as parameter (POD types passed by value, otherwise by const-ref)
|
inherited |
Iterator (const) - IteratorRa.
|
inherited |
List base type for any Evo list
| typedef ListBaseType StringBase |
Alias for ListBaseType.
|
inherited |
SubList base type
|
inherited |
Value type (same as Item)
|
inline |
Default constructor sets as null.
Copy constructor.
| str | String to copy |
|
inline |
Copy constructor.
| str | String to copy |
|
inline |
Copy constructor.
| str | String to reference |
| index | Start index of string to reference, END to set as empty |
| size | Size as item count, ALL for all from index |
|
inline |
Copy constructor.
| str | Pointer to string to copy, NULL to set as null |
Constructor to reference string data.
| data | String data to reference |
| size | String size in bytes |
|
inline |
Constructor to reference terminated string.
| data | String data to reference – must be terminated |
|
inline |
Explicitly use a const reference to this.
|
inlineinherited |
|
inline |
Convert to bool value.
Fails on bad format, empty, or number overflow.
Format: [WHITESPACE] ["on"|"off"|"yes"|"no"|"true"|"false"|"t"|"f"|DIGITS] [WHITESPACE]
|
inlineinherited |
|
inlineinherited |
|
inline |
Clear by removing all items.
|
inline |
Comparison against UTF-16 string.
| T | Inferred from argument |
| str | String to compare to |
| int compare | ( | const StringBase & | data | ) | const |
Comparison.
| data | Data to compare to |
|
inlineinherited |
Check whether contains given item.
| item | Item to check for |
|
inline |
Check whether this contains given character.
| ch | Character to check for |
|
inline |
Check whether this contains given string.
| str | Pointer to string to check for |
| size | String size in bytes |
|
inline |
Check whether contains given string.
| str | String to check for |
|
inline |
Convert string to value of given type.
| C | Type to convert to |
|
inline |
Convert value to string, replacing current string.
| C | Type to convert from, inferred from argument |
| value | Value to convert |
|
inline |
Get terminated string pointer, using given string buffer if needed (const).
| buffer | Buffer to use, if needed |
| const char* data | ( | ) | const |
Get data pointer.
| bool empty | ( | ) | const |
|
inlineinherited |
|
inlineinherited |
Check if this ends with given item.
| item | Item to check |
Check if this ends with given items.
| items | Items to check |
| size | Item count to check |
|
inlineinherited |
Check if this ends with given items.
| items | Items to check |
|
inline |
Check if ends with given terminated string.
| str | String to check for – must be terminated |
|
inline |
Find first occurrence of character with forward search.
| ch | Character to find |
Find first occurrence of character with forward search.
| ch | Character to find |
| start | Starting index for search |
| end | End index for search, END for end of string |
Find first occurrence of pattern string.
| pattern | Pointer to pattern to look for, must not be NULL |
| pattern_size | Pattern size in bytes |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern_size=0
|
inline |
Find first occurrence of pattern string using specified algorithm.
| alg | Search algorithm to use, see StringSearchAlg |
| pattern | Pointer to pattern to look for, must not be NULL |
| pattern_size | Pattern size in bytes |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern_size=0
|
inline |
Find first occurrence of pattern string.
| pattern | Pattern to look for |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern is empty
|
inline |
Find first occurrence of pattern string using specified algorithm.
| alg | Search algorithm to use, see StringSearchAlg |
| pattern | Pattern to look for |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern_size=0 Find first occurrence of item with forward search.
| item | Item to find |
| start | Starting index for search |
| end | End index for search, END for end of list |
Find first occurrence of any given characters with forward search.
| chars | Characters to search for, must not contain multi-byte chars |
| count | Character count to search for |
| start | Starting index for search |
| end | End index for search, END for end of list |
count=0
|
inline |
Find first occurrence of any given characters with forward search.
| chars | Characters to search for, must not contain multi-byte chars |
| start | Starting index for search |
| end | End index for search, END for end of list |
chars is empty Find first occurrence of any given items with forward search.
| items | Items to search for |
| count | Count of items to search for |
| start | Starting index for search |
| end | End index for search, END for end of list |
Find first occurrence of any character not listed with forward search.
chars| chars | Excluded characters, must not contain multi-byte chars |
| count | Excluded character count |
| start | Starting index for search |
| end | End index for search, END for end of list |
|
inline |
Find first occurrence of any character not listed with forward search.
chars| chars | Excluded characters, must not contain multi-byte chars |
| start | Starting index for search |
| end | End index for search, END for end of list |
Find last occurrence of any character not listed with reverse search.
chars| chars | Excluded characters, must not contain multi-byte chars |
| count | Excluded character count |
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
|
inline |
Find last occurrence of any character not listed with reverse search.
chars| chars | Excluded characters, must not contain multi-byte chars |
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
Find last occurrence of any given characters with reverse search.
| chars | Characters to search for, must not contain multi-byte chars |
| count | Character count to search for |
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
count=0
|
inline |
Find last occurrence of any given characters with reverse search.
| chars | Characters to search for, must not contain multi-byte chars |
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
chars is empty Find last occurrence of any given items with reverse search.
| items | Items to search for |
| count | Count of items to search for |
| start | Starting index for search range – last item checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
Find first non-word word character.
| start | Starting index for search |
| end | End index for search, END for end of list |
Find last non-word character with reverse search.
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
|
inline |
Find last occurrence of character with reverse search.
| ch | Character to find |
Find last occurrence of character with reverse search.
| ch | Character to find |
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of string |
Find last occurrence of pattern string with reverse search.
| pattern | Pointer to pattern to look for, must not be NULL |
| pattern_size | Pattern size in bytes |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern is empty
|
inline |
Find last occurrence of pattern string with reverse search.
| alg | Search algorithm to use, see StringSearchAlg |
| pattern | Pointer to pattern to look for, must not be NULL |
| pattern_size | Pattern size in bytes |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern is empty
|
inline |
Find last occurrence of pattern string with reverse search.
| pattern | Pattern to look for |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern is empty
|
inline |
Find last occurrence of pattern string with reverse search.
| alg | Search algorithm to use, see StringSearchAlg |
| pattern | Pattern to look for |
| start | Starting index for search |
| end | End index for search, END for end of string |
pattern is empty Find last occurrence of item with reverse search.
| item | Item to find |
| start | Starting index for search range – last item checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
Find first word character.
| start | Starting index for search |
| end | End index for search, END for end of list |
Find last word character with reverse search.
| start | Starting index for search range – last character checked in reverse search |
| end | End index for search range (reverse search starting point), END for end of list |
| const char* first | ( | ) | const |
Get first item (const).
|
inline |
Convert to bool value for given boolean type.
Fails on bad format, empty, or number overflow.
Format: [WHITESPACE] ["on"|"off"|"yes"|"no"|"true"|"false"|"t"|"f"|DIGITS] [WHITESPACE]
Error codes:
| error | Stores conversion error code, ENone on success [out] |
|
inline |
Convert to bool value for given boolean type.
Fails on bad format, empty, or number overflow
Format: [WHITESPACE] ["on"|"off"|"yes"|"no"|"true"|"false"|"t"|"f"|DIGITS] [WHITESPACE]
| T | Boolean type to convert to – can be Bool or bool |
|
inline |
Convert to number value for given integer type.
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
Error codes:
| T | Basic integer type to convert to – must be primitive like: int32, int, long, uint32, uint, ulong, etc |
| error | Stores conversion error code, ENone on success [out] |
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to number value for given integer type.
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| T | Integer type to convert to – can be IntegerT type like Int32, Int, ULong, etc or primitive like int32, int, ulong, etc |
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to floating point number value for given type.
Fails on bad format or no digits.
Format: [WHITESPACE] ("nan" | NUMBER) [WHITESPACE]
Error codes:
| T | Basic floating point type to convert to – must be primitive like: float, double, ldouble |
| error | Stores conversion error code, ENone on success [out] |
|
inline |
Convert to floating point number value for given type.
Fails on bad format or no digits.
Format: [WHITESPACE] ("nan" | NUMBER) [WHITESPACE]
| T | Floating point type to convert to – can be FloatT type like Float, FloatD, etc or primitive like float, double, etc |
| ulong hash | ( | ulong | seed | ) | const |
Get data hash value.
| seed | Seed value for hashing multiple values, 0 if none |
Get index from last item using offset.
| offset | Offset from end, 0 for last item, 1 for second-last, etc |
| const char& item | ( | Key | index | ) | const |
Get item at position.
| index | Item index |
| const char* last | ( | ) | const |
Get last item (const).
| bool null | ( | ) | const |
Get whether null.
|
inline |
Convert to number value (signed).
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to number value (floating point).
Fails on bad format or no digits.
Format: [WHITESPACE] ("nan" | NUMBER) [WHITESPACE]
|
inline |
Convert to number value (double floating point).
Fails on bad format or no digits.
Format: [WHITESPACE] ("nan" | NUMBER) [WHITESPACE]
|
inline |
Convert to number value (ldouble floating point).
Fails on bad format or no digits.
Format: [WHITESPACE] ("nan" | NUMBER) [WHITESPACE]
|
inline |
Convert to number value (signed long).
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to number value (signed long-long).
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to number value (unsigned).
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to number value (unsigned long).
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| base | Conversion base, 0 for autodetect |
|
inline |
Convert to number value (unsigned long-long).
Fails on bad format, no digits, or overflow.
Format: [WHITESPACE] ["+"|"-"] ["0x"|"0X"|"x"|"0"] DIGITS [WHITESPACE]
| base | Conversion base, 0 for autodetect |
|
inline |
Inequality operator to compare against UTF-16 string.
| T | Inferred from argument |
| str | String to compare to |
|
inline |
Inequality operator.
| str | String to compare to – must be null terminated |
| bool operator!= | ( | const StringBase & | data | ) | const |
Inequality operator.
| data | Data to compare to |
Move assignment operator (C++11).
| src | Source to move |
Assignment operator.
| src | Source to copy |
|
inline |
Assignment operator sets as reference to source data.
| data | Data to reference |
|
inline |
Assignment operator sets as reference to source data from pointer.
| data | Data pointer to reference, calls set() if NULL |
|
inline |
Assignment operator sets as reference to terminated string.
| data | Data to reference |
Assignment operator sets as null.
| val | vNULL |
Assignment operator sets as null.
| val | vEMPTY |
|
inline |
Equality operator to compare against UTF-16 string.
| T | Inferred from argument |
| str | String to compare to |
|
inline |
Equality operator.
| str | String to compare to – must be null terminated |
| bool operator== | ( | const StringBase & | data | ) | const |
Equality operator.
| data | Data to compare to |
| const char& operator[] | ( | Key | index | ) | const |
Get item at position.
| index | Item index |
|
inline |
Set as reference to terminated string.
| data | Data to reference – must be terminated |
|
inline |
Set as null.
|
inline |
Set as reference to source data.
| data | Data to reference |
|
inline |
Set as reference to source data.
| data | Data to reference |
| index | Start index of data to reference, END to set as empty |
| size | Size as item count, ALL for all from index |
|
inline |
Set as reference to source data by pointer.
| data | Pointer to data to reference, null if NULL |
Set as reference to data pointer.
| data | Data to reference |
| size | Data size as item count |
|
inline |
Set as reference to subset of source data using start/end positions.
| data | Data to reference |
| index1 | Start index of data to reference, END to set as empty |
| index2 | End index of data (this item not included), END for all after index1 |
|
inline |
Set as empty but not null.
| bool shared | ( | ) | const |
Get whether shared (false).
| Size size | ( | ) | const |
Get size.
Slice beginning items.
| index | Start index of new slice, END to set as empty (or leave null if null) |
Slice to given subset.
| index | Start index of new slice, END to set as empty (or leave null if null) |
| size | Slice size as item count, ALL for all from index |
Slice to given subset using start/end positions.
| index1 | Start index of new slice, END to set as empty (or leave null if null) |
| index2 | End index of new slice (this item not included), END for all after index1 |
|
inline |
Split at first occurrence of delimiter into left/right substrings.
| T1 | String type to store left substring |
| T2 | String type to store right substring |
| delim | Delimiter to find |
| left | Set to substring before delim, set to this if not found [out] |
| right | Set to substring after delim, null if not found [out] |
|
inline |
Split at first occurrence of delimiter into left substring.
| T1 | String type to store left substring |
| delim | Delimiter to find |
| left | Set to substring before delim, set to this if not found [out] |
|
inline |
Split at first occurrence of delimiter into right substring.
| T2 | String type to store right substring |
| delim | Delimiter to find |
| left | vNULL (ignored) |
| right | Set to substring after delim, null if not found [out] |
|
inline |
Split delimited string into item list using given tokenizer.
| Tok | Tokenizer to use, such as StrTok |
| C | List container for items – inferred from items parameter |
| items | List to add items to [in/out] |
| delim | Delimiter to use |
| bool splitat | ( | Key | index, |
| T1 & | left, | ||
| T2 & | right | ||
| ) | const |
Split into left/right sublists at index.
| T1 | List type to store left sublist |
| T2 | List type to store right sublist |
| index | Index to split at, bad index (NONE or out-of-bounds) splits at end |
| left | Set to sublist before index, set to this if bad index [out] |
| right | Set to sublist after index, null if bad index [out] |
| bool splitat | ( | Key | index, |
| T1 & | left | ||
| ) | const |
Split into left sublist at index.
| T1 | List type to store left sublist |
| index | Index to split at, bad index (NONE or out-of-bounds) splits at end |
| left | Set to sublist before index, set to this if bad index [out] |
Split into right sublist at index.
| T2 | List type to store right sublist |
| index | Index to split at, bad index (NONE or out-of-bounds) splits at end |
| left | vNULL (ignored) |
| right | Set to sublist after index, null if bad index [out] |
| bool splitat_setl | ( | Key | index | ) |
Split at index and set as left sublist.
| index | Index to split at, bad index (NONE or out-of-bounds) splits at end (i.e. unchanged) |
| bool splitat_setl | ( | Key | index, |
| T2 & | right | ||
| ) |
Split at index, set as left sublist, and save right sublist.
| index | Index to split at, bad index (NONE or out-of-bounds) splits at end (i.e. unchanged) |
| right | Set to sublist after index, null if bad index [out] |
| bool splitat_setr | ( | Key | index | ) |
| bool splitat_setr | ( | Key | index, |
| T1 & | left | ||
| ) |
Split at index, set as right sublist, and save left sublist.
| index | Index to split at, bad index (NONE or out-of-bounds) splits at end |
| left | Set to sublist before index, set to this if bad index [out] |
|
inline |
Split at last occurrence of delimiter into left/right substrings.
| T1 | String type to store left substring |
| T2 | String type to store right substring |
| delim | Delimiter to find |
| left | Set to substring before delim, set to this if not found [out] |
| right | Set to substring after delim, null if not found [out] |
|
inline |
Split at last occurrence of delimiter into left substring.
| T1 | String type to store left substring |
| delim | Delimiter to find |
| left | Set to substring before delim, set to this if not found [out] |
|
inline |
Split at last occurrence of delimiter into right substring.
| T2 | String type to store right substring |
| delim | Delimiter to find |
| left | vNULL (ignored) |
| right | Set to substring after delim, null if not found [out] |
|
inlineinherited |
Check if this starts with given item.
| item | Item to check |
Check if starts with given items.
| items | Items to check |
| size | Size as item count to check |
|
inlineinherited |
Check if this starts with given items.
| items | Items to check |
|
inline |
Check if starts with given terminated string.
| str | String to check for – must be terminated |
|
inline |
|
inline |
Strip left (beginning) and right (ending) occurences of character.
| ch | Character to strip |
|
inline |
Strip left (beginning) and right (ending) whitespace from string, including newlines.
|
inline |
|
inline |
Strip left (beginning) occurrences of character.
| ch | Character to strip |
| max | Max count to strip, ALL for all |
Strip left (beginning) occurrences of string.
| str | Pointer to string to strip |
| strsize | String length to strip |
| max | Max number of occurences to strip, ALL for all |
|
inline |
Strip left (beginning) whitespace from string, including newlines.
|
inline |
Strip left (beginning) newlines from string.
max of 1 may remove 2 characters, and so on| max | Max number of newlines to strip, ALL for all |
|
inline |
Strip right (ending) occurences of character.
| ch | Character to strip |
| max | Max count to strip, ALL for all |
Strip right (ending) occurences of string.
| str | Pointer to string to strip |
| strsize | String length to strip |
| max | Max number of occurences to strip, ALL for all |
|
inline |
Strip right (ending) whitespace (including newlines) from string.
|
inline |
|
inlineinherited |
Swap with another sublist.
| list | List to swap with |
| void swap | ( | StringBase & | list | ) |
Swap with another sublist.
| list | List to swap with |
|
inline |
Extract next token from string.
| StringT | Output string type to store line (String or SubString), inferred from first parameter |
| value | Set to next token value, or null if none [out] |
| delim | Delimiter to tokenize on |
Extract next token from string using any of given delimiters.
| StringT | Output string type to store line (String or SubString), inferred from first parameter |
| value | Set to next token value, or null if none [out] |
| found_delim | Set to delimited found, null if no delim found [out] |
| delims | Delimiters to search for |
| count | Count of delimiters to search for, must be positive |
|
inline |
Extract next line from string.
| StringT | Output string type to store line (String or SubString), inferred from parameter |
| line | Set to extracted line (newline removed), null if no line extracted |
|
inline |
Extract next token from string in reverse (from end of string).
| StringT | Output string type to store line (String or SubString), inferred from first parameter |
| value | Set to next token value, or null if none [out] |
| delim | Delimiter to tokenize on |
Extract next token from string in reverse (from end of string) using any of given delimiters.
| StringT | Output string type to store line (String or SubString), inferred from first parameter |
| value | Set to next token value, or null if none [out] |
| found_delim | Set to delimited found, null if no delim found [out] |
| delims | Delimiters to search for |
| count | Count of delimiters to search for, must be positive |
|
inline |
Extract next line from string in reverse (from end of string).
| StringT | Output string type to store line (String or SubString), inferred from parameter |
| line | Set to extracted line (newline removed), null if no line extracted |
Trim left (beginning) items.
| size | Trim size as item count to remove |
Trim right (ending) items.
| size | Trim size as item count to remove |
Truncate to given size.
| size | Size to truncate to as item count |
|
inline |
Make data unique – no-op.
|
inherited |
Data pointer, NULL if null.
|
inherited |
Data size as item count, 0 if empty or null.
1.8.13