Class that represents a ustring primitive type. More...
#include <SPL/Runtime/Type/UString.h>
Public Member Functions |
|
| ustring () | |
| ustring (const char *codepageData, const char *codepage=nullptr) | |
| ustring (const char *codepageData, int32_t dataSize) | |
| ustring (const char *codepageData, int32_t dataSize, const char *codepage) | |
| ustring (const ustring &src, int32_t srcStart) | |
| ustring (const ustring &src, int32_t srcStart, int32_t srcLength) | |
| ustring (UChar src) | |
| ustring (UChar32 src) | |
| ustring (const UChar *src) | |
| ustring (const UChar *src, int32_t srcLength) | |
| ustring (const ustring &src) | |
| ~ustring () | |
| Destructor. More... |
|
| ustring & | operator= (const ustring &src) |
| int32_t | length () const |
| const UChar * | getBuffer () const |
| bool | operator== (const ustring &rhs) const |
| bool | operator!= (const ustring &rhs) const |
| bool | operator> (const ustring &rhs) const |
| bool | operator>= (const ustring &rhs) const |
| bool | operator< (const ustring &rhs) const |
| bool | operator<= (const ustring &rhs) const |
| ustring & | operator+= (UChar ch) |
| ustring & | operator+= (UChar32 ch) |
| ustring & | operator+= (const ustring &str) |
| ustring & | append (const ustring &srcText, int32_t srcStart, int32_t srcLength) |
| ustring | at (uint32_t index) const |
| size_t | getSerializedSize () const |
| size_t | hashCode () const |
| int32_t | indexOf (ustring const &text) const |
| int32_t | indexOf (ustring const &text, int32_t start) const |
| int32_t | lastIndexOf (ustring const &text) const |
| int32_t | lastIndexOf (ustring const &text, int32_t start) const |
| bool | isEmpty () const |
| UChar32 | char32At (int32_t offset) const |
| UChar | charAt (int32_t offset) const |
| UChar | operator[] (int32_t offset) const |
| int32_t | moveIndex32 (int32_t index, int32_t delta) const |
| int32_t | countChar32 (int32_t start=0, int32_t length=INT_MAX) const |
| ustring & | toLower () |
| ustring & | toUpper () |
| int32_t | extract (int32_t start, int32_t startLength, char *target, const char *codepage=nullptr) const |
| int32_t | extract (int32_t start, int32_t startLength, char *target, uint32_t targetLength, const char *codepage) const |
| void | extract (int32_t start, int32_t length, ustring &target) const |
| void | remove () |
| Remove all the characters in a ustring. More... |
|
| void | remove (int32_t start, int32_t length=INT_MAX) |
| void | truncate (int32_t targetLength) |
| int8_t | compareCodePointOrder (const ustring &text) const |
| int8_t | compareCodePointOrder (int32_t start, int32_t length, const ustring &srcText) const |
Static Public Member Functions |
|
| static ustring | fromUTF8 (char const *str) |
| static ustring | fromUTF8 (char const *str, uint32_t len) |
| static ustring | fromUTF8 (std::string const &str) |
| static ustring | fromUTF8 (rstring const &str) |
| static rstring | toUTF8 (ustring const &str) |
| template<class T > | |
| static ustring | toString (T const &value) |
| static ustring | toString (rstring const &value) |
| static ustring | toString (ustring const &value) |
Class that represents a ustring primitive type.
|
explicit |
Default constructor
| SPL::ustring::ustring | ( | const char * | codepageData, |
| const char * | codepage = nullptr |
||
| ) |
Constructor
| codepageData | code page data to construct from |
| codepage | code page to use |
| SPL::ustring::ustring | ( | const char * | codepageData, |
| int32_t | dataSize | ||
| ) |
Constructor
| codepageData | code page data to construct from |
| dataSize | size of code page data in bytes |
| SPL::ustring::ustring | ( | const char * | codepageData, |
| int32_t | dataSize, | ||
| const char * | codepage | ||
| ) |
Constructor
| codepageData | code page data to construct from |
| dataSize | size of code page data in bytes |
| codepage | code page data is encoded in |
| SPL::ustring::ustring | ( | const ustring & | src, |
| int32_t | srcStart | ||
| ) |
Constructor
| src | string to construct from |
| srcStart | the offset into src at which to start copying |
| SPL::ustring::ustring | ( | const ustring & | src, |
| int32_t | srcStart, | ||
| int32_t | srcLength | ||
| ) |
Constructor
| src | string to construct from |
| srcStart | the offset into src at which to start copying |
| srcLength | number of characters to copy |
| SPL::ustring::ustring | ( | UChar | src | ) |
Constructor
| src | character to construct from |
| SPL::ustring::ustring | ( | UChar32 | src | ) |
Constructor
| src | character to construct from |
| SPL::ustring::ustring | ( | const UChar * | src | ) |
Constructor
| src | string to construct from |
| SPL::ustring::ustring | ( | const UChar * | src, |
| int32_t | srcLength | ||
| ) |
Constructor
| src | string to construct from |
| srcLength | number of characters to copy |
| SPL::ustring::ustring | ( | const ustring & | src | ) |
Copy Contrstructor
| src | string to construct from |
| SPL::ustring::~ustring | ( | ) |
Destructor.
Assignment operator
| src | ustring to assign |
| int32_t SPL::ustring::length | ( | ) | const |
Return the length of a ustring in UChars
| const UChar* SPL::ustring::getBuffer | ( | ) | const |
Return a pointer to the ustring as a series of UChars
|
inline |
Compare two unicode strings for equality
| rhs | ustring to compare to |
|
inline |
Compare two unicode strings for inequality
| rhs | ustring to compare to |
|
inline |
Compare two unicode strings for greater than
| rhs | ustring to compare to |
|
inline |
Compare two unicode strings for greater than or equal
| rhs | ustring to compare to |
|
inline |
Compare two unicode strings for less than
| rhs | ustring to compare to |
|
inline |
Compare two unicode strings for less than or equal
| rhs | ustring to compare to |
| ustring& SPL::ustring::operator+= | ( | UChar | ch | ) |
Append a character to a ustring
| ch | the code unit to be appended |
| ustring& SPL::ustring::operator+= | ( | UChar32 | ch | ) |
Append a character to a ustring
| ch | the code unit to be appended |
Append a ustring to a ustring
| str | the ustring to be appended |
Append a ustring to a ustring
| srcText | the ustring to be appended |
| srcStart | the offset into src at which to start copying |
| srcLength | number of characters to copy |
| ustring SPL::ustring::at | ( | uint32_t | index | ) | const |
Select one character from a unicode string
| index | logical character position |
| SPLRuntimeInvalidIndexException | exception if the index is out of range |
|
static |
Create from UTF-8
| str | source string |
| SPLRuntimeIllegalArgumentException | exception if the string is not legal UTF-8 |
|
static |
Create from UTF-8
| str | source string |
| len | size (in bytes) of the source String |
| SPLRuntimeIllegalArgumentException | exception if the string is not legal UTF-8 |
|
static |
Create from UTF-8
| str | source string |
| SPLRuntimeIllegalArgumentException | exception if the string is not legal UTF-8 |
Create from UTF-8
| str | source rstring |
| SPLRuntimeIllegalArgumentException | exception if the string is not legal UTF-8 |
Convert to UTF-8
| str | source ustring |
| size_t SPL::ustring::getSerializedSize | ( | ) | const |
Get the size in bytes when serialized
| size_t SPL::ustring::hashCode | ( | ) | const |
Get the hash code
| int32_t SPL::ustring::indexOf | ( | ustring const & | text | ) | const |
Locate in this the first occurrence of the characters in text, using bitwise comparison
| text | The text to search for |
| int32_t SPL::ustring::indexOf | ( | ustring const & | text, |
| int32_t | start | ||
| ) | const |
Locate in this the first occurrence of the characters in text, using bitwise comparison
| text | The text to search for |
| start | The offset at which searching will start |
| int32_t SPL::ustring::lastIndexOf | ( | ustring const & | text | ) | const |
Locate in this the last occurrence of the characters in text, using bitwise comparison
| text | The text to search for |
| int32_t SPL::ustring::lastIndexOf | ( | ustring const & | text, |
| int32_t | start | ||
| ) | const |
Locate in this the last occurrence of the characters in text, using bitwise comparison
| text | The text to search for |
| start | The offset at which searching will start |
| bool SPL::ustring::isEmpty | ( | ) | const |
Is this string empty?
| UChar32 SPL::ustring::char32At | ( | int32_t | offset | ) | const |
Return the code unit at offset offset
| offset | a valid offset into the text |
| UChar SPL::ustring::charAt | ( | int32_t | offset | ) | const |
Return the UChar at offset offset
| offset | a valid offset into the text |
|
inline |
Return the UChar at offset offset
| offset | a valid offset into the text |
| int32_t SPL::ustring::moveIndex32 | ( | int32_t | index, |
| int32_t | delta | ||
| ) | const |
Move the code unit index along the string by delta code points.
| index | input code unit index |
| delta | (signed) code point count to move the index forward or backward in the string |
| int32_t SPL::ustring::countChar32 | ( | int32_t | start = 0, |
| int32_t | length = INT_MAX |
||
| ) | const |
Count Unicode code points in the length UChar code units of the string
| start | the index of the first code unit to check |
| length | the number of UChar code units to check |
| ustring& SPL::ustring::toLower | ( | ) |
Convert to lower case
| ustring& SPL::ustring::toUpper | ( | ) |
Convert to upper case
| int32_t SPL::ustring::extract | ( | int32_t | start, |
| int32_t | startLength, | ||
| char * | target, | ||
| const char * | codepage = nullptr |
||
| ) | const |
Extract UChars from a ustring into a char buffer Copy the characters in the range [start, start + length) into the array dst
| start | offset of first character which will be copied into the array |
| startLength | the number of characters to extract |
| target | array in which to copy characters. The length of dst must be at least (dstStart + length) |
| codepage | the desired codepage for the characters. NULL has the special meaning of the default codepage. |
| int32_t SPL::ustring::extract | ( | int32_t | start, |
| int32_t | startLength, | ||
| char * | target, | ||
| uint32_t | targetLength, | ||
| const char * | codepage | ||
| ) | const |
Extract UChars from a ustring into a char buffer Copy the characters in the range [start, start + length) into the array dst
| start | offset of first character which will be copied into the array |
| startLength | the number of characters to extract |
| target | array in which to copy characters. The length of dst must be at least (dstStart + length) |
| targetLength | the size of the target buffer |
| codepage | the desired codepage for the characters. NULL has the special meaning of the default codepage. |
| void SPL::ustring::extract | ( | int32_t | start, |
| int32_t | length, | ||
| ustring & | target | ||
| ) | const |
Extract UChars from a ustring into a ustring Copy the characters in the range [start, start + length) into the target
| start | offset of first character which will be copied |
| length | the number of characters to extract |
| target | ustring to copy the characters to. |
| void SPL::ustring::remove | ( | ) |
Remove all the characters in a ustring.
| void SPL::ustring::remove | ( | int32_t | start, |
| int32_t | length = INT_MAX |
||
| ) |
Remove characters in a ustring
| start | the offset of the first character to remove |
| length | the number of characters to remove |
| void SPL::ustring::truncate | ( | int32_t | targetLength | ) |
Truncate this ustring to the targetLength
| targetLength | the desired length of this ustring; |
|
inlinestatic |
| int8_t SPL::ustring::compareCodePointOrder | ( | const ustring & | text | ) | const |
Compare two ustrings in code point order
| text | ustring to compare to |
| int8_t SPL::ustring::compareCodePointOrder | ( | int32_t | start, |
| int32_t | length, | ||
| const ustring & | srcText | ||
| ) | const |
Compare two ustrings in code point order
| start | The start offset in this string at which the compare operation begins. |
| length | The number of code units from this string to compare. |
| srcText | ustring to compare to |