#include <unicode.h>
Protected Member Functions | |
void | add (unicode_t unicode) |
Add (append) unicode to a utf8 encoded string. | |
ucs4_t | at (int position) |
Return unicode character found at a specific codepoint in the string. | |
unsigned | ccount (ucs4_t character) |
Count occurrences of a unicode character in string. | |
strsize_t | count (void) |
Count codepoints in current string. | |
char * | find (ucs4_t character, strsize_t start=0) |
Find first occurrence of character in string. | |
size_t | get (unicode_t unicode, size_t size) |
Extract a unicode byte sequence from utf8 object. | |
UString | get (strsize_t codepoint, strsize_t size=0) |
Get a new string object as a substring of the current object. | |
char * | operator() (int offset) |
Reference a string in the object by codepoint offset. | |
UString | operator() (int codepoint, strsize_t size) |
Get a new substring through object expression. | |
size_t | operator() (unicode_t unicode, size_t size) |
Extract a unicode byte sequence from utf8 object. | |
ucs4_t | operator[] (int position) |
Reference a unicode character in string object by array offset. | |
char * | rfind (ucs4_t character, strsize_t end=npos) |
Find last occurrence of character in string. | |
void | set (unicode_t unicode) |
Set a utf8 encoded string based on unicode data. | |
UString (UString &existing) | |
Construct a copy of a string object. | |
UString (unicode_t *text, unicode_t *end) | |
Create a string for a substring. | |
UString (char *text, strsize_t size) | |
Create a string from null terminated text up to a maximum specified size. | |
UString (unicode_t text) | |
Create a utf8 aware string for a null terminated unicode string. | |
UString (strsize_t size) | |
Create an empty string with a buffer pre-allocated to a specified size. | |
UString () | |
Create a new empty utf8 aware string object. | |
virtual | ~UString () |
Destroy string. |
This is derived from the classic uCommon String class by adding operations that are utf8 encoding aware.
Definition at line 183 of file unicode.h.
ucc::UString::UString | ( | strsize_t | size | ) | [protected] |
Create an empty string with a buffer pre-allocated to a specified size.
size | of buffer to allocate. |
ucc::UString::UString | ( | unicode_t | text | ) | [protected] |
ucc::UString::UString | ( | char * | text, | |
strsize_t | size | |||
) | [protected] |
ucc::UString::UString | ( | UString & | existing | ) | [protected] |
virtual ucc::UString::~UString | ( | ) | [protected, virtual] |
Destroy string.
De-reference cstring. If last reference to cstring, then also remove cstring from heap.
void ucc::UString::add | ( | unicode_t | unicode | ) | [protected] |
ucs4_t ucc::UString::at | ( | int | position | ) | [protected] |
Return unicode character found at a specific codepoint in the string.
position | of codepoint in string, negative values computed from end. |
Reimplemented from ucc::string.
unsigned ucc::UString::ccount | ( | ucs4_t | character | ) | [protected] |
Count occurrences of a unicode character in string.
character | code to search for. |
strsize_t ucc::UString::count | ( | void | ) | [inline, protected] |
size_t ucc::UString::get | ( | unicode_t | unicode, | |
size_t | size | |||
) | [protected] |
Get a new string object as a substring of the current object.
codepoint | offset of substring. | |
size | of substring in codepoints or 0 if to end. |
Reimplemented from ucc::string.
char* ucc::UString::operator() | ( | int | offset | ) | [protected] |
Get a new substring through object expression.
codepoint | offset of substring. | |
size | of substring or 0 if to end. |
Reimplemented from ucc::string.
size_t ucc::UString::operator() | ( | unicode_t | unicode, | |
size_t | size | |||
) | [inline, protected] |
ucs4_t ucc::UString::operator[] | ( | int | position | ) | [inline, protected] |
Reference a unicode character in string object by array offset.
position | of codepoint offset to character. |
Reimplemented from ucc::string.
void ucc::UString::set | ( | unicode_t | unicode | ) | [protected] |