Crazy Eddie's GUI System
0.8.7
|
String class used within the GUI system. More...
Classes | |
class | const_iterator |
const iterator for String. More... | |
class | iterator |
regular iterator for String. More... | |
Public Types | |
typedef utf32 | value_type |
Basic 'code point' type used for String (utf32) | |
typedef size_t | size_type |
Unsigned type used for size values and indices. | |
typedef std::ptrdiff_t | difference_type |
Signed type used for differences. | |
typedef utf32 & | reference |
Type used for utf32 code point references. | |
typedef const utf32 & | const_reference |
Type used for constant utf32 code point references. | |
typedef utf32 * | pointer |
Type used for utf32 code point pointers. | |
typedef const utf32 * | const_pointer |
Type used for constant utf32 code point pointers. | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Constant reverse iterator class for String objects. | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Reverse iterator class for String objects. | |
Public Member Functions | |
String (void) | |
Constructs an empty string. | |
~String (void) | |
Destructor for String objects. | |
String (const String &str) | |
Copy constructor - Creates a new string with the same value as str. More... | |
String (const String &str, size_type str_idx, size_type str_num=npos) | |
Constructs a new string initialised with code points from another String object. More... | |
String (const std::string &std_str) | |
Constructs a new string and initialises it using the std::string std_str. More... | |
String (const std::string &std_str, size_type str_idx, size_type str_num=npos) | |
Constructs a new string initialised with characters from the given std::string object. More... | |
String (const utf8 *utf8_str) | |
Constructs a new String object and initialise it using the provided utf8 encoded string buffer. More... | |
String (const utf8 *utf8_str, size_type chars_len) | |
Constructs a new String object and initialise it using the provided utf8 encoded string buffer. More... | |
String (size_type num, utf32 code_point) | |
Constructs a new String that is initialised with the specified code point. More... | |
String (const_iterator iter_beg, const_iterator iter_end) | |
Construct a new string object and initialise it with code-points from the range [beg, end). More... | |
String (const char *cstr) | |
Constructs a new String object and initialise it using the provided c-string. More... | |
String (const char *chars, size_type chars_len) | |
Constructs a new String object and initialise it using characters from the provided char array. More... | |
size_type | size (void) const |
Returns the size of the String in code points. More... | |
size_type | length (void) const |
Returns the size of the String in code points. More... | |
bool | empty (void) const |
Returns true if the String is empty. More... | |
size_type | max_size (void) const |
Returns the maximum size of a String. More... | |
size_type | capacity (void) const |
Return the number of code points that the String could hold before a re-allocation would be required. More... | |
void | reserve (size_type num=0) |
Specifies the amount of reserve capacity to allocate. More... | |
int | compare (const String &str) const |
Compares this String with the String 'str'. More... | |
int | compare (size_type idx, size_type len, const String &str, size_type str_idx=0, size_type str_len=npos) const |
Compares code points from this String with code points from the String 'str'. More... | |
int | compare (const std::string &std_str) const |
Compares this String with the std::string 'std_str'. More... | |
int | compare (size_type idx, size_type len, const std::string &std_str, size_type str_idx=0, size_type str_len=npos) const |
Compares code points from this String with code points from the std::string 'std_str'. More... | |
int | compare (const utf8 *utf8_str) const |
Compares this String with the null-terminated utf8 encoded 'utf8_str'. More... | |
int | compare (size_type idx, size_type len, const utf8 *utf8_str) const |
Compares code points from this String with the null-terminated utf8 encoded 'utf8_str'. More... | |
int | compare (size_type idx, size_type len, const utf8 *utf8_str, size_type str_cplen) const |
Compares code points from this String with the utf8 encoded data in buffer 'utf8_str'. More... | |
int | compare (const char *cstr) const |
Compares this String with the given c-string. More... | |
int | compare (size_type idx, size_type len, const char *cstr) const |
Compares code points from this String with the given c-string. More... | |
int | compare (size_type idx, size_type len, const char *chars, size_type chars_len) const |
Compares code points from this String with chars in the given char array. More... | |
reference | operator[] (size_type idx) |
Returns the code point at the given index. More... | |
value_type | operator[] (size_type idx) const |
Returns the code point at the given index. More... | |
reference | at (size_type idx) |
Returns the code point at the given index. More... | |
const_reference | at (size_type idx) const |
Returns the code point at the given index. More... | |
const char * | c_str (void) const |
Returns contents of the String as a null terminated string of utf8 encoded data. More... | |
const utf8 * | data (void) const |
Returns contents of the String as utf8 encoded data. More... | |
utf32 * | ptr (void) |
Returns a pointer to the buffer in use. | |
const utf32 * | ptr (void) const |
Returns a pointer to the buffer in use. (const version) | |
size_type | copy (utf8 *buf, size_type len=npos, size_type idx=0) const |
Copies an area of the String into the provided buffer as encoded utf8 data. More... | |
size_type | utf8_stream_len (size_type num=npos, size_type idx=0) const |
Return the number of utf8 code units required to hold an area of the String when encoded as utf8 data. More... | |
String & | operator= (const String &str) |
Assign the value of String str to this String. More... | |
String & | assign (const String &str, size_type str_idx=0, size_type str_num=npos) |
Assign a sub-string of String str to this String. More... | |
String & | operator= (const std::string &std_str) |
Assign the value of std::string std_str to this String. More... | |
String & | assign (const std::string &std_str, size_type str_idx=0, size_type str_num=npos) |
Assign a sub-string of std::string std_str to this String. More... | |
String & | operator= (const utf8 *utf8_str) |
Assign to this String the string value represented by the given null-terminated utf8 encoded data. More... | |
String & | assign (const utf8 *utf8_str) |
Assign to this String the string value represented by the given null-terminated utf8 encoded data. More... | |
String & | assign (const utf8 *utf8_str, size_type str_num) |
Assign to this String the string value represented by the given utf8 encoded data. More... | |
String & | operator= (utf32 code_point) |
Assigns the specified utf32 code point to this String. Result is always a String 1 code point in length. More... | |
String & | assign (size_type num, utf32 code_point) |
Assigns the specified code point repeatedly to the String. More... | |
String & | operator= (const char *cstr) |
Assign to this String the given C-string. More... | |
String & | assign (const char *cstr) |
Assign to this String the given C-string. More... | |
String & | assign (const char *chars, size_type chars_len) |
Assign to this String a number of chars from a char array. More... | |
void | swap (String &str) |
Swaps the value of this String with the given String str. More... | |
String & | operator+= (const String &str) |
Appends the String str. More... | |
String & | append (const String &str, size_type str_idx=0, size_type str_num=npos) |
Appends a sub-string of the String str. More... | |
String & | operator+= (const std::string &std_str) |
Appends the std::string std_str. More... | |
String & | append (const std::string &std_str, size_type str_idx=0, size_type str_num=npos) |
Appends a sub-string of the std::string std_str. More... | |
String & | operator+= (const utf8 *utf8_str) |
Appends to the String the null-terminated utf8 encoded data in the buffer utf8_str. More... | |
String & | append (const utf8 *utf8_str) |
Appends to the String the null-terminated utf8 encoded data in the buffer utf8_str. More... | |
String & | append (const utf8 *utf8_str, size_type len) |
Appends to the String the utf8 encoded data in the buffer utf8_str. More... | |
String & | operator+= (utf32 code_point) |
Appends a single code point to the string. More... | |
String & | append (size_type num, utf32 code_point) |
Appends a single code point multiple times to the string. More... | |
void | push_back (utf32 code_point) |
Appends a single code point to the string. More... | |
String & | append (const_iterator iter_beg, const_iterator iter_end) |
Appends the code points in the reange [beg, end) More... | |
String & | operator+= (const char *cstr) |
Appends to the String the given c-string. More... | |
String & | append (const char *cstr) |
Appends to the String the given c-string. More... | |
String & | append (const char *chars, size_type chars_len) |
Appends to the String chars from the given char array. More... | |
String & | insert (size_type idx, const String &str) |
Inserts the given String object at the specified position. More... | |
String & | insert (size_type idx, const String &str, size_type str_idx, size_type str_num) |
Inserts a sub-string of the given String object at the specified position. More... | |
String & | insert (size_type idx, const std::string &std_str) |
Inserts the given std::string object at the specified position. More... | |
String & | insert (size_type idx, const std::string &std_str, size_type str_idx, size_type str_num) |
Inserts a sub-string of the given std::string object at the specified position. More... | |
String & | insert (size_type idx, const utf8 *utf8_str) |
Inserts the given null-terminated utf8 encoded data at the specified position. More... | |
String & | insert (size_type idx, const utf8 *utf8_str, size_type len) |
Inserts the given utf8 encoded data at the specified position. More... | |
String & | insert (size_type idx, size_type num, utf32 code_point) |
Inserts a code point multiple times into the String. More... | |
void | insert (iterator pos, size_type num, utf32 code_point) |
Inserts a code point multiple times into the String. More... | |
iterator | insert (iterator pos, utf32 code_point) |
Inserts a single code point into the String. More... | |
void | insert (iterator iter_pos, const_iterator iter_beg, const_iterator iter_end) |
Inserts code points specified by the range [beg, end). More... | |
String & | insert (size_type idx, const char *cstr) |
Inserts the given c-string at the specified position. More... | |
String & | insert (size_type idx, const char *chars, size_type chars_len) |
Inserts chars from the given char array at the specified position. More... | |
void | clear (void) |
Removes all data from the String. More... | |
String & | erase (void) |
Removes all data from the String. More... | |
String & | erase (size_type idx) |
Erase a single code point from the string. More... | |
String & | erase (size_type idx, size_type len) |
Erase a range of code points. More... | |
String & | erase (iterator pos) |
Erase the code point described by the given iterator. More... | |
String & | erase (iterator iter_beg, iterator iter_end) |
Erase a range of code points described by the iterators [beg, end). More... | |
void | resize (size_type num) |
Resizes the String either by inserting default utf32 code points to make it larger, or by truncating to make it smaller. More... | |
void | resize (size_type num, utf32 code_point) |
Resizes the String either by inserting the given utf32 code point to make it larger, or by truncating to make it smaller. More... | |
String & | replace (size_type idx, size_type len, const String &str) |
Replace code points in the String with the specified String object. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const String &str) |
Replace the code points in the range [beg, end) with the specified String object. More... | |
String & | replace (size_type idx, size_type len, const String &str, size_type str_idx, size_type str_num) |
Replace code points in the String with a specified sub-string of a given String object. More... | |
String & | replace (size_type idx, size_type len, const std::string &std_str) |
Replace code points in the String with the specified std::string object. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const std::string &std_str) |
Replace the code points in the range [beg, end) with the specified std::string object. More... | |
String & | replace (size_type idx, size_type len, const std::string &std_str, size_type str_idx, size_type str_num) |
Replace code points in the String with a specified sub-string of a given std::string object. More... | |
String & | replace (size_type idx, size_type len, const utf8 *utf8_str) |
Replace code points in the String with the specified null-terminated utf8 encoded data. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const utf8 *utf8_str) |
Replace the code points in the range [beg, end) with the specified null-terminated utf8 encoded data. More... | |
String & | replace (size_type idx, size_type len, const utf8 *utf8_str, size_type str_len) |
Replace code points in the String with the specified utf8 encoded data. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const utf8 *utf8_str, size_type str_len) |
Replace the code points in the range [beg, end) with the specified null-terminated utf8 encoded data. More... | |
String & | replace (size_type idx, size_type len, size_type num, utf32 code_point) |
Replaces a specified range of code points with occurrences of a given code point. More... | |
String & | replace (iterator iter_beg, iterator iter_end, size_type num, utf32 code_point) |
Replace the code points in the range [beg, end) with occurrences of a given code point. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const_iterator iter_newBeg, const_iterator iter_newEnd) |
Replace the code points in the range [beg, end) with code points from the range [newBeg, newEnd). More... | |
String & | replace (size_type idx, size_type len, const char *cstr) |
Replace code points in the String with the specified c-string. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const char *cstr) |
Replace the code points in the range [beg, end) with the specified c-string. More... | |
String & | replace (size_type idx, size_type len, const char *chars, size_type chars_len) |
Replace code points in the String with chars from the given char array. More... | |
String & | replace (iterator iter_beg, iterator iter_end, const char *chars, size_type chars_len) |
Replace the code points in the range [beg, end) with chars from the given char array. More... | |
size_type | find (utf32 code_point, size_type idx=0) const |
Search forwards for a given code point. More... | |
size_type | rfind (utf32 code_point, size_type idx=npos) const |
Search backwards for a given code point. More... | |
size_type | find (const String &str, size_type idx=0) const |
Search forwards for a sub-string. More... | |
size_type | rfind (const String &str, size_type idx=npos) const |
Search backwards for a sub-string. More... | |
size_type | find (const std::string &std_str, size_type idx=0) const |
Search forwards for a sub-string. More... | |
size_type | rfind (const std::string &std_str, size_type idx=npos) const |
Search backwards for a sub-string. More... | |
size_type | find (const utf8 *utf8_str, size_type idx=0) const |
Search forwards for a sub-string. More... | |
size_type | rfind (const utf8 *utf8_str, size_type idx=npos) const |
Search backwards for a sub-string. More... | |
size_type | find (const utf8 *utf8_str, size_type idx, size_type str_len) const |
Search forwards for a sub-string. More... | |
size_type | rfind (const utf8 *utf8_str, size_type idx, size_type str_len) const |
Search backwards for a sub-string. More... | |
size_type | find (const char *cstr, size_type idx=0) const |
Search forwards for a sub-string. More... | |
size_type | rfind (const char *cstr, size_type idx=npos) const |
Search backwards for a sub-string. More... | |
size_type | find (const char *chars, size_type idx, size_type chars_len) const |
Search forwards for a sub-string. More... | |
size_type | rfind (const char *chars, size_type idx, size_type chars_len) const |
Search backwards for a sub-string. More... | |
size_type | find_first_of (const String &str, size_type idx=0) const |
Find the first occurrence of one of a set of code points. More... | |
size_type | find_first_not_of (const String &str, size_type idx=0) const |
Find the first code point that is not one of a set of code points. More... | |
size_type | find_first_of (const std::string &std_str, size_type idx=0) const |
Find the first occurrence of one of a set of code points. More... | |
size_type | find_first_not_of (const std::string &std_str, size_type idx=0) const |
Find the first code point that is not one of a set of code points. More... | |
size_type | find_first_of (const utf8 *utf8_str, size_type idx=0) const |
Find the first occurrence of one of a set of code points. More... | |
size_type | find_first_not_of (const utf8 *utf8_str, size_type idx=0) const |
Find the first code point that is not one of a set of code points. More... | |
size_type | find_first_of (const utf8 *utf8_str, size_type idx, size_type str_len) const |
Find the first occurrence of one of a set of code points. More... | |
size_type | find_first_not_of (const utf8 *utf8_str, size_type idx, size_type str_len) const |
Find the first code point that is not one of a set of code points. More... | |
size_type | find_first_of (utf32 code_point, size_type idx=0) const |
Search forwards for a given code point. More... | |
size_type | find_first_not_of (utf32 code_point, size_type idx=0) const |
Search forwards for the first code point that does not match a given code point. More... | |
size_type | find_first_of (const char *cstr, size_type idx=0) const |
Find the first occurrence of one of a set of chars. More... | |
size_type | find_first_not_of (const char *cstr, size_type idx=0) const |
Find the first code point that is not one of a set of chars. More... | |
size_type | find_first_of (const char *chars, size_type idx, size_type chars_len) const |
Find the first occurrence of one of a set of chars. More... | |
size_type | find_first_not_of (const char *chars, size_type idx, size_type chars_len) const |
Find the first code point that is not one of a set of chars. More... | |
size_type | find_last_of (const String &str, size_type idx=npos) const |
Find the last occurrence of one of a set of code points. More... | |
size_type | find_last_not_of (const String &str, size_type idx=npos) const |
Find the last code point that is not one of a set of code points. More... | |
size_type | find_last_of (const std::string &std_str, size_type idx=npos) const |
Find the last occurrence of one of a set of code points. More... | |
size_type | find_last_not_of (const std::string &std_str, size_type idx=npos) const |
Find the last code point that is not one of a set of code points. More... | |
size_type | find_last_of (const utf8 *utf8_str, size_type idx=npos) const |
Find the last occurrence of one of a set of code points. More... | |
size_type | find_last_not_of (const utf8 *utf8_str, size_type idx=npos) const |
Find the last code point that is not one of a set of code points. More... | |
size_type | find_last_of (const utf8 *utf8_str, size_type idx, size_type str_len) const |
Find the last occurrence of one of a set of code points. More... | |
size_type | find_last_not_of (const utf8 *utf8_str, size_type idx, size_type str_len) const |
Find the last code point that is not one of a set of code points. More... | |
size_type | find_last_of (utf32 code_point, size_type idx=npos) const |
Search for last occurrence of a given code point. More... | |
size_type | find_last_not_of (utf32 code_point, size_type idx=npos) const |
Search for the last code point that does not match a given code point. More... | |
size_type | find_last_of (const char *cstr, size_type idx=npos) const |
Find the last occurrence of one of a set of chars. More... | |
size_type | find_last_not_of (const char *cstr, size_type idx=npos) const |
Find the last code point that is not one of a set of chars. More... | |
size_type | find_last_of (const char *chars, size_type idx, size_type chars_len) const |
Find the last occurrence of one of a set of chars. More... | |
size_type | find_last_not_of (const char *chars, size_type idx, size_type chars_len) const |
Find the last code point that is not one of a set of chars. More... | |
String | substr (size_type idx=0, size_type len=npos) const |
Returns a substring of this String. More... | |
iterator | begin (void) |
Return a forwards iterator that describes the beginning of the String. More... | |
const_iterator | begin (void) const |
Return a constant forwards iterator that describes the beginning of the String. More... | |
iterator | end (void) |
Return a forwards iterator that describes the end of the String. More... | |
const_iterator | end (void) const |
Return a constant forwards iterator that describes the end of the String. More... | |
reverse_iterator | rbegin (void) |
Return a reverse iterator that describes the beginning of the String. More... | |
const_reverse_iterator | rbegin (void) const |
Return a constant reverse iterator that describes the beginning of the String. More... | |
reverse_iterator | rend (void) |
Return a reverse iterator that describes the end of the String. More... | |
const_reverse_iterator | rend (void) const |
Return a constant reverse iterator that describes the end of the String. More... | |
Static Public Attributes | |
static const size_type | npos |
Value used to represent 'not found' conditions and 'all code points' etc. | |
String class used within the GUI system.
For the most part, this class can replace std::string in basic usage. However, currently String does not use the current locale, and also comparisons do not take into account the Unicode data tables, so are not 'correct' as such.
|
inline |
Copy constructor - Creates a new string with the same value as str.
str | String object used to initialise the newly created string |
Constructs a new string initialised with code points from another String object.
str | String object used to initialise the newly created string |
str_idx | Starting code-point of str to be used when initialising the new String |
str_num | Maximum number of code points from str that are to be assigned to the new String |
|
inline |
Constructs a new string and initialises it using the std::string std_str.
std_str | The std::string object that is to be used to initialise the new String object. |
std::length_error | Thrown if resulting String object would be too big. |
|
inline |
Constructs a new string initialised with characters from the given std::string object.
std_str | std::string object used to initialise the newly created string |
str_idx | Starting character of std_str to be used when initialising the new String |
str_num | Maximum number of characters from std_str that are to be assigned to the new String |
std::length_error | Thrown if resulting String object would be too big. |
|
inline |
Constructs a new String object and initialise it using the provided utf8 encoded string buffer.
utf8_str | Pointer to a buffer containing a null-terminated Unicode string encoded as utf8 data. |
std::length_error | Thrown if resulting String object would be too big. |
|
inline |
Constructs a new String object and initialise it using the provided utf8 encoded string buffer.
A basic string literal (cast to utf8*) can be passed to this function, provided that the string is comprised only of code points 0x00..0x7f. The use of extended ASCII characters (with values >0x7f) would result in incorrect behaviour as the String will attempt to 'decode' the data, with unpredictable results.
utf8_str | Pointer to a buffer containing Unicode string data encoded as utf8. |
chars_len | Length of the provided utf8 string in code units (not code-points). |
std::length_error | Thrown if resulting String object would be too big. |
|
inline |
Constructs a new String that is initialised with the specified code point.
num | The number of times code_point is to be put into new String object |
code_point | The Unicode code point to be used when initialising the String object |
std::length_error | Thrown if resulting String object would be too big. |
|
inline |
Construct a new string object and initialise it with code-points from the range [beg, end).
beg | Iterator describing the start of the data to be used when initialising the String object |
end | Iterator describing the (exclusive) end of the data to be used when initialising the String object |
|
inline |
|
inline |
|
inline |
Appends a sub-string of the String str.
str | String object containing data to be appended |
str_idx | Index of the first code point to be appended |
str_num | Maximum number of code points to be appended |
std::out_of_range | Thrown if str_idx is invalid for str. |
std::length_error | Thrown if resulting String would be too large. |
References ptr().
|
inline |
Appends a sub-string of the std::string std_str.
std_str | std::string object containing data to be appended |
str_idx | Index of the first character to be appended |
str_num | Maximum number of characters to be appended |
std::out_of_range | Thrown if str_idx is invalid for std_str. |
std::length_error | Thrown if resulting String would be too large. |
|
inline |
Appends to the String the null-terminated utf8 encoded data in the buffer utf8_str.
utf8_str | Buffer holding the null-terminated utf8 encoded data that is to be appended |
std::length_error | Thrown if resulting String would be too large. |
Appends to the String the utf8 encoded data in the buffer utf8_str.
utf8_str | Buffer holding the utf8 encoded data that is to be appended |
len | Number of code units (not code points) in the buffer to be appended |
std::length_error | Thrown if resulting String would be too large, or if len was 'npos' |
Appends a single code point multiple times to the string.
num | Number of copies of the code point to be appended |
code_point | utf32 Unicode code point that is to be appended |
std::length_error | Thrown if resulting String would be too long, or if num was 'npos'. |
|
inline |
Appends the code points in the reange [beg, end)
beg | Iterator describing the start of the range to be appended |
end | Iterator describing the (exclusive) end of the range to be appended. |
std::length_error | Thrown if the resulting string would be too large. |
|
inline |
Appends to the String chars from the given char array.
chars | char array holding the chars that are to be appended |
chars_len | Number of chars to be appended |
std::length_error | Thrown if resulting String would be too large, or if chars_len was 'npos' |
|
inline |
Assign a sub-string of String str to this String.
str | String object containing the string data to be assigned. |
str_idx | Index of the first code point in str that is to be assigned |
str_num | Maximum number of code points from str that are be be assigned |
std::out_of_range | Thrown if str_idx is invalid for str |
References ptr().
|
inline |
Assign a sub-string of std::string std_str to this String.
std_str | std::string object containing the string value to be assigned. |
str_idx | Index of the first character of std_str to be assigned |
str_num | Maximum number of characters from std_str to be assigned |
std::out_of_range | Thrown if str_idx is invalid for std_str |
std::length_error | Thrown if the resulting String would have been too large. |
|
inline |
Assign to this String the string value represented by the given null-terminated utf8 encoded data.
utf8_str | Buffer containing valid null-terminated utf8 encoded data |
std::length_error | Thrown if the resulting String would have been too large. |
Assign to this String the string value represented by the given utf8 encoded data.
utf8_str | Buffer containing valid utf8 encoded data |
str_num | Number of code units (not code points) in the buffer pointed to by utf8_str |
std::length_error | Thrown if the resulting String would have been too large, or if str_num is 'npos'. |
|
inline |
|
inline |
|
inline |
|
inline |
Return a constant forwards iterator that describes the beginning of the String.
|
inline |
|
inline |
|
inline |
Removes all data from the String.
|
inline |
|
inline |
Compares code points from this String with code points from the String 'str'.
idx | Index of the first code point from this String to consider. |
len | Maximum number of code points from this String to consider. |
str | The String object that is to compared with this String. |
str_idx | Index of the first code point from String str to consider. |
str_len | Maximum number of code points from String str to consider |
std::out_of_range | Thrown if either idx or str_idx are invalid. |
References ptr().
|
inline |
Compares this String with the std::string 'std_str'.
std_str | The std::string object that is to compared with this String. |
|
inline |
Compares code points from this String with code points from the std::string 'std_str'.
idx | Index of the first code point from this String to consider. |
len | Maximum number of code points from this String to consider. |
std_str | The std::string object that is to compared with this String. |
str_idx | Index of the first character from std::string std_str to consider. |
str_len | Maximum number of characters from std::string std_str to consider |
std::out_of_range | Thrown if either idx or str_idx are invalid. |
|
inline |
Compares this String with the null-terminated utf8 encoded 'utf8_str'.
utf8_str | The buffer containing valid Unicode data encoded as utf8 that is to compared with this String. |
Compares code points from this String with the null-terminated utf8 encoded 'utf8_str'.
idx | Index of the first code point from this String to consider. |
len | Maximum number of code points from this String to consider. |
utf8_str | The buffer containing valid Unicode data encoded as utf8 that is to compared with this String. |
std::out_of_range | Thrown if idx is invalid. |
|
inline |
Compares code points from this String with the utf8 encoded data in buffer 'utf8_str'.
idx | Index of the first code point from this String to consider. |
len | Maximum number of code points from this String to consider. |
utf8_str | The buffer containing valid Unicode data encoded as utf8 that is to compared with this String. |
str_cplen | The number of encoded code points in the buffer utf8_str (this is not the same as the number of code units). |
std::out_of_range | Thrown if idx is invalid. |
std::length_error | Thrown if str_cplen is set to npos. |
|
inline |
Compares this String with the given c-string.
c_str | The c-string that is to compared with this String. |
Compares code points from this String with the given c-string.
idx | Index of the first code point from this String to consider. |
len | Maximum number of code points from this String to consider. |
c_str | The c-string that is to compared with this String. |
std::out_of_range | Thrown if idx is invalid. |
|
inline |
Compares code points from this String with chars in the given char array.
idx | Index of the first code point from this String to consider. |
len | Maximum number of code points from this String to consider. |
chars | The array containing the chars that are to compared with this String. |
chars_len | The number of chars in the array. |
std::out_of_range | Thrown if idx is invalid. |
std::length_error | Thrown if chars_len is set to npos. |
Copies an area of the String into the provided buffer as encoded utf8 data.
buf | Pointer to a buffer that is to receive the encoded data (this must be big enough to hold the encoded data) |
len | Maximum number of code points from the String that should be encoded into the buffer |
idx | Index of the first code point to be encoded into the buffer |
std::out_of_range | Thrown if idx was invalid for this String. |
|
inline |
|
inline |
Returns true if the String is empty.
Referenced by CEGUI::PropertyLinkDefinition< T >::getTargetWindow().
|
inline |
|
inline |
Return a constant forwards iterator that describes the end of the String.
|
inline |
Erase the code point described by the given iterator.
pos | Iterator describing the code point to be erased |
Erase a range of code points described by the iterators [beg, end).
beg | Iterator describing the postion of the beginning of the range to erase |
end | Iterator describing the postion of the (exclusive) end of the range to erase |
Search forwards for a given code point.
code_point | The utf32 code point to search for |
idx | Index of the code point where the search is to start. |
Referenced by find_first_not_of(), find_first_of(), find_last_not_of(), and find_last_of().
Search forwards for a sub-string.
str | String object describing the sub-string to search for |
idx | Index of the code point where the search is to start |
Search forwards for a sub-string.
std_str | std::string object describing the sub-string to search for |
idx | Index of the code point where the search is to start |
Search forwards for a sub-string.
utf8_str | Buffer containing null-terminated utf8 encoded data describing the sub-string to search for |
idx | Index of the code point where the search is to start |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Search forwards for a sub-string.
utf8_str | Buffer containing utf8 encoded data describing the sub-string to search for |
idx | Index of the code point where the search is to start |
str_len | Length of the utf8 encoded sub-string in utf8 code units (not code points) |
std::length_error | Thrown if str_len is 'npos' |
Search forwards for a sub-string.
c_str | c-string describing the sub-string to search for |
idx | Index of the code point where the search is to start |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Search forwards for a sub-string.
chars | char array describing the sub-string to search for |
idx | Index of the code point where the search is to start |
chars_len | Number of chars in the char array. |
std::length_error | Thrown if chars_len is 'npos' |
Find the first code point that is not one of a set of code points.
str | String object describing the set of code points. |
idx | Index of the start point for the search |
References find().
|
inline |
Find the first code point that is not one of a set of code points.
std_str | std::string object describing the set of code points. |
idx | Index of the start point for the search |
|
inline |
Find the first code point that is not one of a set of code points.
utf8_str | Buffer containing null-terminated utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the first code point that is not one of a set of code points.
utf8_str | Buffer containing utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
str_len | Length of the utf8 encoded data in utf8 code units (not code points). |
std::length_error | Thrown if str_len was 'npos'. |
Search forwards for the first code point that does not match a given code point.
code_point | The utf32 code point to search for |
idx | Index of the code point where the search is to start. |
std::out_of_range | Thrown if idx is invalid for this String. |
Find the first code point that is not one of a set of chars.
c_str | c-string describing the set of chars. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the first code point that is not one of a set of chars.
chars | char array containing the set of chars. |
idx | Index of the start point for the search |
chars_len | Number of chars in the car array. |
std::length_error | Thrown if chars_len was 'npos'. |
Find the first occurrence of one of a set of code points.
str | String object describing the set of code points. |
idx | Index of the start point for the search |
References find().
|
inline |
Find the first occurrence of one of a set of code points.
std_str | std::string object describing the set of code points. |
idx | Index of the start point for the search |
Find the first occurrence of one of a set of code points.
utf8_str | Buffer containing null-terminated utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the first occurrence of one of a set of code points.
utf8_str | Buffer containing utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
str_len | Length of the utf8 encoded data in utf8 code units (not code points). |
std::length_error | Thrown if str_len was 'npos'. |
Search forwards for a given code point.
code_point | The utf32 code point to search for |
idx | Index of the code point where the search is to start. |
Find the first occurrence of one of a set of chars.
c_str | c-string describing the set of chars. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the first occurrence of one of a set of chars.
chars | char array containing the set of chars. |
idx | Index of the start point for the search |
chars_len | Number of chars in the char array. |
std::length_error | Thrown if chars_len was 'npos'. |
Find the last code point that is not one of a set of code points.
str | String object describing the set of code points. |
idx | Index of the start point for the search |
References find().
|
inline |
Find the last code point that is not one of a set of code points.
std_str | std::string object describing the set of code points. |
idx | Index of the start point for the search |
|
inline |
Find the last code point that is not one of a set of code points.
utf8_str | Buffer containing null-terminated utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the last code point that is not one of a set of code points.
utf8_str | Buffer containing utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
str_len | Length of the utf8 encoded data in utf8 code units (not code points). |
std::length_error | Thrown if str_len was 'npos'. |
Search for the last code point that does not match a given code point.
code_point | The utf32 code point to search for |
idx | Index of the code point where the search is to start. |
Find the last code point that is not one of a set of chars.
c_str | c-string describing the set of chars. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the last code point that is not one of a set of chars.
chars | char array containing the set of chars. |
idx | Index of the start point for the search |
chars_len | Number of chars in the char array. |
std::length_error | Thrown if chars_len was 'npos'. |
Find the last occurrence of one of a set of code points.
str | String object describing the set of code points. |
idx | Index of the start point for the search |
References find().
|
inline |
Find the last occurrence of one of a set of code points.
std_str | std::string object describing the set of code points. |
idx | Index of the start point for the search |
Find the last occurrence of one of a set of code points.
utf8_str | Buffer containing null-terminated utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the last occurrence of one of a set of code points.
utf8_str | Buffer containing utf8 encoded data describing the set of code points. |
idx | Index of the start point for the search |
str_len | Length of the utf8 encoded data in utf8 code units (not code points). |
std::length_error | Thrown if str_len was 'npos'. |
Search for last occurrence of a given code point.
code_point | The utf32 code point to search for |
idx | Index of the code point where the search is to start. |
Find the last occurrence of one of a set of chars.
c_str | c-string describing the set of chars. |
idx | Index of the start point for the search |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Find the last occurrence of one of a set of chars.
chars | char array containing the set of chars. |
idx | Index of the start point for the search |
chars_len | Number of chars in the char array. |
std::length_error | Thrown if chars_len was 'npos'. |
|
inline |
Inserts a sub-string of the given String object at the specified position.
idx | Index where the string is to be inserted. |
str | String object containing data to be inserted. |
str_idx | Index of the first code point from str to be inserted. |
str_num | Maximum number of code points from str to be inserted. |
std::out_of_range | Thrown if idx or str_idx are out of range. |
std::length_error | Thrown if resulting String would be too large. |
References ptr().
Inserts the given std::string object at the specified position.
idx | Index where the std::string is to be inserted. |
std_str | std::string object that is to be inserted. |
|
inline |
Inserts a sub-string of the given std::string object at the specified position.
idx | Index where the string is to be inserted. |
std_str | std::string object containing data to be inserted. |
str_idx | Index of the first character from std_str to be inserted. |
str_num | Maximum number of characters from str to be inserted. |
std::out_of_range | Thrown if idx or str_idx are out of range. |
std::length_error | Thrown if resulting String would be too large. |
Inserts the given null-terminated utf8 encoded data at the specified position.
idx | Index where the data is to be inserted. |
utf8_str | Buffer containing the null-terminated utf8 encoded data that is to be inserted. |
Inserts the given utf8 encoded data at the specified position.
idx | Index where the data is to be inserted. |
utf8_str | Buffer containing the utf8 encoded data that is to be inserted. |
len | Length of the data to be inserted in uf8 code units (not code points) |
Inserts a code point multiple times into the String.
pos | Iterator describing the position where the code point(s) are to be inserted |
num | The number of times to insert the code point |
code_point | The utf32 code point that is to be inserted |
std::length_error | Thrown if resulting String would be too large, or if num is 'npos' |
|
inline |
Inserts code points specified by the range [beg, end).
pos | Iterator describing the position where the data is to be inserted |
beg | Iterator describing the begining of the range to be inserted |
end | Iterator describing the (exclusive) end of the range to be inserted. |
std::length_error | Thrown if resulting String would be too large. |
Inserts the given c-string at the specified position.
idx | Index where the c-string is to be inserted. |
c_str | c-string that is to be inserted. |
Inserts chars from the given char array at the specified position.
idx | Index where the data is to be inserted. |
chars | char array containing the chars that are to be inserted. |
chars_len | Length of the char array to be inserted. |
|
inline |
|
inline |
|
inline |
Appends the std::string std_str.
std_str | std::string object that is to be appended |
std::length_error | Thrown if resulting String would be too large. |
|
inline |
Appends to the String the null-terminated utf8 encoded data in the buffer utf8_str.
utf8_str | buffer holding the null-terminated utf8 encoded data that is to be appended |
std::length_error | Thrown if resulting String would be too large. |
|
inline |
|
inline |
|
inline |
Assign the value of std::string std_str to this String.
std_str | std::string object containing the string value to be assigned. |
std::length_error | Thrown if the resulting String would have been too large. |
|
inline |
Assign to this String the string value represented by the given null-terminated utf8 encoded data.
utf8_str | Buffer containing valid null-terminated utf8 encoded data |
std::length_error | Thrown if the resulting String would have been too large. |
|
inline |
|
inline |
Returns the code point at the given index.
idx | Zero based index of the code point to be returned. |
|
inline |
Returns the code point at the given index.
idx | Zero based index of the code point to be returned. |
|
inline |
Appends a single code point to the string.
code_point | utf32 Unicode code point that is to be appended |
std::length_error | Thrown if resulting String would be too long. |
|
inline |
|
inline |
|
inline |
|
inline |
Replace code points in the String with the specified String object.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced (if this is 0, operation is an insert at position idx) |
str | The String object that is to replace the specified code points |
Replace the code points in the range [beg, end) with the specified String object.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
str | The String object that is to replace the specified range of code points |
std::length_error | Thrown if the resulting String would be too large. |
|
inline |
Replace code points in the String with a specified sub-string of a given String object.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced. If this is 0, the operation is an insert at position idx. |
str | String object containing the data that will replace the specified range of code points |
str_idx | Index of the first code point of str that is to replace the specified code point range |
str_num | Maximum number of code points of str that are to replace the specified code point range |
std::out_of_range | Thrown if either idx, or str_idx are invalid |
std::length_error | Thrown if the resulting String would have been too large. |
References ptr().
Replace code points in the String with the specified std::string object.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced (if this is 0, operation is an insert at position idx) |
std_str | The std::string object that is to replace the specified code points |
|
inline |
Replace the code points in the range [beg, end) with the specified std::string object.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
std_str | The std::string object that is to replace the specified range of code points |
std::length_error | Thrown if the resulting String would be too large. |
|
inline |
Replace code points in the String with a specified sub-string of a given std::string object.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced. If this is 0, the operation is an insert at position idx. |
std_str | std::string object containing the data that will replace the specified range of code points |
str_idx | Index of the first code point of std_str that is to replace the specified code point range |
str_num | Maximum number of code points of std_str that are to replace the specified code point range |
std::out_of_range | Thrown if either idx, or str_idx are invalid |
std::length_error | Thrown if the resulting String would have been too large. |
Replace code points in the String with the specified null-terminated utf8 encoded data.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced (if this is 0, operation is an insert at position idx) |
utf8_str | Buffer containing the null-terminated utf8 encoded data that is to replace the specified code points |
|
inline |
Replace the code points in the range [beg, end) with the specified null-terminated utf8 encoded data.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
utf8_str | Buffer containing the null-terminated utf8 encoded data that is to replace the specified range of code points |
std::length_error | Thrown if the resulting String would be too large. |
|
inline |
Replace code points in the String with the specified utf8 encoded data.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced (if this is 0, operation is an insert at position idx) |
utf8_str | Buffer containing the null-terminated utf8 encoded data that is to replace the specified code points |
str_len | Length of the utf8 encoded data in utf8 code units (not code points). |
|
inline |
Replace the code points in the range [beg, end) with the specified null-terminated utf8 encoded data.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
utf8_str | Buffer containing the null-terminated utf8 encoded data that is to replace the specified range of code points |
str_len | Length of the utf8 encoded data in utf8 code units (not code points). |
std::length_error | Thrown if the resulting String would be too large, or if str_len was 'npos'. |
|
inline |
Replaces a specified range of code points with occurrences of a given code point.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to replace. If this is 0 the operation is an insert |
num | Number of occurrences of code_point that are to replace the specified range of code points |
code_point | Code point that is to be used when replacing the specified range of code points |
|
inline |
Replace the code points in the range [beg, end) with occurrences of a given code point.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
num | Number of occurrences of code_point that are to replace the specified range of code points |
code_point | Code point that is to be used when replacing the specified range of code points |
std::length_error | Thrown if resulting String would have been too long, or if num was 'npos'. |
|
inline |
Replace the code points in the range [beg, end) with code points from the range [newBeg, newEnd).
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
newBeg | Iterator describing the beginning of the range to insert. |
newEnd | Iterator describing the (exclusive) end of the range to insert. |
std::length_error | Thrown if the resulting string would be too long. |
Replace code points in the String with the specified c-string.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced (if this is 0, operation is an insert at position idx) |
c_str | c-string that is to replace the specified code points |
Replace the code points in the range [beg, end) with the specified c-string.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
c_str | c-string that is to replace the specified range of code points |
std::length_error | Thrown if the resulting String would be too large. |
|
inline |
Replace code points in the String with chars from the given char array.
idx | Index of the first code point to be replaced |
len | Maximum number of code points to be replaced (if this is 0, operation is an insert at position idx) |
chars | char array containing the cars that are to replace the specified code points |
chars_len | Number of chars in the char array. |
|
inline |
Replace the code points in the range [beg, end) with chars from the given char array.
beg | Iterator describing the start of the range to be replaced |
end | Iterator describing the (exclusive) end of the range to be replaced. |
chars | char array containing the chars that are to replace the specified range of code points |
chars_len | Number of chars in the char array. |
std::length_error | Thrown if the resulting String would be too large, or if chars_len was 'npos'. |
|
inline |
Specifies the amount of reserve capacity to allocate.
num | The number of code points to allocate space for. If num is larger that the current reserve, then a re-allocation will occur. If num is smaller than the current reserve (but not 0) the buffer may be shrunk to the larger of the specified number, or the current String size (operation is currently not implemented). If num is 0, then the buffer is re-allocated to fit the current String size. |
std::length_error | Thrown if resulting String object would be too big. |
|
inline |
|
inline |
Resizes the String either by inserting the given utf32 code point to make it larger, or by truncating to make it smaller.
num | The length, in code points, that the String is to be made. |
code_point | The utf32 code point that should be used when majing the String larger |
std::length_error | Thrown if the String would be too large. |
Search backwards for a given code point.
code_point | The utf32 code point to search for |
idx | Index of the code point where the search is to start. |
Search backwards for a sub-string.
str | String object describing the sub-string to search for |
idx | Index of the code point where the search is to start |
Search backwards for a sub-string.
std_str | std::string object describing the sub-string to search for |
idx | Index of the code point where the search is to start |
Search backwards for a sub-string.
utf8_str | Buffer containing null-terminated utf8 encoded data describing the sub-string to search for |
idx | Index of the code point where the search is to start |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Search backwards for a sub-string.
utf8_str | Buffer containing utf8 encoded data describing the sub-string to search for |
idx | Index of the code point where the search is to start |
str_len | Length of the utf8 encoded sub-string in utf8 code units (not code points) |
std::length_error | Thrown if str_len is 'npos' |
Search backwards for a sub-string.
c_str | c-string describing the sub-string to search for |
idx | Index of the code point where the search is to start |
std::out_of_range | Thrown if idx is invalid for this String. |
|
inline |
Search backwards for a sub-string.
chars | char array describing the sub-string to search for |
idx | Index of the code point where the search is to start |
chars_len | Number of chars in the char array. |
std::length_error | Thrown if chars_len is 'npos' |
|
inline |
|
inline |
Return the number of utf8 code units required to hold an area of the String when encoded as utf8 data.
num | Maximum number of code points to consider when calculating utf8 encoded size. |
idx | Index of the first code point to consider when calculating the utf8 encoded size |
std::out_of_range | Thrown if idx was invalid for this String. |