|
| BareNetworkString (int capacity=16) |
| Constructor, sets the protocol type of this message.
|
|
| BareNetworkString (const std::string &s) |
|
| BareNetworkString (const char *data, int len) |
| Initialises the string with a sequence of characters.
|
|
void | reset () |
| Allows one to read a buffer from the beginning again.
|
|
BareNetworkString & | encodeString16 (const irr::core::stringw &value, uint16_t max_len=65535) |
| Encode string with max length of 16bit and utf32, used in motd or chat.
|
|
int | decodeString16 (irr::core::stringw *out, uint16_t max_len=65535) |
|
BareNetworkString & | encodeString (const std::string &value) |
| Adds one byte for the length of the string, and then (up to 255 of) the characters of the given string.
|
|
BareNetworkString & | encodeString (const irr::core::stringw &value) |
| Adds one byte for the length of the string, and then (up to 255 of) the characters of the given string.
|
|
int | decodeString (std::string *out) const |
| Returns a string at the given position.
|
|
int | decodeStringW (irr::core::stringw *out) const |
| Returns an irrlicht wide string from the utf8 encoded string at the given position.
|
|
std::string | getLogMessage (const std::string &indent="") const |
| Returns a string representing this message suitable to be printed to stdout or via the Log mechanism.
|
|
std::vector< uint8_t > & | getBuffer () |
| Returns the internal buffer of the network string.
|
|
char * | getData () |
| Returns a byte pointer to the content of the network string.
|
|
const char * | getData () const |
| Returns a byte pointer to the content of the network string.
|
|
char * | getCurrentData () |
| Returns a byte pointer to the unread remaining content of the network string.
|
|
const char * | getCurrentData () const |
| Returns a byte pointer to the unread remaining content of the network string.
|
|
int | getCurrentOffset () const |
|
unsigned int | size () const |
| Returns the remaining length of the network string.
|
|
void | skip (int n) |
| Skips the specified number of bytes when reading.
|
|
unsigned int | getTotalSize () const |
| Returns the send size, which is the full length of the buffer.
|
|
BareNetworkString & | addUInt8 (const uint8_t value) |
| Add 8 bit unsigned int.
|
|
BareNetworkString & | addChar (const char value) |
| Adds a single character to the string.
|
|
BareNetworkString & | addUInt16 (const uint16_t value) |
| Adds 16 bit unsigned int.
|
|
BareNetworkString & | addInt24 (const int value) |
| Adds signed 24 bit integer.
|
|
BareNetworkString & | addUInt32 (const uint32_t &value) |
| Adds unsigned 32 bit integer.
|
|
BareNetworkString & | addUInt64 (const uint64_t &value) |
| Adds unsigned 64 bit integer.
|
|
BareNetworkString & | addFloat (const float value) |
| Adds a 4 byte floating point value.
|
|
BareNetworkString & | operator+= (BareNetworkString const &value) |
| Adds the content of another network string.
|
|
BareNetworkString & | add (float f) |
| Adds a floating point number.
|
|
BareNetworkString & | add (const Vec3 &xyz) |
| Adds the xyz components of a Vec3 to the string.
|
|
BareNetworkString & | add (const btQuaternion &quat) |
| Adds the four components of a quaternion.
|
|
BareNetworkString & | addTime (int ticks) |
| Adds a function to add a time ticks value.
|
|
uint64_t | getUInt64 () const |
| Returns a unsigned 64 bit integer.
|
|
uint32_t | getUInt32 () const |
| Returns a unsigned 32 bit integer.
|
|
int | getInt24 () const |
| Returns a signed 24 bit integer.
|
|
uint32_t | getTime () const |
| Returns a unsigned 32 bit integer.
|
|
uint16_t | getUInt16 () const |
| Returns an unsigned 16 bit integer.
|
|
int16_t | getInt16 () const |
| Returns an unsigned 16 bit integer.
|
|
uint8_t | getUInt8 () const |
| Returns an unsigned 8-bit integer.
|
|
int8_t | getInt8 () const |
| Returns an unsigned 8-bit integer.
|
|
float | getFloat () const |
| Gets a 4 byte floating point value.
|
|
Vec3 | getVec3 () const |
| Gets a Vec3.
|
|
btQuaternion | getQuat () const |
| Gets a bullet quaternion.
|
|
Describes a chain of 8-bit unsigned integers.
This class allows you to easily create and parse 8-bit strings, has functions to add and read other data types (e.g. int, strings). It does not enforce any structure on the sequence (NetworkString uses this as a base class, and enforces a protocol type in the first byte)