Base Framework
|
Wide-character string. More...
#include <base/string/WideString.h>
Classes | |
class | Default |
struct | HashEntry |
Public Types | |
enum | WideEncoding { UTF16, UCS4 } |
enum | EncodingFlags { ADD_BOM = 1, EAT_BOM = 2, EXPECT_BOM = 4, ASSUME_NATIVE_BYTE_ORDER = 8, ASSUME_BE = 16, ASSUME_LE = 32 } |
typedef WideTraits | Traits |
typedef ucs4 | Char |
typedef ReferenceCountedAllocator< ucs4 >::Iterator | Iterator |
typedef ReferenceCountedAllocator< ucs4 >::ReadIterator | ReadIterator |
typedef ReferenceCountedAllocator< ucs4 >::Enumerator | Enumerator |
typedef ReferenceCountedAllocator< ucs4 >::ReadEnumerator | ReadEnumerator |
Public Member Functions | |
WideString () noexcept | |
WideString (Reference< ReferenceCountedAllocator< Char > > string) | |
WideString (MemorySize capacity) | |
WideString (Default d) | |
WideString (const Literal &string) | |
WideString (const WideLiteral &string) | |
WideString (const char *string) | |
WideString (const char *string, MemorySize length) | |
WideString (const wchar *string) | |
WideString (const wchar *string, MemorySize length) | |
WideString (const char16_t *string) | |
WideString (const char16_t *string, MemorySize length) | |
WideString (const char32_t *string) | |
WideString (const char32_t *string, MemorySize length) | |
WideString (const String &string) | |
WideString (const NativeWideString &string) | |
WideString (const NativeWideString &string, MemorySize maximum) | |
template<MemorySize SIZE> | |
WideString (const char(&string)[SIZE]) | |
WideString (const NativeString &string) | |
WideString (const NativeString &string, MemorySize maximum) | |
WideString (const WideString ©) noexcept | |
WideString (WideString &&move) noexcept | |
WideString (StringOutputStream &stream) | |
WideString (FormatOutputStream &stream) | |
WideString & | operator= (const WideString &assign) noexcept |
WideString & | operator= (WideString &&move) noexcept |
WideString & | operator= (const Literal &assign) |
WideString & | operator= (const WideLiteral &assign) |
WideString & | operator= (const char *assign) |
WideString & | operator= (const wchar *assign) |
WideString & | operator= (const char16_t *assign) |
WideString & | operator= (const char32_t *assign) |
WideString & | operator= (const String &assign) |
WideString & | operator= (const StringOutputStream &assign) |
template<MemorySize SIZE> | |
WideString & | operator= (const Char(&literal)[SIZE]) |
MemorySize | getLength () const noexcept |
bool | isEmpty () const noexcept |
bool | isProper () const noexcept |
bool | isASCII () const noexcept |
bool | isMultiReferenced () const noexcept |
MemorySize | getCapacity () const noexcept |
void | ensureCapacity (MemorySize capacity) |
void | clear () |
WideString | copy () const |
void | garbageCollect () |
void | forceToLength (MemorySize length) |
Iterator | getBeginIterator () noexcept |
Iterator | getEndIterator () noexcept |
ReadIterator | getBeginReadIterator () const noexcept |
ReadIterator | getEndReadIterator () const noexcept |
ReadIterator | begin () const noexcept |
ReadIterator | end () const noexcept |
Enumerator | getEnumerator () noexcept |
ReadEnumerator | getReadEnumerator () const noexcept |
ucs4 | getAt (MemorySize index) const |
void | setAt (MemorySize index, ucs4 value) |
Element | operator[] (MemorySize index) |
operator bool () const noexcept | |
char | operator[] (MemorySize index) const |
WideString & | remove (MemorySize start, MemorySize end) |
WideString & | removeFrom (MemorySize start) |
WideString & | removeAt (MemorySize index) |
WideString & | append (ucs4 ch) |
WideString & | append (const WideString &string) |
WideString & | append (const String &string) |
WideString & | append (const WideLiteral &string) |
WideString & | append (const NativeWideString &string) |
WideString & | append (const char *string) |
WideString & | append (const wchar *string) |
WideString & | append (const WideLiteral &string, MemorySize maximum) |
WideString & | append (const NativeWideString &string, MemorySize maximum) |
WideString & | append (const ConstSpan< Char > &buffer) |
WideString & | append (const wchar *string, MemorySize maximum) |
WideString & | prepend (ucs4 ch) |
WideString & | prepend (const WideString &string) |
WideString & | insert (MemorySize index, const ConstSpan< Char > &span) |
WideString & | insert (MemorySize index, const ConstSpan< wchar > &src) |
WideString & | insert (MemorySize index, ucs4 ch) |
WideString & | insert (MemorySize index, const WideString &string) |
WideString & | insert (MemorySize index, const WideLiteral &string) |
template<MemorySize SIZE> | |
WideString & | insert (MemorySize index, const Char(&literal)[SIZE]) |
WideString & | insert (MemorySize index, const NativeWideString &string) |
WideString & | insert (MemorySize index, const wchar *string) |
WideString & | insert (MemorySize index, const char *string) |
WideString & | replace (MemorySize start, MemorySize end, const WideString &string) |
MemorySize | replaceAll (const WideString &fromStr, const WideString &toStr) |
WideString | substring (MemorySize start, MemorySize end) const |
WideString | substring (MemorySize start) const |
WideString & | operator+= (const WideString &suffix) |
WideString & | operator+= (const String &suffix) |
WideString & | operator+= (const WideLiteral &suffix) |
WideString & | operator+= (const wchar *suffix) |
WideString & | operator+= (const NativeWideString &suffix) |
WideString & | operator+= (Char suffix) |
WideString & | operator-= (const WideString &suffix) |
WideString & | reverse () noexcept |
WideString & | toLowerCase () noexcept |
WideString & | toUpperCase () noexcept |
int | compareTo (const WideString &string) const noexcept |
int | compareTo (const WideLiteral &string) const |
int | compareTo (const wchar *string) const |
int | compareTo (const NativeWideString &string) const |
int | compareToIgnoreCase (const WideString &string) const noexcept |
template<MemorySize SIZE> | |
int | compareToIgnoreCase (const Char(&literal)[SIZE]) const noexcept |
bool | startsWith (const WideString &prefix) const |
bool | startsWith (const WideLiteral &prefix) const |
template<MemorySize SIZE> | |
bool | startsWith (const Char(&prefix)[SIZE]) const |
bool | endsWith (const WideString &suffix) const |
bool | endsWith (const WideLiteral &suffix) const |
template<MemorySize SIZE> | |
bool | endsWith (const char(&suffix)[SIZE]) const |
bool | operator== (const WideString &string) const noexcept |
bool | operator!= (const WideString &string) const noexcept |
bool | operator== (const WideLiteral &string) const noexcept |
bool | operator< (const WideString &string) const noexcept |
bool | operator<= (const WideString &string) const noexcept |
bool | operator>= (const WideString &string) const noexcept |
bool | operator> (const WideString &string) const noexcept |
MemoryDiff | indexOf (ucs4 ch, MemorySize start=0) const noexcept |
MemoryDiff | indexOf (const WideString &string, MemorySize start=0) const noexcept |
MemoryDiff | lastIndexOf (ucs4 ch, MemorySize start) const noexcept |
MemoryDiff | lastIndexOf (ucs4 ch) const noexcept |
MemoryDiff | lastIndexOf (const WideString &string, MemorySize start) const noexcept |
MemoryDiff | lastIndexOf (const WideString &string) const noexcept |
MemorySize | count (ucs4 ch, MemorySize start=0) const noexcept |
MemorySize | count (const WideString &string, MemorySize start=0) const noexcept |
bool | isUpperCased () const noexcept |
bool | isLowerCased () const noexcept |
bool | isTitleCased () const noexcept |
WideString & | trim (ucs4 character=' ') |
MemoryDiff | search (const WideString &substring, MemorySize start=0) const noexcept |
Array< WideString > | split (Char separator, bool group=false) const |
const Reference< ReferenceCountedAllocator< Char > > & | getContainer () const |
Char * | getElements () |
bool | invariant () const noexcept |
const Char * | getElements () const noexcept |
const Char * | getEnd () const noexcept |
bool | hasNull () const noexcept |
ConstSpan< ucs4 > | getSpan () const noexcept |
const Char * | native () const noexcept |
bool | isValidUnicode (bool iso=false) const noexcept |
WideString | getValidUnicode (bool iso=false) const |
Static Public Member Functions | |
static WideString | makeLength (MemorySize length) |
static WideString | makeCapacity (MemorySize capacity) |
static ConstSpan< wchar > | toSpan (const wchar *string) noexcept |
Static Public Attributes | |
static constexpr MemorySize | MAXIMUM_LENGTH = (PrimitiveTraits<int>::MAXIMUM/sizeof(ucs4) - 1) |
static constexpr unsigned int | HASH_MODULUS = 1455 |
static const HashEntry | hashTable [] |
static const uint32 | mappingTable [] |
static constexpr unsigned int | MAXIMUM_MULTIBYTES = 6 |
static constexpr ucs4 | BOM = 0x0000feff |
Protected Member Functions | |
void | initialize (const char *string, MemorySize length) |
void | initialize (const wchar *string, MemorySize length) |
void | initialize (const char16_t *string, MemorySize length) |
void | initialize (const ucs4 *string, MemorySize length) |
Char * | getBuffer () |
Char * | getBuffer (MemorySize length) |
const Char * | getBuffer () const noexcept |
void | setLength (MemorySize length) |
Static Protected Member Functions | |
static int | compareToIgnoreCase (const ucs4 *left, const ucs4 *right) noexcept |
Wide-character string.
Wide-character string implementation. The first modifying operation on a string may force the internal buffer to be duplicated. The implementation is currently NOT MT-safe.
typedef ReferenceCountedAllocator<ucs4>::Enumerator WideString::Enumerator |
The type of the modifying string enumerator.
typedef ReferenceCountedAllocator<ucs4>::Iterator WideString::Iterator |
The type of the modifying string iterator.
typedef ReferenceCountedAllocator<ucs4>::ReadEnumerator WideString::ReadEnumerator |
The type of the non-modifying string enumerator.
typedef ReferenceCountedAllocator<ucs4>::ReadIterator WideString::ReadIterator |
The type of the non-modifying string iterator.
typedef WideTraits WideString::Traits |
Character specific properties and manipulators.
Encoding flags.
|
noexcept |
Initializes an empty string. No allocation done.
|
explicit |
Initializes a string with no characters in it and the given initial capacity.
capacity | The initial capacity. |
WideString::WideString | ( | Default | d | ) |
Forces a non-null empty string. Avoid this.
WideString::WideString | ( | const Literal & | string | ) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
WideString::WideString | ( | const WideLiteral & | string | ) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
WideString::WideString | ( | const char * | string | ) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
WideString::WideString | ( | const char * | string, |
MemorySize | length | ||
) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
length | The length of the string. |
WideString::WideString | ( | const wchar * | string | ) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
WideString::WideString | ( | const wchar * | string, |
MemorySize | length | ||
) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
length | The length of the string. |
WideString::WideString | ( | const char16_t * | string | ) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
WideString::WideString | ( | const char16_t * | string, |
MemorySize | length | ||
) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
length | The length of the string. |
WideString::WideString | ( | const char32_t * | string | ) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
WideString::WideString | ( | const char32_t * | string, |
MemorySize | length | ||
) |
Initializes the string from a string literal. The string literal is not copied into internal buffer. Implicit initialization is allowed.
string | The string. |
length | The length of the string. |
WideString::WideString | ( | const String & | string | ) |
Initializes the string from UTF-8 string.
WideString::WideString | ( | const NativeWideString & | string | ) |
Initializes the string from a NULL-terminated string.
string | NULL-terminated string. If NULL, the string is initialized with no characters in it. |
WideString::WideString | ( | const NativeWideString & | string, |
MemorySize | maximum | ||
) |
Initializes the string from a NULL-terminated string. If the length of the specified string (string) exceeds the maximum length (n) only the first n characters are used. Raises StringException is string exceeds the maximum allowed length.
string | NULL-terminated string. If NULL, the string is initialized with no characters in it. |
maximum | Specifies the maximum length. |
|
inline |
Initializes string from a NULL-terminated multibyte character string.
string | The NULL-terminated string. |
WideString::WideString | ( | const NativeString & | string | ) |
Initializes the string from a NULL-terminated string.
string | NULL-terminated string. If nullptr, the string is initialized with no characters in it. |
WideString::WideString | ( | const NativeString & | string, |
MemorySize | maximum | ||
) |
Initializes string from a NULL-terminated multibyte string.
string | The NULL-terminated string. |
maxmimum | The maximum length of the string. |
|
inlinenoexcept |
Initializes string from other string.
|
inlinenoexcept |
Initializes string from other string.
WideString::WideString | ( | StringOutputStream & | stream | ) |
Initializes string from string output stream. Forces flush().
WideString::WideString | ( | FormatOutputStream & | stream | ) |
Initializes string from string output stream via FormatOutputStream. Forces flush(). Throws exception if not a StringOutputStream.
|
inline |
Appends the native string to this string.
string | The native string to be appended. |
WideString& WideString::append | ( | const ConstSpan< Char > & | buffer | ) |
Appends span.
|
inline |
Appends the NULL-terminated string to this string.
string | The string to be appended. |
WideString& WideString::append | ( | const NativeWideString & | string, |
MemorySize | maximum | ||
) |
Appends the NULL-terminated string to this string.
string | The string to be appended. |
maximum | The maximum length of the string to be appended. |
|
inline |
Appends the string to this string.
string | The string to be appended. |
|
inline |
Appends the native string to this string.
string | The native string to be appended. |
WideString& WideString::append | ( | const wchar * | string, |
MemorySize | maximum | ||
) |
Appends the NULL-terminated string to this string.
string | The string to be appended. |
maximum | The maximum length of the to be appended string. |
WideString& WideString::append | ( | const WideLiteral & | string | ) |
Appends the string literal to this string.
string | The string to be appended. |
WideString& WideString::append | ( | const WideLiteral & | string, |
MemorySize | maximum | ||
) |
Appends the string literal to this string.
string | The string to be appended. |
maximum | The maximum length of the string to be appended. |
|
inline |
Appends the string to this string.
string | The string to be appended. |
|
inline |
Appends the character to this string.
ch | The character to be appended. |
|
inlinenoexcept |
Returns the first element of the string as a non-modifying iterator.
void WideString::clear | ( | ) |
Clears the string.
|
inline |
Compares this string with a NULL-terminated string.
string | The string to compare this string with. |
int WideString::compareTo | ( | const wchar * | string | ) | const |
Compares this string with NULL-terminated string.
string | The string to compare this string with. |
int WideString::compareTo | ( | const WideLiteral & | string | ) | const |
Compares this string to with string literal.
string | The string to compare this string with. |
|
noexcept |
Compare this string with another string.
string | The string to compare this string with. |
|
staticprotectednoexcept |
Compare the NULL-terminated strings ignoring the case.
|
noexcept |
Compares this string with NULL-terminated string ignoring the case of the characters.
string | The string to compare this string with. |
WideString WideString::copy | ( | ) | const |
Returns a forced copy of the string.
|
noexcept |
Counts the number of occurances of the specified substring in this string.
string | The substring to be counted. |
start | The start position. Default is 0. |
|
noexcept |
Returns the number of occurances of the specified character in this string.
ch | The character to be counted. |
start | The start position. Default is 0. |
|
inlinenoexcept |
Returns the end of the string as a non-modifying iterator.
|
inline |
Returns true if this string ends with prefix.
suffix | The string to compare end of this string with. |
bool WideString::endsWith | ( | const WideLiteral & | suffix | ) | const |
Returns true if this string ends with the specified suffix.
suffix | The string to compare end of this string with. |
bool WideString::endsWith | ( | const WideString & | suffix | ) | const |
Returns true if this string ends with the specified suffix.
suffix | The string to compare end of this string with. |
void WideString::ensureCapacity | ( | MemorySize | capacity | ) |
Ensures that the capacity of the buffer is at least equal to the specified minimum. This applies to all shared strings.
capacity | Specifies the minimum capacity of the string. |
void WideString::forceToLength | ( | MemorySize | length | ) |
Sets the length of the string without initializing the elements.
void WideString::garbageCollect | ( | ) |
Releases any unused capacity of the string. This applies to all shared strings.
ucs4 WideString::getAt | ( | MemorySize | index | ) | const |
Returns the character at the specified index in this string. Raises OutOfRange if index exceeds the length of the string.
|
inlinenoexcept |
Returns the first element of the string as a modifying iterator.
|
inlinenoexcept |
Returns the first element of the string as a non-modifying iterator.
|
protected |
Returns a modifiable buffer. Forces copy of internal buffer if shared by multiple strings.
|
inlineprotectednoexcept |
Returns a non-modifiable buffer.
|
protected |
Returns buffer for modification and resizes at the same time.
|
inlinenoexcept |
Returns the capacity of the string.
|
inline |
Returns the internal container.
Char* WideString::getElements | ( | ) |
Returns NULL-terminated string for modifying access.
|
inlinenoexcept |
Returns NULL-terminated string.
|
inlinenoexcept |
Returns the end of string.
|
inlinenoexcept |
Returns the end of the string as a modifying iterator.
|
inlinenoexcept |
Returns the end of the string as a non-modifying iterator.
|
inlinenoexcept |
Returns a modifying enumerator of the string.
|
inlinenoexcept |
Returns the number of characters in the string.
|
inlinenoexcept |
Returns a non-modifying enumerator of the string.
|
inlinenoexcept |
Returns the internal buffer.
WideString WideString::getValidUnicode | ( | bool | iso = false | ) | const |
Returns the string with all invalid Unicode codes removed.
@iso Specifies the ISO codes should be allowed.
|
noexcept |
Returns true if the NULL is used within the string.
|
noexcept |
Returns the index of the first substring that matches the specified string after the start position.
string | The substring to find. |
start | Specifies the start position of the search. Default is 0. |
|
noexcept |
Returns the index of the first character that matches the specified character after the start position.
ch | The character to find. |
start | Specifies the start position of the search. Default is 0. |
|
protected |
Initializes string.
|
protected |
Initializes string.
|
protected |
Initializes string.
|
protected |
Initializes string.
|
inline |
Inserts NULL-terminated string into this string.
index | Specifies the position to insert the string. If the index exceeds the end of this string the string is inserted at the end. |
string | The NULL-terminated string to be inserted. |
WideString& WideString::insert | ( | MemorySize | index, |
const ConstSpan< Char > & | span | ||
) |
Inserts the span into this string.
index | Specifies the position to insert the character. If the index exceeds the end of this string the character is inserted at the end. |
span | The characters to be inserted. |
WideString& WideString::insert | ( | MemorySize | index, |
const ConstSpan< wchar > & | src | ||
) |
Inserts the span into this string.
index | Specifies the position to insert the character. If the index exceeds the end of this string the character is inserted at the end. |
span | The characters to be inserted. |
WideString& WideString::insert | ( | MemorySize | index, |
const NativeWideString & | string | ||
) |
Inserts NULL-terminated string into this string.
index | Specifies the position to insert the string. If the index exceeds the end of this string the string is inserted at the end. |
string | The NULL-terminated string to be inserted. |
|
inline |
Inserts NULL-terminated string into this string.
index | Specifies the position to insert the string. If the index exceeds the end of this string the string is inserted at the end. |
string | The NULL-terminated string to be inserted. |
WideString& WideString::insert | ( | MemorySize | index, |
const WideLiteral & | string | ||
) |
Inserts the string literal into this string.
index | Specifies the position to insert the string. If the index exceeds the end of this string the string is inserted at the end. |
string | The string literal to be inserted. |
WideString& WideString::insert | ( | MemorySize | index, |
const WideString & | string | ||
) |
Inserts the string into this string.
index | Specifies the position to insert the string. If the index exceeds the end of this string the string is inserted at the end. |
string | The string to be inserted. |
WideString& WideString::insert | ( | MemorySize | index, |
ucs4 | ch | ||
) |
Inserts the character into this string.
index | Specifies the position to insert the character. If the index exceeds the end of this string the character is inserted at the end. |
ch | The character to be inserted. |
|
inlinenoexcept |
Returns true if state is valid.
|
noexcept |
Returns true if the string is an ASCII string.
|
inlinenoexcept |
Returns true if the string does not contain characters.
|
noexcept |
Returns true if the string is lower case.
|
noexcept |
Returns true if the string has multiple references.
|
inlinenoexcept |
Returns true if the string contains characters.
|
noexcept |
Returns true if the string is title cased.
|
noexcept |
Returns true if the string is upper cased.
|
noexcept |
Returns true if the string has valid Unicode codes.
@iso Specifies the ISO codes should be allowed.
|
inlinenoexcept |
Returns the index of the last string that matches the specified string starting from the end of the string.
string | The substring to find. |
|
noexcept |
Returns the index of the last substring that matches the specified string before the start position.
string | The substring to find. |
start | Specifies the start position of the search. |
|
inlinenoexcept |
Returns the index of the last character that matches the specified character.
ch | The character to find. |
|
noexcept |
Returns the index of the last character that matches the specified character before the start position.
ch | The character to find. |
start | Specifies the start position of the search. Default is end of string. |
|
inlinestatic |
Returns an empty string with the given capacity.
|
inlinestatic |
Returns a new string of the given length.
|
inlinenoexcept |
Returns the characters of the string for non-modifying access.
|
inlinenoexcept |
Returns true if non-empty.
|
inlinenoexcept |
Inequality operator.
|
inline |
Appends the character to this string.
suffix | The character to be appended. |
|
inline |
Appends the string to this string.
suffix | The character to be appended. |
|
inline |
Appends the string to this string.
suffix | The string to be appended. |
|
inline |
Appends the string to this string.
suffix | The character to be appended. |
|
inline |
Appends the literal to this string.
suffix | The character to be appended. |
|
inline |
Appends the string to this string.
suffix | The string to be appended. |
WideString& WideString::operator-= | ( | const WideString & | suffix | ) |
String reduction operator. Removes suffix from this string if and only if it ends with the suffix (e.g. ("presuf"-"suf") results in a new string "pre" whereas ("pre"-"suf") results in "pre").
suffix | The suffix to be removed. |
|
inlinenoexcept |
Less than operator.
|
inlinenoexcept |
Less than or equal operator.
WideString& WideString::operator= | ( | const char * | assign | ) |
Assignment of string to string.
|
inline |
Assignment of string to string.
WideString& WideString::operator= | ( | const char16_t * | assign | ) |
Assignment of string to string.
WideString& WideString::operator= | ( | const char32_t * | assign | ) |
Assignment of string to string.
WideString& WideString::operator= | ( | const Literal & | assign | ) |
Assignment of string to string.
WideString& WideString::operator= | ( | const String & | assign | ) |
Assignment of string to string.
WideString& WideString::operator= | ( | const StringOutputStream & | assign | ) |
Assignment of string to string.
WideString& WideString::operator= | ( | const wchar * | assign | ) |
Assignment of string to string.
WideString& WideString::operator= | ( | const WideLiteral & | assign | ) |
Assignment of string to string.
|
inlinenoexcept |
Assignment of string to string.
|
inlinenoexcept |
Equality operator.
|
inlinenoexcept |
Equality operator.
|
inlinenoexcept |
Greater than operator.
|
inlinenoexcept |
Greater than or equal operator.
|
inline |
Returns a reference to character at the specified index. Raises OutOfRange if index exceeds the length of the string.
|
inline |
Returns the character at the specified index. Raises OutOfRange if index exceeds the length of the string.
|
inline |
Prepends the string to this string.
string | The string to be prepended. |
|
inline |
Prepends the character to this string.
ch | The character to be prepended. |
WideString& WideString::remove | ( | MemorySize | start, |
MemorySize | end | ||
) |
Removes the characters in a substring of this string.
start | Specifies the start of the substring. |
end | Specifies the end of the substring. |
|
inline |
Removes the character at the specified position in this string.
index | Specifies the character to be removed. |
WideString& WideString::removeFrom | ( | MemorySize | start | ) |
Removes the characters from the specified index to the end of the string.
start | Specifies the start of the string. |
WideString& WideString::replace | ( | MemorySize | start, |
MemorySize | end, | ||
const WideString & | string | ||
) |
Replaces the characters in a substring of this string with the characters in the specified string.
start | The start of the substring. |
end | The end of the substring. |
string | The string to replace with. |
MemorySize WideString::replaceAll | ( | const WideString & | fromStr, |
const WideString & | toStr | ||
) |
Replaces all occurances of the specified substring with another string in this string. Only does one pass of this string.
fromStr | The substring to be replaced. |
toStr | The new string. |
|
noexcept |
The character sequence contained in this string is replaced by the reverse sequence.
|
noexcept |
Returns the index of the first substring that matches the specified string after the start position. The implementation is based on the "Boyer-Moore Fast String Searching Algorithm".
string | The substring to find. |
start | Specifies the start position of the search. Default is 0. |
void WideString::setAt | ( | MemorySize | index, |
ucs4 | value | ||
) |
Sets the character at the specified index of this string. If the new character is the string terminator ('\0') then the string is cut off from the specified index. Raises OutOfRange if index exceeds the length of the string.
index | The index of the character to set. |
value | The new character value. |
|
inlineprotected |
Sets the length of the string.
Array<WideString> WideString::split | ( | Char | separator, |
bool | group = false |
||
) | const |
|
inline |
Returns true if this string starts with the specified prefix.
prefix | The string to compare start of this string with. |
bool WideString::startsWith | ( | const WideLiteral & | prefix | ) | const |
Returns true if this string starts with the specified prefix.
prefix | The string to compare start of this string with. |
bool WideString::startsWith | ( | const WideString & | prefix | ) | const |
Returns true if this string starts with the specified prefix.
prefix | The string to compare start of this string with. |
|
inline |
Returns a new string that contains a subsequence of characters currently contained in this string. The substring begins at the specified index and extends to the end of the string.
start | Specifies the start of the substring. |
WideString WideString::substring | ( | MemorySize | start, |
MemorySize | end | ||
) | const |
Returns a new string that contains a subsequence of characters currently contained in this string. If 'end' is less than 'start' an empty string is returned.
start | Specifies the start of the substring. |
end | Specifies the end of the substring. |
|
noexcept |
Converts the characters of this string into the lower case equivalents.
|
inlinestaticnoexcept |
Returns the span.
|
noexcept |
Converts the characters of this string into the upper case equivalents.
WideString& WideString::trim | ( | ucs4 | character = ' ' | ) |
Trims the string.
character | The character to remove. |
|
staticconstexpr |
Specifies the byte order mark.
|
staticconstexpr |
Hash modulus.
|
static |
Character mapping table for caseless matching.
|
staticconstexpr |
Specifies the maximum length of any string. Guarantees that an int can hold the length of the string.
|
staticconstexpr |
Specifies the maximum number of bytes per character for any supported encoding.