String class.
|
Public Member Functions |
| operator const char * () const |
| Implicit return of const char*.
|
const char * | C_String (void) const |
| Same as std::string::c_str.
|
RakString & | operator= (const RakString &rhs) |
| Assigment operators.
|
RakString & | operator+= (const RakString &rhs) |
| Concatenation.
|
unsigned char | operator[] (const unsigned int position) const |
| Character index. Do not use to change the string however.
|
size_t | Find (const char *stringToFind, size_t pos=0) |
bool | operator== (const RakString &rhs) const |
| Equality.
|
bool | operator!= (const RakString &rhs) const |
| Inequality.
|
const char * | ToLower (void) |
| Change all characters to lowercase.
|
const char * | ToUpper (void) |
| Change all characters to uppercase.
|
void | Set (const char *format,...) |
| Set the value of the string.
|
RakString | Assign (const char *str, size_t pos, size_t n) |
bool | IsEmpty (void) const |
| Returns if the string is empty. Also, C_String() would return "".
|
size_t | GetLength (void) const |
| Returns the length of the string.
|
void | Replace (unsigned index, unsigned count, unsigned char c) |
| Replace character(s) in starting at index, for count, with c.
|
void | SetChar (unsigned index, unsigned char c) |
| Replace character at index with c.
|
void | SetChar (unsigned index, RakNet::RakString s) |
| Replace character at index with string s.
|
void | Truncate (unsigned int length) |
| Make sure string is no longer than length.
|
void | Erase (unsigned int index, unsigned int count) |
| Erase characters out of the string at index for count.
|
void | TerminateAtFirstCharacter (char c) |
| Set the first instance of c with a NULL terminator.
|
void | TerminateAtLastCharacter (char c) |
| Set the last instance of c with a NULL terminator.
|
void | RemoveCharacter (char c) |
| Remove all instances of c.
|
int | StrCmp (const RakString &rhs) const |
| Compare strings (case sensitive).
|
int | StrICmp (const RakString &rhs) const |
| Compare strings (not case sensitive).
|
void | Clear (void) |
| Clear the string.
|
void | Printf (void) |
| Print the string to the screen.
|
void | FPrintf (FILE *fp) |
| Print the string to a file.
|
bool | IPAddressMatch (const char *IP) |
| Does the given IP address match the IP address encoded into this string, accounting for wildcards?
|
bool | ContainsNonprintableExceptSpaces (void) const |
| Does the string contain non-printable characters other than spaces?
|
bool | IsEmailAddress (void) const |
| Is this a valid email address?
|
RakNet::RakString & | URLEncode (void) |
| URL Encode the string. See http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4029/.
|
RakNet::RakString & | URLDecode (void) |
| URL decode the string.
|
void | SplitURI (RakNet::RakString &header, RakNet::RakString &domain, RakNet::RakString &path) |
| https://servers.api.rackspacecloud.com/v1.0 to https://, servers.api.rackspacecloud.com, /v1.0
|
RakNet::RakString & | SQLEscape (void) |
| Scan for quote, double quote, and backslash and prepend with backslash.
|
RakNet::RakString & | MakeFilePath (void) |
| Fix to be a file path, ending with /.
|
void | Serialize (BitStream *bs) const |
void | SerializeCompressed (BitStream *bs, uint8_t languageId=0, bool writeLanguageId=false) const |
bool | Deserialize (BitStream *bs) |
bool | DeserializeCompressed (BitStream *bs, bool readLanguageId=false) |
Static Public Member Functions |
static RakNet::RakString | NonVariadic (const char *str) |
static unsigned long | ToInteger (const char *str) |
| Has the string into an unsigned int.
|
static void | FreeMemory (void) |
static void | Serialize (const char *str, BitStream *bs) |
| Static version of the Serialize function.
|
static void | SerializeCompressed (const char *str, BitStream *bs, uint8_t languageId=0, bool writeLanguageId=false) |
| Static version of the SerializeCompressed function.
|
static bool | Deserialize (char *str, BitStream *bs) |
| Static version of the Deserialize() function.
|
static bool | DeserializeCompressed (char *str, BitStream *bs, bool readLanguageId=false) |
| Static version of the DeserializeCompressed() function.
|
String class.
Has the following improvements over std::string -Reference counting: Suitable to store in lists -Variadic assignment operator -Doesn't cause linker errors