SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
SLNet::RakWString Class Reference

String class for Unicode. More...

`#include <slikenet/wstring.h>`

## Public Member Functions

| RakWString ()
| RakWString (const RakString &right)
| RakWString (const wchar_t *input)
| RakWString (const RakWString &right)
| RakWString (const char *input)
| ~RakWString ()
| operator wchar_t * () const
| Implicit return of wchar_t*.
const wchar_t * | C_String (void) const
| Same as std::string::c_str.
RakWString & | operator= (const RakWString &right)
| Assignment operators.
RakWString & | operator= (const RakString &right)
RakWString & | operator= (const wchar_t *const str)
RakWString & | operator= (wchar_t *str)
RakWString & | operator= (const char *const str)
RakWString & | operator= (char *str)
RakWString & | operator+= (const RakWString &right)
| Concatenation.
RakWString & | operator+= (const wchar_t *const right)
RakWString & | operator+= (wchar_t *right)
bool | operator== (const RakWString &right) const
| Equality.
bool | operator< (const RakWString &right) const
bool | operator<= (const RakWString &right) const
bool | operator> (const RakWString &right) const
bool | operator>= (const RakWString &right) const
bool | operator!= (const RakWString &right) const
| Inequality.
void | Set (wchar_t *str)
| Set the value of the string.
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.
int | StrCmp (const RakWString &right) const
| Compare strings (case sensitive)
int | StrICmp (const RakWString &right) 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.
void | Serialize (BitStream *bs) const
bool | Deserialize (BitStream *bs)

## Static Public Member Functions

static unsigned long | ToInteger (const RakWString &rs)
| Has the string into an unsigned int.
static void | Serialize (const wchar_t *const str, BitStream *bs)
| Static version of the Serialize function.
static bool | Deserialize (wchar_t *str, BitStream *bs)
| Static version of the Deserialize() function.
static bool | Deserialize (wchar_t *str, size_t strLength, BitStream *bs)

## Protected Attributes

wchar_t * | c_str
size_t | c_strCharLength

## Detailed Description

String class for Unicode.

Definition at line 33 of file wstring.h.

## Constructor & Destructor Documentation

RakWString::RakWString | ( |  | ) |

Definition at line 30 of file RakWString.cpp.

References c_str, and c_strCharLength.

RakWString::RakWString | ( | const RakString & | right | ) |

Definition at line 35 of file RakWString.cpp.

References c_str, and c_strCharLength.

RakWString::RakWString | ( | const wchar_t * | input | ) |

Definition at line 47 of file RakWString.cpp.

References c_str, and c_strCharLength.

RakWString::RakWString | ( | const RakWString & | right | ) |

Definition at line 53 of file RakWString.cpp.

References c_str, and c_strCharLength.

RakWString::RakWString | ( | const char * | input | ) |

Definition at line 41 of file RakWString.cpp.

References c_str, and c_strCharLength.

RakWString::~RakWString | ( |  | ) |

Definition at line 59 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, and rakFree_Ex.

## Member Function Documentation

const wchar_t* SLNet::RakWString::C_String | ( | void |  | ) | const

inline

Same as std::string::c_str.

Definition at line 48 of file wstring.h.

Referenced by FPrintf(), operator!=(), operator+=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), Printf(), Serialize(), StrCmp(), StrICmp(), and ToInteger().

void RakWString::Clear | ( | void |  | ) |

Clear the string.

Definition at line 278 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, and rakFree_Ex.

Referenced by Deserialize(), and operator=().

bool RakWString::Deserialize | ( | BitStream * | bs | ) |

Deserialize what was written by Serialize

Parameters

  [in] | bs | Bitstream to serialize from

Returns
  true if the deserialization was successful

Definition at line 318 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, Clear(), MAX_BYTES_PER_UNICODE_CHAR, rakFree_Ex, rakMalloc_Ex, SLNet::BitStream::Read(), SLNet::BitStream::ReadAlignedBytes(), and SLNet::BitStream::ReadCasted().

Referenced by SLNet::BitStream::Read(), and SLNet::BitStream::ReadCompressed().

bool RakWString::Deserialize | ( | wchar_t * | str,
|  | BitStream * | bs
| ) |  |

static

Static version of the Deserialize() function.

Definition at line 359 of file RakWString.cpp.

References _FILE_AND_LINE_, c_strCharLength, rakFree_Ex, rakMalloc_Ex, SLNet::BitStream::Read(), SLNet::BitStream::ReadAlignedBytes(), and SLNet::BitStream::ReadCasted().

bool RakWString::Deserialize | ( | wchar_t * | str,
|  | size_t | strLength,
|  | BitStream * | bs
| ) |  |

static

Definition at line 400 of file RakWString.cpp.

References _FILE_AND_LINE_, c_strCharLength, rakFree_Ex, rakMalloc_Ex, SLNet::BitStream::Read(), SLNet::BitStream::ReadAlignedBytes(), and SLNet::BitStream::ReadCasted().

void RakWString::FPrintf | ( | FILE * | fp | ) |

Print the string to a file.

Definition at line 288 of file RakWString.cpp.

References C_String().

size_t RakWString::GetLength | ( | void |  | ) | const

Returns the length of the string.

Definition at line 246 of file RakWString.cpp.

References c_strCharLength.

Referenced by IsEmpty(), operator!=(), operator+=(), operator=(), operator==(), and ToInteger().

bool RakWString::IsEmpty | ( | void |  | ) | const

Returns if the string is empty. Also, C_String() would return "".

Definition at line 242 of file RakWString.cpp.

References GetLength().

Referenced by operator+=(), and operator=().

SLNet::RakWString::operator wchar_t * | ( |  | ) | const

inline

Implicit return of wchar_t*.

Definition at line 45 of file wstring.h.

bool RakWString::operator!= | ( | const RakWString & | right | ) | const

Inequality.

Definition at line 232 of file RakWString.cpp.

References C_String(), and GetLength().

RakWString & RakWString::operator+= | ( | const RakWString & | right | ) |

Concatenation.

Definition at line 147 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, C_String(), GetLength(), IsEmpty(), MAX_BYTES_PER_UNICODE_CHAR, notifyOutOfMemory, rakMalloc_Ex, and rakRealloc_Ex.

RakWString & RakWString::operator+= | ( | const wchar_t *const | right | ) |

Definition at line 176 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, IsEmpty(), MAX_BYTES_PER_UNICODE_CHAR, notifyOutOfMemory, rakMalloc_Ex, and rakRealloc_Ex.

RakWString & RakWString::operator+= | ( | wchar_t * | right | ) |

Definition at line 206 of file RakWString.cpp.

bool RakWString::operator< | ( | const RakWString & | right | ) | const

Definition at line 216 of file RakWString.cpp.

References C_String().

bool RakWString::operator<= | ( | const RakWString & | right | ) | const

Definition at line 220 of file RakWString.cpp.

References C_String().

RakWString & RakWString::operator= | ( | const RakWString & | right | ) |

Assignment operators.

Definition at line 63 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, C_String(), Clear(), GetLength(), IsEmpty(), MAX_BYTES_PER_UNICODE_CHAR, notifyOutOfMemory, and rakMalloc_Ex.

RakWString & RakWString::operator= | ( | const RakString & | right | ) |

Definition at line 80 of file RakWString.cpp.

References SLNet::RakString::C_String().

RakWString & RakWString::operator= | ( | const wchar_t *const | str | ) |

Definition at line 84 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, Clear(), MAX_BYTES_PER_UNICODE_CHAR, notifyOutOfMemory, and rakMalloc_Ex.

RakWString & RakWString::operator= | ( | wchar_t * | str | ) |

Definition at line 103 of file RakWString.cpp.

RakWString & RakWString::operator= | ( | const char *const | str | ) |

Definition at line 108 of file RakWString.cpp.

References _FILE_AND_LINE_, c_str, c_strCharLength, Clear(), MAX_BYTES_PER_UNICODE_CHAR, notifyOutOfMemory, RakAssert, rakMalloc_Ex, and RAKNET_DEBUG_PRINTF.

RakWString & RakWString::operator= | ( | char * | str | ) |

Definition at line 142 of file RakWString.cpp.

bool RakWString::operator== | ( | const RakWString & | right | ) | const

Equality.

Definition at line 210 of file RakWString.cpp.

References C_String(), and GetLength().

bool RakWString::operator> | ( | const RakWString & | right | ) | const

Definition at line 224 of file RakWString.cpp.

References C_String().

bool RakWString::operator>= | ( | const RakWString & | right | ) | const

Definition at line 228 of file RakWString.cpp.

References C_String().

void RakWString::Printf | ( | void |  | ) |

Print the string to the screen.

Definition at line 284 of file RakWString.cpp.

References C_String().

void RakWString::Serialize | ( | BitStream * | bs | ) | const

Serialize to a bitstream, uncompressed (slightly faster)

Parameters

  [out] | bs | Bitstream to serialize to

Definition at line 292 of file RakWString.cpp.

References C_String().

Referenced by SLNet::BitStream::Write(), and SLNet::BitStream::WriteCompressed().

void RakWString::Serialize | ( | const wchar_t *const | str,
|  | BitStream * | bs
| ) |  |

static

Static version of the Serialize function.

Definition at line 296 of file RakWString.cpp.

References _FILE_AND_LINE_, MAX_BYTES_PER_UNICODE_CHAR, rakFree_Ex, rakMalloc_Ex, SLNet::BitStream::Write(), SLNet::BitStream::WriteAlignedBytes(), and SLNet::BitStream::WriteCasted().

void RakWString::Set | ( | wchar_t * | str | ) |

Set the value of the string.

Definition at line 238 of file RakWString.cpp.

int RakWString::StrCmp | ( | const RakWString & | right | ) | const

Compare strings (case sensitive)

Definition at line 265 of file RakWString.cpp.

References C_String().

int RakWString::StrICmp | ( | const RakWString & | right | ) | const

Compare strings (not case sensitive)

Definition at line 269 of file RakWString.cpp.

References C_String().

unsigned long RakWString::ToInteger | ( | const RakWString & | rs | ) |

static

Has the string into an unsigned int.

Definition at line 250 of file RakWString.cpp.

References C_String(), GetLength(), and MAX_BYTES_PER_UNICODE_CHAR.

## Member Data Documentation

wchar_t* SLNet::RakWString::c_str

protected

Definition at line 120 of file wstring.h.

Referenced by Clear(), Deserialize(), operator+=(), operator=(), RakWString(), and ~RakWString().

size_t SLNet::RakWString::c_strCharLength

protected

Definition at line 121 of file wstring.h.

Referenced by Clear(), Deserialize(), GetLength(), operator+=(), operator=(), and RakWString().

The documentation for this class was generated from the following files:

- Source/include/slikenet/wstring.h
- Source/src/RakWString.cpp