![]() |
NDEVR
API Documentation
|
The core String View class for the NDEVR API. More...
Public Member Functions | |
| constexpr | StringView () |
| Constructor used to create an empty StringView. | |
| constexpr | StringView (const char *const string, uint04 size) |
| String Constructor char arrays when the size is known. | |
| constexpr | StringView (const char *string) |
| String Constructor for null terminated array of chars. | |
| template<std::size_t N> | |
| constexpr | StringView (const char(&string)[N]) |
| String Constructor for static char arrays. | |
| constexpr | StringView (const String &s) |
| Constructs a StringView from an existing String object. | |
| constexpr | StringView (const StringView &other) noexcept |
| Copy constructor for StringView. | |
| StringView (String &&s)=delete | |
| Deleted move constructor from String to prevent dangling views. | |
| constexpr | StringView (StringView &&other) noexcept |
| Move constructor for StringView. | |
| void | addToSize (uint04 size) |
| Increases the reported size of the string view by the given amount. | |
| constexpr const char * | begin () const |
| Returns a pointer to the beginning of the string data. | |
| constexpr const char * | begin (uint04 idx_offset) const |
| Returns a pointer offset from the beginning of the string data. | |
| bool | beginsWith (const StringView &s, bool ignore_case=false) const |
| Tests if this String starts with the specified prefix. | |
| constexpr bool | contains (char c) const |
| Checks whether the string view contains the given character. | |
| uint04 | count (char c) const |
| Counts the number of occurrences of the given character. | |
| constexpr const char * | end () const |
| Returns a pointer to one past the last character of the string data. | |
| bool | endsWith (const StringView &s, bool ignore_case=false) const |
| Tests if this String ends with the specified suffix. | |
| void | ensureNullTerminated (String &s) |
| This makes the string null terminated, if needed, using the provided string as the new buffer. | |
| uint04 | fromHex () const |
| Converts a hex value into an unsigned 4 byte number. | |
| template<class t_type> | |
| t_type | getAs () const |
| Converts a string into an object. | |
| constexpr uint08 | hash () const |
| Creates a simple, quick hash of the object. | |
| constexpr uint08 | hashLower () const |
| Creates a simple, quick hash of the object. | |
| constexpr uint08 | hashUpper () const |
| Creates a simple, quick hash of the object. | |
| bool | hasSubString (const StringView &sub_string, bool ignore_case=false, uint04 initial_index=0) const |
| Tests if this String contains the specified substring. | |
| uint04 | indexOf (const char &sub_string) const |
| Given a substring specified by the input, returns the first index of that string, if it exists. | |
| uint04 | indexOf (const char &sub_string, uint04 start_pos) const |
| Given a substring specified by the input, returns the first index of that string, if it exists. | |
| uint04 | indexOf (const char &sub_string, uint04 start_pos, uint04 size) const |
| Given a substring specified by the input, returns the first index of that string, if it exists. | |
| uint04 | indexOf (const char *sub_string, bool ignore_case, uint04 start_index, uint04 size) const |
| Given a substring specified by the input, returns the first index of that string, if it exists. | |
| uint04 | indexOf (const char *sub_string, char escape_char, bool ignore_case=false, uint04 start_index=0) const |
| Given a substring specified by the input, returns the first index of that string, if it exists. | |
| template<size_t t_size> | |
| uint04 | indexOf (const char(&value)[t_size], bool ignore_case, uint04 start_index=0) const |
| Template overload of indexOf for static char arrays. | |
| uint04 | indexOf (const StringView &sub_string, bool ignore_case=false, uint04 start_index=0) const |
| Given a substring specified by the input, returns the first index of that string, if it exists. | |
| StringAllocatingView | insertNewLines (uint04 max_line_size) const |
| Finds key areas to insert new lines such that the rows are at most, the length provided. | |
| bool | isGreaterNoCase (const StringView &other) const |
| Case-insensitive greater-than comparison. | |
| bool | isLessNoCase (const StringView &other) const |
| Case-insensitive less-than comparison. | |
| bool | isNullTerminated () const |
| Checks whether the underlying string data is null terminated. | |
| bool | isNumeric () const |
| Checks to see if the string is a numeric string. | |
| bool | isSameNoCase (const StringView &s) const |
| Checks whether two strings match in a case-insensitive way. | |
| char | last () const |
| Returns the last character in the string view. | |
| uint04 | lastIndexOf (const char *sub_string, bool ignore_case=false) const |
| Given a substring specified by the input, returns the last index of that string, if it exists. | |
| uint04 | lastIndexOf (const char value, bool ignore_case=false) const |
| Given a value specified by the input, returns the last index of that char, if it exists. | |
| bool | matchesWildcard (const StringView &pattern) const |
| Checks whether two strings match allowing '' to be used as a wildcard pattern. | |
| constexpr bool | operator!= (const char *const value) const |
| Checks inequality with a null-terminated C string. | |
| template<std::size_t t_size> | |
| constexpr bool | operator!= (const char(&string)[t_size]) |
| Checks inequality with a static char array. | |
| bool | operator!= (const String &value) const |
| Checks inequality with a String object. | |
| constexpr bool | operator!= (const StringView &value) const |
| Checks inequality with another StringView. | |
| bool | operator< (const StringView &value) const |
| Less-than comparison operator using lexicographic ordering. | |
| constexpr StringView & | operator= (const char *value) |
| Assignment operator from a null-terminated C string. | |
| template<std::size_t t_size> | |
| constexpr StringView & | operator= (const char(&string)[t_size]) |
| Assignment operator from a static char array. | |
| StringView & | operator= (const String &value) |
| Assignment operator from a String object. | |
| constexpr StringView & | operator= (const StringView &value) |
| Copy assignment operator from another StringView. | |
| StringView & | operator= (String &&value)=delete |
| Deleted move assignment from String to prevent dangling views. | |
| constexpr bool | operator== (const char *const value) const |
| Checks equality with a null-terminated C string. | |
| template<std::size_t t_size> | |
| constexpr bool | operator== (const char(&string)[t_size]) |
| Checks equality with a static char array. | |
| bool | operator== (const String &value) const |
| Checks equality with a String object. | |
| constexpr bool | operator== (const StringView &value) const |
| Checks equality with another StringView. | |
| bool | operator> (const StringView &value) const |
| Greater-than comparison operator using lexicographic ordering. | |
| constexpr const char & | operator[] (const uint04 idx) const |
| Accesses the character at the given index. | |
| String | predictNextStringIncrement () const |
| Looks in the string for key markers that might be an index, and attempts to increment the index. | |
| void | removeFirst (uint04 count=1) |
| Removes the specified number of characters from the beginning of the view. | |
| void | removeLast (uint04 count=1) |
| Removes the specified number of characters from the end of the view. | |
| StringAllocatingView | shortenString (uint04 size) const |
| Shortans the string to the max size provided. | |
| constexpr uint04 | size () const |
| Returns the byte size of this string view. | |
| StringViewBuffer | split (char delimiter, bool preserve_empty=true) const |
| Given a delimiter, breaks the string into subsections, returning an array of each subsection. | |
| StringViewBuffer | split (const Buffer< char > &delimiter, bool preserve_empty=true) const |
| Given multiple delimiter, breaks the string view into subsections, returning an array of each subsection. | |
| StringView | splitPart (char delimiter, uint04 index) const |
| Returns a single part from splitting the string by the given delimiter. | |
| void | splitString (char delimiter, StringViewBuffer &strings, bool preserve_empty=true) const |
| Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given Buffer. | |
| void | splitString (const Buffer< char > &delimiter, StringViewBuffer &strings, bool preserve_empty=true) const |
| Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given Buffer. | |
| StringView | substr (uint04 start) const |
| Creates a substring from a given start position, to the end of the string. | |
| StringView | substr (uint04 start, uint04 end) const |
| Creates a substring from a given start position, to the given end position, non-inclusive of the end index. | |
| StringAllocatingView | toLower () const |
| changes all upper case characters into lower case characters. | |
| String | toTitleString () const |
| Formats the string to be a title, capitalizing important characters and replacing underscores with spaces. | |
| StringAllocatingView | toUpper () const |
| changes all lower case characters into upper case characters. | |
| StringView & | trimWhiteSpace () |
| Trims leading and trailing whitespace from the string view. | |
Static Public Member Functions | |
| static bool | AlphaNumericCompare (const StringView &left, const StringView &right) |
| Compares two strings given their alpha-numeric determined value. | |
| static StringViewBuffer | Convert (const StringBuffer &strings) |
| Converts a StringBuffer into a StringViewBuffer. | |
| static StringBuffer | Convert (const StringViewBuffer &views) |
| Converts a StringViewBuffer into a StringBuffer by copying each view into a String. | |
| static void | Convert (StringBuffer &&strings)=delete |
| Deleted overload to prevent converting from rvalue StringBuffer which would create dangling views. | |
| static constexpr uint08 | hash (const char *value) |
| constexpr method to hash a value. | |
| static constexpr uint04 | str_len (const char *value) |
| constexpr method to get the length of a null-terminated string at compile time | |
| static constexpr uint04 | str_len (const wchar *value) |
| constexpr method to get the UTF8 length of a null-terminated string at compile time | |
Protected Attributes | |
| uint04 | m_size = 0 |
| The byte length of the string view. | |
| const char * | m_start = nullptr |
| Pointer to the beginning of the string data. | |
The core String View class for the NDEVR API.
This String View class:
See StringStream for details on providing a definition that will allow any object to be used as a constructor for String, or convert a String into any object using getAs<...>()
Definition at line 57 of file StringView.h.
|
inlineconstexprnoexcept |
Move constructor for StringView.
| [in] | other | The other view to be converted |
Definition at line 70 of file StringView.h.
References StringView().
|
inlineconstexprnoexcept |
Copy constructor for StringView.
| [in] | other | The other view to be copied |
Definition at line 78 of file StringView.h.
References StringView().
|
inlineconstexpr |
String Constructor for static char arrays.
| [in] | string | The array of characters making up the string. Should be in Unicode (UTF8) |
Definition at line 87 of file StringView.h.
References StringView(), and str_len().
|
inlineconstexpr |
String Constructor for null terminated array of chars.
| [in] | string | The array of characters making up the string. Should be in Unicode (UTF8) and null terminated. |
Definition at line 95 of file StringView.h.
References StringView(), and str_len().
|
inlineconstexpr |
String Constructor char arrays when the size is known.
Slightly faster than iterating over a null-terminated array.
| [in] | string | The array of characters making up the string. Should be in Unicode (UTF8) |
| [in] | size | The size of the string |
Definition at line 105 of file StringView.h.
|
explicitconstexpr |
|
inline |
Increases the reported size of the string view by the given amount.
| [in] | size | The number of bytes to add to the current size. |
Definition at line 769 of file StringView.h.
|
static |
Compares two strings given their alpha-numeric determined value.
References StringView().
|
inlinenodiscardconstexpr |
Returns a pointer to the beginning of the string data.
Definition at line 640 of file StringView.h.
References m_start.
Referenced by String::String(), String::append(), HashMaker::hash(), operator!=(), BinaryFile::write(), and BinaryFile::writeRawData().
|
inlinenodiscardconstexpr |
Returns a pointer offset from the beginning of the string data.
| [in] | idx_offset | The number of characters to offset from the start. |
Definition at line 649 of file StringView.h.
References m_start.
| bool StringView::beginsWith | ( | const StringView & | s, |
| bool | ignore_case = false ) const |
Tests if this String starts with the specified prefix.
| [in] | s | the value to test against the start of this string. |
| [in] | ignore_case | whether or not to check using case sensitivity. |
References StringView().
|
inlinenodiscardconstexpr |
Checks whether the string view contains the given character.
| [in] | c | The character to search for. |
Definition at line 666 of file StringView.h.
|
static |
Converts a StringBuffer into a StringViewBuffer.
| [in] | strings | The StringBuffer to convert. |
Referenced by ManagedDesignCommand::setParams(), and TranslationTools::setupFile().
|
static |
Converts a StringViewBuffer into a StringBuffer by copying each view into a String.
| [in] | views | The StringViewBuffer to convert. |
|
nodiscard |
Counts the number of occurrences of the given character.
| [in] | c | The character to count. |
Referenced by removeFirst(), removeLast(), and str_len().
|
inlinenodiscardconstexpr |
Returns a pointer to one past the last character of the string data.
Definition at line 657 of file StringView.h.
References m_size, and m_start.
Referenced by substr().
| bool StringView::endsWith | ( | const StringView & | s, |
| bool | ignore_case = false ) const |
Tests if this String ends with the specified suffix.
| [in] | s | the value to test against the start of this string. |
| [in] | ignore_case | whether or not to check using case sensitivity. |
References StringView().
| void StringView::ensureNullTerminated | ( | String & | s | ) |
This makes the string null terminated, if needed, using the provided string as the new buffer.
If this is already null terminated, this function does not allocate memory
| uint04 StringView::fromHex | ( | ) | const |
Converts a hex value into an unsigned 4 byte number.
|
inlinenodiscard |
Converts a string into an object.
To use this function an object must have overwritten StringStream<t_type>::fromString.
Definition at line 125 of file StringView.h.
References StringStream< t_type >::fromString().
Referenced by NtpClient::NtpClient(), RealSenseServer::checkRecieve(), JSONToStringHelper< Time >::Convert(), ScaledUnit::fromString(), Unit::fromString(), Scanner::getNext(), TableColumnBuffer< t_type >::isSame(), QtVulkanSession::readShader(), TableColumnColorType::set(), TableColumnColorType::set(), TableColumnTypeBuffer< T >::set(), TableMatrixType< T, t_cols, t_rows >::set(), TableVectorType< 1, T >::set(), TableVectorType< 1, T >::set(), TableVectorType< 1, t_type >::set(), TableVectorType< 1, t_type >::set(), TableVectorType< 1, UUID >::set(), TableColumnBuffer< t_type >::setDefaultValue(), TableColumnColorType::setDefaultValue(), TableMatrixType< T, t_cols, t_rows >::setDefaultValue(), and QCustomLineEdit::setPlaceholderValue().
|
inlineconstexpr |
Creates a simple, quick hash of the object.
See hash(const char* value) for details of the implementation.
Definition at line 330 of file StringView.h.
References cast(), hash(), and size().
Referenced by TranslationTools::convertBrackets(), TranslationTools::convertFromBrackets(), String::hash(), String::hash(), hash(), hashLower(), and hashUpper().
|
inlinestaticconstexpr |
constexpr method to hash a value.
Also provides the hashing method used throughout the API to hash strings.
Definition at line 342 of file StringView.h.
|
inlineconstexpr |
Creates a simple, quick hash of the object.
See hash(const char* value) for details of the implementation.
Definition at line 372 of file StringView.h.
|
inlineconstexpr |
Creates a simple, quick hash of the object.
See hash(const char* value) for details of the implementation.
Definition at line 356 of file StringView.h.
| bool StringView::hasSubString | ( | const StringView & | sub_string, |
| bool | ignore_case = false, | ||
| uint04 | initial_index = 0 ) const |
Tests if this String contains the specified substring.
| [in] | sub_string | the value to test for containment. |
| [in] | ignore_case | whether or not to check using case sensitivity. |
References StringView().
| uint04 StringView::indexOf | ( | const char & | sub_string | ) | const |
Given a substring specified by the input, returns the first index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
Given a substring specified by the input, returns the first index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
| [in] | start_pos | The index of where to begin searching for the sub_string. |
Given a substring specified by the input, returns the first index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
| [in] | start_pos | The index of where to begin searching for the sub_string. |
| [in] | size | The max span to continue searching for the sub_string. The sub_string must entirely reside within the span from start_pos to sie to be valid. |
References size().
| uint04 StringView::indexOf | ( | const char * | sub_string, |
| bool | ignore_case, | ||
| uint04 | start_index, | ||
| uint04 | size ) const |
Given a substring specified by the input, returns the first index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
| [in] | ignore_case | whether or not to check using case sensitivity. |
| [in] | start_index | The index of where to begin searching for the sub_string. |
| [in] | size | The max span to continue searching for the sub_string. The sub_string must entirely reside within the span from start_pos to sie to be valid. |
References size().
| uint04 StringView::indexOf | ( | const char * | sub_string, |
| char | escape_char, | ||
| bool | ignore_case = false, | ||
| uint04 | start_index = 0 ) const |
Given a substring specified by the input, returns the first index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
| [in] | escape_char | The char that when encountered, ends the search. |
| [in] | ignore_case | whether or not to check using case sensitivity. |
| [in] | start_index | The index of where to begin searching for the sub_string. |
|
inline |
Template overload of indexOf for static char arrays.
| [in] | value | The static char array to find in the String. |
| [in] | ignore_case | Whether or not to check using case sensitivity. |
| [in] | start_index | The index of where to begin searching. |
Definition at line 173 of file StringView.h.
References StringView(), indexOf(), and str_len().
| uint04 StringView::indexOf | ( | const StringView & | sub_string, |
| bool | ignore_case = false, | ||
| uint04 | start_index = 0 ) const |
Given a substring specified by the input, returns the first index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
| [in] | ignore_case | whether or not to check using case sensitivity. |
| [in] | start_index | The index of where to begin searching for the sub_string. |
References StringView().
Referenced by TranslationTools::convertBrackets(), and indexOf().
| StringAllocatingView StringView::insertNewLines | ( | uint04 | max_line_size | ) | const |
Finds key areas to insert new lines such that the rows are at most, the length provided.
| [in] | max_line_size | The max size of any row of the resulting string |
| bool StringView::isGreaterNoCase | ( | const StringView & | other | ) | const |
Case-insensitive greater-than comparison.
| [in] | other | The StringView to compare against. |
References StringView().
| bool StringView::isLessNoCase | ( | const StringView & | other | ) | const |
Case-insensitive less-than comparison.
| [in] | other | The StringView to compare against. |
References StringView().
| bool StringView::isNullTerminated | ( | ) | const |
Checks whether the underlying string data is null terminated.
| bool StringView::isNumeric | ( | ) | const |
Checks to see if the string is a numeric string.
| bool StringView::isSameNoCase | ( | const StringView & | s | ) | const |
Checks whether two strings match in a case-insensitive way.
| [in] | s | The string to compare against |
References StringView().
|
nodiscard |
Returns the last character in the string view.
| uint04 StringView::lastIndexOf | ( | const char * | sub_string, |
| bool | ignore_case = false ) const |
Given a substring specified by the input, returns the last index of that string, if it exists.
| [in] | sub_string | the value to find in the String |
| [in] | ignore_case | whether or not to check using case sensitivity. |
| uint04 StringView::lastIndexOf | ( | const char | value, |
| bool | ignore_case = false ) const |
Given a value specified by the input, returns the last index of that char, if it exists.
| [in] | value | the value to find in the String |
| [in] | ignore_case | whether or not to check using case sensitivity. |
| bool StringView::matchesWildcard | ( | const StringView & | pattern | ) | const |
Checks whether two strings match allowing '' to be used as a wildcard pattern.
For example, String("Hello").matchesWildcard("*ll") would return true.
| [in] | pattern | The pattern used to check the string against. |
References StringView().
|
inlineconstexpr |
Checks inequality with a null-terminated C string.
| [in] | value | The C string to compare against. |
Definition at line 531 of file StringView.h.
References size().
|
inlineconstexpr |
Checks inequality with a static char array.
| [in] | string | The static char array to compare against. |
Definition at line 546 of file StringView.h.
| bool StringView::operator!= | ( | const String & | value | ) | const |
|
inlineconstexpr |
Checks inequality with another StringView.
| [in] | value | The StringView to compare against. |
Definition at line 559 of file StringView.h.
References StringView(), and size().
| bool StringView::operator< | ( | const StringView & | value | ) | const |
Less-than comparison operator using lexicographic ordering.
| [in] | value | The StringView to compare against. |
References StringView().
|
inlineconstexpr |
Assignment operator from a null-terminated C string.
| [in] | value | The C string to assign from. |
Definition at line 606 of file StringView.h.
References StringView(), m_size, m_start, and str_len().
|
inlineconstexpr |
Assignment operator from a static char array.
| [in] | string | The static char array to assign from. |
Definition at line 595 of file StringView.h.
References StringView(), m_size, m_start, and str_len().
| StringView & StringView::operator= | ( | const String & | value | ) |
Assignment operator from a String object.
| [in] | value | The String to assign from. |
References StringView().
|
inlineconstexpr |
Copy assignment operator from another StringView.
| [in] | value | The StringView to assign from. |
Definition at line 575 of file StringView.h.
References StringView(), m_size, m_start, and size().
|
inlineconstexpr |
Checks equality with a null-terminated C string.
| [in] | value | The C string to compare against. |
Definition at line 499 of file StringView.h.
References size().
|
inlineconstexpr |
Checks equality with a static char array.
| [in] | string | The static char array to compare against. |
Definition at line 514 of file StringView.h.
References size().
| bool StringView::operator== | ( | const String & | value | ) | const |
|
inlineconstexpr |
Checks equality with another StringView.
| [in] | value | The StringView to compare against. |
Definition at line 483 of file StringView.h.
References StringView(), and size().
| bool StringView::operator> | ( | const StringView & | value | ) | const |
Greater-than comparison operator using lexicographic ordering.
| [in] | value | The StringView to compare against. |
References StringView().
|
inlinenodiscardconstexpr |
Accesses the character at the given index.
| [in] | idx | The zero-based index of the character. |
Definition at line 320 of file StringView.h.
References m_start.
| String StringView::predictNextStringIncrement | ( | ) | const |
Looks in the string for key markers that might be an index, and attempts to increment the index.
If no index is found a "1" will be inserted to the end of the string.
| void StringView::removeFirst | ( | uint04 | count = 1 | ) |
| void StringView::removeLast | ( | uint04 | count = 1 | ) |
| StringAllocatingView StringView::shortenString | ( | uint04 | size | ) | const |
|
inlineconstexpr |
Returns the byte size of this string view.
Definition at line 435 of file StringView.h.
References m_size.
Referenced by String::String(), StringView(), StringView(), addToSize(), String::append(), UUID::CreateUUID(), HashMaker::hash(), hash(), hashLower(), hashUpper(), indexOf(), indexOf(), IsInvalid(), IsValid(), operator!=(), operator!=(), operator!=(), operator=(), operator==(), operator==(), operator==(), shortenString(), String::ToHex(), Customer::updateFirstName(), BinaryFile::write(), and BinaryFile::writeRawData().
| StringViewBuffer StringView::split | ( | char | delimiter, |
| bool | preserve_empty = true ) const |
Given a delimiter, breaks the string into subsections, returning an array of each subsection.
If the String is empty, an empty String will be appended to the output if preserve_empty is true.
For example, StringView("The quick, dog,,jumped").splitString(',', true) would return {"The quick", " dog", "", "jumped"}
| [in] | delimiter | The delimiter to split the string |
| [in] | preserve_empty | If true, when two delimiters are encountered, an empty string is added to the return Buffer. If false, there will be no added empty strings. |
Referenced by TranslationTools::setupFile().
| StringViewBuffer StringView::split | ( | const Buffer< char > & | delimiter, |
| bool | preserve_empty = true ) const |
Given multiple delimiter, breaks the string view into subsections, returning an array of each subsection.
If the String is empty, an empty String will be appended to the output if preserve_empty is true. For example, StringView("The quick, dog,,jumped").splitString({',', ' '}, true) would return {"The", "quick", "dog", "", "jumped"}
| [in] | delimiter | The delimiter to split the string |
| [in] | preserve_empty | If true, when two delimiters are encountered, an empty string is added to the return Buffer. If false, there will be no added empty strings. |
| StringView StringView::splitPart | ( | char | delimiter, |
| uint04 | index ) const |
Returns a single part from splitting the string by the given delimiter.
| [in] | delimiter | The character to split the string on. |
| [in] | index | The zero-based index of the part to return. |
References StringView().
| void StringView::splitString | ( | char | delimiter, |
| StringViewBuffer & | strings, | ||
| bool | preserve_empty = true ) const |
Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given Buffer.
If the String is empty, an empty Buffer will be appended if preserve_empty is true.
| [in] | delimiter | The delimiter to split the string |
| [in] | preserve_empty | If true, when two delimiters are encountered, an empty string is added to the return Buffer. If false, there will be no added empty strings. |
| [out] | strings | will be appended with substrings that were broken apart from this string using the delimiter. |
| void StringView::splitString | ( | const Buffer< char > & | delimiter, |
| StringViewBuffer & | strings, | ||
| bool | preserve_empty = true ) const |
Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given Buffer.
If the String is empty, an empty String will be appended if preserve_empty is true.
| [in] | delimiter | The delimiter to split the string |
| [in] | preserve_empty | If true, when two delimiters are encountered, an empty string is added to the return Buffer. If false, there will be no added empty strings. |
| [out] | strings | will be appended with substrings that were broken apart from this string using the delimiter. |
|
inlinestaticconstexpr |
constexpr method to get the length of a null-terminated string at compile time
| [in] | value | A null terminated string. |
Definition at line 723 of file StringView.h.
References cast().
Referenced by StringView(), StringView(), indexOf(), operator=(), and operator=().
constexpr method to get the UTF8 length of a null-terminated string at compile time
| [in] | value | A null-terminated UTF16 wchar string. |
Definition at line 738 of file StringView.h.
References count().
| StringView StringView::substr | ( | uint04 | start | ) | const |
Creates a substring from a given start position, to the end of the string.
| [in] | start | The index where to start the substring. |
References StringView().
Referenced by TranslationTools::convertBrackets().
| StringView StringView::substr | ( | uint04 | start, |
| uint04 | end ) const |
Creates a substring from a given start position, to the given end position, non-inclusive of the end index.
If the end index is greater than the size of the string, all data past start is returned.
| [in] | start | the index where to start the substring. |
| [in] | end | the index where to end the substring (non-inclusive). |
References StringView(), and end().
| StringAllocatingView StringView::toLower | ( | ) | const |
changes all upper case characters into lower case characters.
| String StringView::toTitleString | ( | ) | const |
Formats the string to be a title, capitalizing important characters and replacing underscores with spaces.
| StringAllocatingView StringView::toUpper | ( | ) | const |
changes all lower case characters into upper case characters.
| StringView & StringView::trimWhiteSpace | ( | ) |
Trims leading and trailing whitespace from the string view.
References StringView().