#include <String.h>
Public Methods | |
| String () | |
| Creates an empty string. | |
| String (const String &string) | |
| Copy constructor. | |
| String (const char *string) | |
| Creates a string from a char*. | |
| String (const WCHAR *string) | |
| Create a string from a WCHAR*. | |
| String (const char *string, long sindex, long count) | |
| Creates a string from a substring of a char*. | |
| String (const WCHAR *string, long sindex, long count) | |
| Creates a string from a substring of a WCHAR*. | |
| ~String () | |
| Destructor. | |
| virtual void | toUpper () |
| Converts this string to all upper case letters. | |
| virtual void | toLower () |
| Converts this string to all lower case letters. | |
| virtual void | trim () |
| Removes leading and trailing whitespace. | |
| virtual void | replace (char old_char, char new_char) |
| Replaces all occurences of a character with another. | |
| virtual void | replace (WCHAR old_char, WCHAR new_char) |
| Replaces all occurences of a character with another. | |
| virtual String | substring (long sindex) |
| Returns the substring from sindex to the end of the string. | |
| virtual String | substring (long sindex, long count) |
| Return sthe substring from sindex to count. | |
| virtual String | concat (const String &string) |
| Returns the concatenation of this string and another. | |
| virtual String | concat (const char *string) |
| Returns the concatenation of this string and another. | |
| virtual String | concat (const WCHAR *string) |
| Returns the concatenation of this string and another. | |
| virtual void | setString (const String &string) |
| Copies the given string into this one. | |
| virtual void | setString (const char *string) |
| Copies the given string into this one. | |
| virtual void | setString (const WCHAR *string) |
| Copies the given string into this one. | |
| virtual void | insert (const String &string, int bindex) |
| Inserts the given string into the this one. | |
| virtual void | insert (const char *string, int bindex) |
| Inserts the given string into the this one. | |
| virtual void | insert (const WCHAR *string, int bindex) |
| Inserts the given string into the this one. | |
| virtual char | charAt (long index) |
| Returns the char at the given index. | |
| virtual WCHAR | wcharAt (long index) |
| Returns the WCHAR at the given index. | |
| virtual void | setCharAt (char c, long index) |
| Sets the char at the given index. | |
| virtual void | setWCharAt (WCHAR c, long index) |
| Sets the WCHAR at the given index. | |
| virtual long | length () |
| Returns the length of this string. | |
| virtual long | indexOf (char c) |
| Returns the index of the first occurence of c. | |
| virtual long | indexOf (WCHAR c) |
| Returns the index of the first occurence of c. | |
| virtual long | indexOf (char c, long fromindex) |
| Returns the index of the first occurence of c starting at fromindex. | |
| virtual long | indexOf (WCHAR c, long fromindex) |
| Returns the index of the first occurence of c starting at fromindex. | |
| virtual long | lastIndexOf (char c) |
| Returns the index of the last occurence of c. | |
| virtual long | lastIndexOf (WCHAR c) |
| Returns the index of the last occurence of c. | |
| virtual long | lastIndexOf (char c, long fromindex) |
| Returns the index of the last occurence of c starting at fromindex. | |
| virtual long | lastIndexOf (WCHAR c, long fromindex) |
| Returns the index of the last occurence of c starting at fromindex. | |
| virtual int | compareTo (const String &string) |
| Compares this string to another. | |
| virtual int | compareTo (const char *string) |
| Compares this string to another. | |
| virtual int | compareTo (const WCHAR *string) |
| Compares this string to another. | |
| virtual int | compareToIgnoreCase (const String &string) |
| Compares this string to another, ignoring case. | |
| virtual int | compareToIgnoreCase (const char *string) |
| Compares this string to another, ignoring case. | |
| virtual int | compareToIgnoreCase (const WCHAR *string) |
| Compares this string to another, ignoring case. | |
| virtual BOOL | equals (const String &string) |
| Returns whether this string and another are equal. | |
| virtual BOOL | equals (const char *string) |
| Returns whether this string and another are equal. | |
| virtual BOOL | equals (const WCHAR *string) |
| Returns whether this string and another are equal. | |
| virtual BOOL | equalsIgnoreCase (const String &string) |
| Returns whether this string and another are equal, ignoring case. | |
| virtual BOOL | equalsIgnoreCase (const char *string) |
| Returns whether this string and another are equal, ignoring case. | |
| virtual BOOL | equalsIgnoreCase (const WCHAR *string) |
| Returns whether this string and another are equal, ignoring case. | |
| virtual void | operator= (const String &string) |
| Gives this string the same value as another. | |
| virtual void | operator= (const char *string) |
| Gives this string the same value as another. | |
| virtual void | operator= (const WCHAR *string) |
| Gives this string the same value as another. | |
| virtual BOOL | operator== (const String &string) |
| Returns whether this string and another are equal. | |
| virtual BOOL | operator== (const char *string) |
| Returns whether this string and another are equal. | |
| virtual BOOL | operator== (const WCHAR *string) |
| Returns whether this string and another are equal. | |
| virtual BOOL | operator!= (const String &string) |
| Returns whether this string and another are not equal. | |
| virtual BOOL | operator!= (const char *string) |
| Returns whether this string and another are not equal. | |
| virtual BOOL | operator!= (const WCHAR *string) |
| Returns whether this string and another are not equal. | |
| virtual String | operator+ (const String &string) |
| Concatenates this string and another. | |
| virtual String | operator+ (const char *string) |
| Concatenates this string and another. | |
| virtual String | operator+ (const WCHAR *string) |
| Concatenates this string and another. | |
| virtual | operator char * () |
| Returns this string as a new char*. | |
| virtual | operator WCHAR * () |
| Returns this string as a new WCHAR*. | |
| virtual | operator LPARAM () |
| Returns this string as a new LPARAM. | |
| virtual | operator String * () |
| Returns a pointer to this class. | |
Static Public Methods | |
| String | valueOf (long i) |
| Returns the string value of the given integer value. | |
| String | valueOf (char c) |
| Returns the string value of the given character value. | |
| String | valueOf (const char *string) |
| Returns the string value of the given string. | |
| String | valueOf (WCHAR wc) |
| Returns the string value of the given wide character. | |
| String | valueOf (const WCHAR *string) |
| Returns the string value of the given wide character string. | |
| String | valueOf (bool b) |
| Returns the string value of the given boolean value. | |
| String | valueOf (double d) |
| Returns the string value of the given double value. | |
Protected Attributes | |
| WCHAR * | chars |
| The actual string in memory. | |
| long | clen |
| The length of the string. | |
The casting operator overloads return pointers to new arrays that are copies of this string. So you should delete any you make. You should also be aware that any alterations made to these copies will not affect the object. To make the object reflect your alterations you should use the String::setString() method.
|
|
Creates an empty string.
|
|
|
Copy constructor.
|
|
|
Creates a string from a char*.
|
|
|
Create a string from a WCHAR*.
|
|
||||||||||||||||
|
Creates a string from a substring of a char*.
|
|
||||||||||||||||
|
Creates a string from a substring of a WCHAR*.
|
|
|
Destructor.
|
|
|
Returns the char at the given index.
|
|
|
Compares this string to another.
|
|
|
Compares this string to another.
|
|
|
Compares this string to another.
|
|
|
Compares this string to another, ignoring case.
|
|
|
Compares this string to another, ignoring case.
|
|
|
Compares this string to another, ignoring case.
|
|
|
Returns the concatenation of this string and another.
|
|
|
Returns the concatenation of this string and another.
|
|
|
Returns the concatenation of this string and another.
|
|
|
Returns whether this string and another are equal.
|
|
|
Returns whether this string and another are equal.
|
|
|
Returns whether this string and another are equal.
|
|
|
Returns whether this string and another are equal, ignoring case.
|
|
|
Returns whether this string and another are equal, ignoring case.
|
|
|
Returns whether this string and another are equal, ignoring case.
|
|
||||||||||||
|
Returns the index of the first occurence of c starting at fromindex.
|
|
||||||||||||
|
Returns the index of the first occurence of c starting at fromindex.
|
|
|
Returns the index of the first occurence of c.
|
|
|
Returns the index of the first occurence of c.
|
|
||||||||||||
|
Inserts the given string into the this one.
|
|
||||||||||||
|
Inserts the given string into the this one.
|
|
||||||||||||
|
Inserts the given string into the this one.
|
|
||||||||||||
|
Returns the index of the last occurence of c starting at fromindex.
|
|
||||||||||||
|
Returns the index of the last occurence of c starting at fromindex.
|
|
|
Returns the index of the last occurence of c.
|
|
|
Returns the index of the last occurence of c.
|
|
|
Returns the length of this string.
|
|
|
Returns this string as a new char*.
|
|
|
Returns this string as a new LPARAM.
|
|
|
Returns a pointer to this class.
|
|
|
Returns this string as a new WCHAR*.
|
|
|
Returns whether this string and another are not equal.
|
|
|
Returns whether this string and another are not equal.
|
|
|
Returns whether this string and another are not equal.
|
|
|
Concatenates this string and another.
|
|
|
Concatenates this string and another.
|
|
|
Concatenates this string and another.
|
|
|
Gives this string the same value as another.
|
|
|
Gives this string the same value as another.
|
|
|
Gives this string the same value as another.
|
|
|
Returns whether this string and another are equal.
|
|
|
Returns whether this string and another are equal.
|
|
|
Returns whether this string and another are equal.
|
|
||||||||||||
|
Replaces all occurences of a character with another.
|
|
||||||||||||
|
Replaces all occurences of a character with another.
|
|
||||||||||||
|
Sets the char at the given index.
|
|
|
Copies the given string into this one.
|
|
|
Copies the given string into this one.
|
|
|
Copies the given string into this one.
|
|
||||||||||||
|
Sets the WCHAR at the given index.
|
|
||||||||||||
|
Return sthe substring from sindex to count.
|
|
|
Returns the substring from sindex to the end of the string.
|
|
|
Converts this string to all lower case letters.
|
|
|
Converts this string to all upper case letters.
|
|
|
Removes leading and trailing whitespace.
|
|
|
Returns the string value of the given double value.
|
|
|
Returns the string value of the given boolean value.
|
|
|
Returns the string value of the given wide character string.
|
|
|
Returns the string value of the given wide character.
|
|
|
Returns the string value of the given string.
|
|
|
Returns the string value of the given character value.
|
|
|
Returns the string value of the given integer value.
|
|
|
Returns the WCHAR at the given index.
|
|
|
The actual string in memory.
|
|
|
The length of the string.
|
1.2.18