![]() |
SCENE C++ API
2.0.31
|
String implementation for unicode character strings. More...
#include <lsstring.h>
Public Member Functions | |
Construction, Destruction & Assignment | |
LSString () | |
Constructs an empty string. More... | |
LSString (const LSString &str) | |
Constructs a string containing a copy of the string str. More... | |
LSString (const wchar_t *str) | |
Constructs a string containing a copy of the string str. More... | |
LSString (const wchar_t &c) | |
Constructs a string containing a copy of the character c. More... | |
~LSString () | |
Destroys the string. More... | |
LSString & | operator= (const LSString &str) |
Assigns a copy of the string str to this string. More... | |
LSString & | operator= (const wchar_t *str) |
Assigns a copy of the string str to this string. More... | |
Conversion to other string types | |
const char * | toCharStr () const |
Returns a string representation of the current string encoded in the current system locale. More... | |
const char * | toUtf8Str () const |
Returns a string representation of the current string encoded in UTF8. More... | |
const wchar_t * | toWcharStr () const |
Returns a wide character string representation of the current string. More... | |
String operations | |
bool | empty () const |
Tests whether the string is empty (whether its length is 0). More... | |
int | length () const |
Returns the length of the string, counted in the number of characters. More... | |
int | find (const LSString &str, int pos=0) const |
Searches the string for the first occurrence of the string str starting at the position pos. More... | |
int | find (const wchar_t *str, int pos=0) const |
Searches the string for the first occurrence of the string str starting at the position pos. More... | |
int | find (const wchar_t &c, int pos=0) const |
Searches the string for the first occurrence of the character c starting at the position pos. More... | |
int | rfind (const LSString &str, int pos=-1) const |
Searches the string for the last occurrence of the string str which is completely located before the position pos. More... | |
int | rfind (const wchar_t *str, int pos=-1) const |
Searches the string for the last occurrence of the string str which is completely located before the position pos. More... | |
int | rfind (const wchar_t &c, int pos=-1) const |
Searches the string for the last occurrence of the character c which is located before the position pos. More... | |
LSString | substr (int pos=0, int len=-1) const |
Returns a new string which contains a substring of this string starting at position pos and spanning len characters. More... | |
int | compare (const LSString &str) const |
Lexicographically compares the contents of this string to the contents of the string str. More... | |
int | compare (const wchar_t *str) const |
Lexicographically compares the contents of this string to the contents of the string str. More... | |
LSString & | replace (const LSString &before, const LSString &after) |
Replaces all occurrences of the string before with the string after. More... | |
LSString & | replace (const LSString &before, const wchar_t *after) |
Replaces all occurrences of the string before with the string after. More... | |
LSString & | replace (const wchar_t *before, const LSString &after) |
Replaces all occurrences of the string before with the string after. More... | |
LSString & | replace (const wchar_t *before, const wchar_t *after) |
Replaces all occurrences of the string before with the string after. More... | |
LSString & | replace (const wchar_t &before, const wchar_t &after) |
Replaces all occurrences of the character before with the character after. More... | |
LSString & | append (const LSString &str) |
Appends the string str to this string. More... | |
LSString & | append (const wchar_t *str) |
Appends the string str to this string. More... | |
LSString & | append (const wchar_t &c) |
Appends the character c to this string. More... | |
LSString & | operator+= (const LSString &str) |
Appends the string str to this string. More... | |
LSString & | operator+= (const wchar_t *str) |
Appends the string str to this string. More... | |
LSString & | operator+= (const wchar_t &c) |
Appends the character c to this string. More... | |
Element access | |
wchar_t & | operator[] (int pos) |
Returns a reference to the character at position pos in the string. More... | |
wchar_t | operator[] (int pos) const |
Returns a reference to the character at position pos in the string. More... | |
wchar_t & | at (int pos) |
Returns a reference to the character at position pos in the string. More... | |
wchar_t | at (int pos) const |
Returns a reference to the character at position pos in the string. More... | |
New / Delete operators | |
void * | operator new (size_t tSize) |
Default allocation function. More... | |
void | operator delete (void *p) |
Default deallocation function. More... | |
Static Public Member Functions | |
Conversion from other string types | |
static LSString | fromCharStr (const char *charStr) |
Creates a copy of the string charStr. More... | |
static LSString | fromUtf8Str (const char *utf8Str) |
Creates a copy of the string utf8Str. More... | |
static LSString | fromWcharStr (const wchar_t *wcharStr) |
Creates a copy of the string wcharStr. More... | |
Related Functions | |
(Note that these are not member functions.) | |
String concatenation | |
LSString | operator+ (const LSString &str1, const LSString &str2) |
LSString | operator+ (const LSString &str1, const wchar_t *str2) |
LSString | operator+ (const wchar_t *str1, const LSString &str2) |
LSString | operator+ (const LSString &str, const wchar_t &c) |
LSString | operator+ (const wchar_t &c, const LSString &str) |
bool | operator== (const LSString &str1, const LSString &str2) |
Relational operators | |
bool | operator== (const LSString &str1, const wchar_t *str2) |
bool | operator== (const wchar_t *str1, const LSString &str2) |
bool | operator!= (const LSString &str1, const LSString &str2) |
bool | operator!= (const LSString &str1, const wchar_t *str2) |
bool | operator!= (const wchar_t *str1, const LSString &str2) |
bool | operator< (const LSString &str1, const LSString &str2) |
bool | operator< (const LSString &str1, const wchar_t *str2) |
bool | operator< (const wchar_t *str1, const LSString &str2) |
bool | operator<= (const LSString &str1, const LSString &str2) |
bool | operator<= (const LSString &str1, const wchar_t *str2) |
bool | operator<= (const wchar_t *str1, const LSString &str2) |
bool | operator> (const LSString &str1, const LSString &str2) |
bool | operator> (const LSString &str1, const wchar_t *str2) |
bool | operator> (const wchar_t *str1, const LSString &str2) |
bool | operator>= (const LSString &str1, const LSString &str2) |
bool | operator>= (const LSString &str1, const wchar_t *str2) |
bool | operator>= (const wchar_t *str1, const LSString &str2) |
String implementation for unicode character strings.
LSString | ( | ) |
Constructs an empty string.
Constructs a string containing a copy of the string str.
LSString | ( | const wchar_t * | str | ) |
Constructs a string containing a copy of the string str.
LSString | ( | const wchar_t & | c | ) |
Constructs a string containing a copy of the character c.
~LSString | ( | ) |
Destroys the string.
Assigns a copy of the string str to this string.
LSString& operator= | ( | const wchar_t * | str | ) |
Assigns a copy of the string str to this string.
|
static |
Creates a copy of the string charStr.
The string charStr is assumed to be encoded in the current system locale.
|
static |
Creates a copy of the string utf8Str.
The string utf8Str is assumed to be encoded in UTF8.
|
static |
Creates a copy of the string wcharStr.
const char* toCharStr | ( | ) | const |
Returns a string representation of the current string encoded in the current system locale.
const char* toUtf8Str | ( | ) | const |
Returns a string representation of the current string encoded in UTF8.
const wchar_t* toWcharStr | ( | ) | const |
Returns a wide character string representation of the current string.
bool empty | ( | ) | const |
Tests whether the string is empty (whether its length is 0).
int length | ( | ) | const |
Returns the length of the string, counted in the number of characters.
int find | ( | const LSString & | str, |
int | pos = 0 |
||
) | const |
Searches the string for the first occurrence of the string str starting at the position pos.
int find | ( | const wchar_t * | str, |
int | pos = 0 |
||
) | const |
Searches the string for the first occurrence of the string str starting at the position pos.
int find | ( | const wchar_t & | c, |
int | pos = 0 |
||
) | const |
Searches the string for the first occurrence of the character c starting at the position pos.
int rfind | ( | const LSString & | str, |
int | pos = -1 |
||
) | const |
Searches the string for the last occurrence of the string str which is completely located before the position pos.
int rfind | ( | const wchar_t * | str, |
int | pos = -1 |
||
) | const |
Searches the string for the last occurrence of the string str which is completely located before the position pos.
int rfind | ( | const wchar_t & | c, |
int | pos = -1 |
||
) | const |
Searches the string for the last occurrence of the character c which is located before the position pos.
LSString substr | ( | int | pos = 0 , |
int | len = -1 |
||
) | const |
Returns a new string which contains a substring of this string starting at position pos and spanning len characters.
int compare | ( | const LSString & | str | ) | const |
Lexicographically compares the contents of this string to the contents of the string str.
int compare | ( | const wchar_t * | str | ) | const |
Lexicographically compares the contents of this string to the contents of the string str.
Replaces all occurrences of the string before with the string after.
Replaces all occurrences of the string before with the string after.
Replaces all occurrences of the string before with the string after.
LSString& replace | ( | const wchar_t * | before, |
const wchar_t * | after | ||
) |
Replaces all occurrences of the string before with the string after.
LSString& replace | ( | const wchar_t & | before, |
const wchar_t & | after | ||
) |
Replaces all occurrences of the character before with the character after.
Appends the string str to this string.
LSString& append | ( | const wchar_t * | str | ) |
Appends the string str to this string.
LSString& append | ( | const wchar_t & | c | ) |
Appends the character c to this string.
Appends the string str to this string.
LSString& operator+= | ( | const wchar_t * | str | ) |
Appends the string str to this string.
LSString& operator+= | ( | const wchar_t & | c | ) |
Appends the character c to this string.
wchar_t& operator[] | ( | int | pos | ) |
Returns a reference to the character at position pos in the string.
wchar_t operator[] | ( | int | pos | ) | const |
Returns a reference to the character at position pos in the string.
wchar_t& at | ( | int | pos | ) |
Returns a reference to the character at position pos in the string.
wchar_t at | ( | int | pos | ) | const |
Returns a reference to the character at position pos in the string.
void* operator new | ( | size_t | tSize | ) |
Default allocation function.
Overloaded in order to always allocate LSString objects in the context of this module.
void operator delete | ( | void * | p | ) |
Default deallocation function.
Overloaded in order to always deallocate LSString objects in the context of this module.
Returns a new string containing the concatenation of the contents of the string str1 followed by the contents of the string str2.
Returns a new string containing the concatenation of the contents of the string str1 followed by the contents of the string str2.
Returns a new string containing the concatenation of the contents of the string str1 followed by the contents of the string str2.
Returns a new string containing the concatenation of the contents of the string str followed by the character c.
Returns a new string containing the concatenation of the character c followed by the contents of the string str.
Tests whether the string str1 and the string str2 are equal.
|
related |
Tests whether the string str1 and the string str2 are equal.
|
related |
Tests whether the string str1 and the string str2 are equal.
Tests whether the string str1 and the string str2 are unequal.
|
related |
Tests whether the string str1 and the string str2 are unequal.
|
related |
Tests whether the string str1 and the string str2 are unequal.
Tests whether the string str1 is lexicographically smaller than the string str2.
|
related |
Tests whether the string str1 is lexicographically smaller than the string str2.
|
related |
Tests whether the string str1 is lexicographically smaller than the string str2.
Tests whether the string str1 is lexicographically smaller or equal than the string str2.
|
related |
Tests whether the string str1 is lexicographically smaller or equal than the string str2.
|
related |
Tests whether the string str1 is lexicographically smaller or equal than the string str2.
Tests whether the string str1 is lexicographically greater than the string str2.
|
related |
Tests whether the string str1 is lexicographically greater than the string str2.
|
related |
Tests whether the string str1 is lexicographically greater than the string str2.
Tests whether the string str1 is lexicographically greater or equal than the string str2.
|
related |
Tests whether the string str1 is lexicographically greater or equal than the string str2.
|
related |
Tests whether the string str1 is lexicographically greater or equal than the string str2.