#include <gauge3d/gstring.h>
Public Methods | |
GString () | |
Create an empty (zero-length) string. | |
GString (const GString &other) | |
Copy constructor. | |
GString (const char cstr[]) | |
Construct from ASCII character array. | |
GString (const wchar_t cstr[]) | |
Construct from Unicode character array. | |
GString (const char cstr[],int length) | |
Construct from ASCII character array of given length (in characters). | |
GString (const wchar_t cstr[],int length) | |
Construct from Unicode character array of given length (in wide characters). | |
GString (int i) | |
Create a string representation of an int (base-10). | |
GString (double f) | |
Create a string representation of a float (base-10). | |
~GString () | |
int | Compare (const GString &other)const |
Compare one string to another. More... | |
int | Compare (const char other[])const |
Compare to a null-terminated char string. | |
int | Compare (const wchar_t other[])const |
Compare to a null-terminated wide char string. | |
int | FindFirstOf (wchar_t c)const |
Returns the index of the first instance of the given character in the string. | |
int | FindLastOf (wchar_t c)const |
Returns the index of the last instance of the given character in the string. | |
int | FindNext (wchar_t c,int start)const |
Returns the index of the first instance of the character occurring after the start position. | |
GString | SubString (int start)const |
Returns a sub string of the string. More... | |
GString | SubString (int start,int length)const |
Returns a sub string of the string. More... | |
int | Length ()const |
Gets the length of the string in characters (or wide characters). | |
bool | IsUnicode ()const |
Returns true if the string is represented as Unicode internally. More... | |
GString | ToUnicode ()const |
Returns the same string, except with a Unicode internal representation. More... | |
GString | ToAscii ()const |
Returns the same string, except with an ASCII internal representation. More... | |
const char* | AsciiData ()const |
Returns a pointer to the internal buffer of the string. More... | |
const wchar_t* | UnicodeData ()const |
Returns a pointer to the internal buffer of the string. More... | |
void | SetChar (int index,wchar_t value) |
Set the given character in the string to the given value. More... | |
operator int () | |
Interpret string as an integer and convert. | |
operator float () | |
Interpret string as a floating point value and convert. | |
wchar_t | operator[] (int index)const |
Array-like access to the characters in the string. More... | |
const GString& | operator= (const GString &other) |
Assignment operator. | |
String concatination operators. | |
GString | operator+ (const GString &other)const |
const GString& | operator+= (const GString &other) |
GString | operator+ (char other)const |
const GString& | operator+= (char other) |
GString | operator+ (char other[])const |
const GString& | operator+= (char other[]) |
GString | operator+ (wchar_t other[])const |
const GString& | operator+= (wchar_t other[]) |
String comparison operators. | |
bool | operator== (const GString &other)const |
bool | operator!= (const GString &other)const |
bool | operator< (const GString &other)const |
bool | operator> (const GString &other)const |
bool | operator<= (const GString &other)const |
bool | operator>= (const GString &other)const |
bool | operator== (const char other[])const |
bool | operator!= (const char other[])const |
bool | operator< (const char other[])const |
bool | operator> (const char other[])const |
bool | operator<= (const char other[])const |
bool | operator>= (const char other[])const |
bool | operator== (const wchar_t other[])const |
bool | operator!= (const wchar_t other[])const |
bool | operator< (const wchar_t other[])const |
bool | operator> (const wchar_t other[])const |
bool | operator<= (const wchar_t other[])const |
bool | operator>= (const wchar_t other[])const |
Related Functions | |
(Note that these are not member functions.) | |
GString | operator+ (const char *str1,const GString &str2) |
GString | operator+ (const wchar_t str1[],const GString &str2) |
GString can represent both ASCII and Unicode strings and it can convert between them. The internal buffer is reference-counted, so it is perfectly performance-safe to pass strings by value. When a write operation on the string occurs, the internal buffer will be copied if and only if it does not have a reference count of one.
|
Compare one string to another.
|
|
Returns a sub string of the string.
|
|
Returns a sub string of the string.
|
|
Returns true if the string is represented as Unicode internally.
|
|
Returns the same string, except with a Unicode internal representation.
|
|
Returns the same string, except with an ASCII internal representation.
|
|
Returns a pointer to the internal buffer of the string.
|
|
Returns a pointer to the internal buffer of the string.
|
|
Set the given character in the string to the given value.
|
|
Array-like access to the characters in the string.
|