![]() |
TrinityCore
|
#include <ByteBuffer.h>
Classes | |
struct | Reserve |
struct | Resize |
Public Member Functions | |
ByteBuffer () | |
ByteBuffer (size_t size, Reserve) | |
ByteBuffer (size_t size, Resize) | |
ByteBuffer (ByteBuffer &&buf) noexcept | |
ByteBuffer (ByteBuffer const &right)=default | |
ByteBuffer (MessageBuffer &&buffer) | |
std::vector< uint8 > && | Move () noexcept |
ByteBuffer & | operator= (ByteBuffer const &right) |
ByteBuffer & | operator= (ByteBuffer &&right) noexcept |
virtual | ~ByteBuffer ()=default |
void | clear () |
template<typename T > | |
void | append (T value) |
bool | HasUnfinishedBitPack () const |
void | FlushBits () |
void | ResetBitPos () |
bool | WriteBit (bool bit) |
bool | ReadBit () |
void | WriteBits (std::size_t value, int32 bits) |
uint32 | ReadBits (int32 bits) |
template<typename T > | |
void | put (std::size_t pos, T value) |
template<> | |
void | read_skip () |
template<> | |
void | read_skip () |
Static Public Attributes | |
static constexpr size_t | DEFAULT_SIZE = 0x1000 |
static constexpr uint8 | InitialBitPos = 8 |
PutBits | |
Places specified amount of bits of value at specified position in packet. To ensure all bits are correctly written, only call this method after bit flush has been performed | |
size_t | _rpos |
size_t | _wpos |
size_t | _bitpos |
uint8 | _curbitval |
std::vector< uint8 > | _storage |
void | PutBits (std::size_t pos, std::size_t value, uint32 bitCount) |
ByteBuffer & | operator<< (uint8 value) |
ByteBuffer & | operator<< (uint16 value) |
ByteBuffer & | operator<< (uint32 value) |
ByteBuffer & | operator<< (uint64 value) |
ByteBuffer & | operator<< (int8 value) |
ByteBuffer & | operator<< (int16 value) |
ByteBuffer & | operator<< (int32 value) |
ByteBuffer & | operator<< (int64 value) |
ByteBuffer & | operator<< (float value) |
ByteBuffer & | operator<< (double value) |
ByteBuffer & | operator<< (std::string_view value) |
ByteBuffer & | operator<< (std::string const &str) |
ByteBuffer & | operator<< (char const *str) |
ByteBuffer & | operator>> (bool &value) |
ByteBuffer & | operator>> (uint8 &value) |
ByteBuffer & | operator>> (uint16 &value) |
ByteBuffer & | operator>> (uint32 &value) |
ByteBuffer & | operator>> (uint64 &value) |
ByteBuffer & | operator>> (int8 &value) |
ByteBuffer & | operator>> (int16 &value) |
ByteBuffer & | operator>> (int32 &value) |
ByteBuffer & | operator>> (int64 &value) |
ByteBuffer & | operator>> (float &value) |
ByteBuffer & | operator>> (double &value) |
ByteBuffer & | operator>> (std::string &value) |
uint8 & | operator[] (size_t const pos) |
uint8 const & | operator[] (size_t const pos) const |
size_t | rpos () const |
size_t | rpos (size_t rpos_) |
void | rfinish () |
size_t | wpos () const |
size_t | wpos (size_t wpos_) |
size_t | bitwpos () const |
Returns position of last written bit. | |
size_t | bitwpos (size_t newPos) |
template<typename T > | |
void | read_skip () |
void | read_skip (size_t skip) |
template<typename T , typename Underlying = T> | |
T | read () |
template<typename T , typename Underlying = T> | |
T | read (size_t pos) const |
template<class T > | |
void | read (T *dest, size_t count) |
void | read (uint8 *dest, size_t len) |
template<size_t Size> | |
void | read (std::array< uint8, Size > &arr) |
void | ReadPackedUInt64 (uint64 &guid) |
void | ReadPackedUInt64 (uint8 mask, uint64 &value) |
void | WriteString (std::string const &str) |
void | WriteString (std::string_view str) |
void | WriteString (char const *str, size_t len) |
std::string | ReadCString (bool requireValidUtf8=true) |
std::string | ReadString (uint32 length, bool requireValidUtf8=true) |
uint32 | ReadPackedTime () |
uint8 * | contents () |
uint8 const * | contents () const |
size_t | size () const |
bool | empty () const |
void | resize (size_t newsize) |
void | reserve (size_t ressize) |
void | shrink_to_fit () |
void | append (const char *src, size_t cnt) |
template<class T > | |
void | append (const T *src, size_t cnt) |
void | append (uint8 const *src, size_t cnt) |
void | append (ByteBuffer const &buffer) |
template<size_t Size> | |
void | append (std::array< uint8, Size > const &arr) |
void | appendPackXYZ (float x, float y, float z) |
void | AppendPackedUInt64 (uint64 guid) |
void | AppendPackedTime (time_t time) |
void | put (size_t pos, uint8 const *src, size_t cnt) |
void | print_storage () const |
void | textlike () const |
void | hexlike () const |
static size_t | PackUInt64 (uint64 value, uint8 *mask, uint8 *result) |
Definition at line 61 of file ByteBuffer.h.
|
inline |
Definition at line 68 of file ByteBuffer.h.
|
inline |
Definition at line 77 of file ByteBuffer.h.
|
inline |
Definition at line 82 of file ByteBuffer.h.
|
inlinenoexcept |
Definition at line 87 of file ByteBuffer.h.
|
default |
ByteBuffer::ByteBuffer | ( | MessageBuffer && | buffer | ) |
Definition at line 28 of file ByteBuffer.cpp.
|
virtualdefault |
|
inline |
Definition at line 572 of file ByteBuffer.h.
|
inline |
Definition at line 559 of file ByteBuffer.h.
|
inline |
Definition at line 565 of file ByteBuffer.h.
|
inline |
Definition at line 579 of file ByteBuffer.h.
|
inline |
Definition at line 143 of file ByteBuffer.h.
void ByteBuffer::append | ( | uint8 const * | src, |
size_t | cnt | ||
) |
Definition at line 110 of file ByteBuffer.cpp.
void ByteBuffer::AppendPackedTime | ( | time_t | time | ) |
Definition at line 137 of file ByteBuffer.cpp.
|
inline |
Definition at line 594 of file ByteBuffer.h.
|
inline |
Definition at line 585 of file ByteBuffer.h.
|
inline |
Returns position of last written bit.
Definition at line 421 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 133 of file ByteBuffer.h.
|
inline |
Definition at line 524 of file ByteBuffer.h.
|
inline |
Definition at line 531 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 155 of file ByteBuffer.h.
|
inline |
void ByteBuffer::hexlike | ( | ) | const |
Definition at line 200 of file ByteBuffer.cpp.
|
inlinenoexcept |
Definition at line 94 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 297 of file ByteBuffer.h.
|
inline |
Definition at line 291 of file ByteBuffer.h.
|
inline |
Definition at line 272 of file ByteBuffer.h.
|
inline |
Definition at line 278 of file ByteBuffer.h.
|
inline |
Definition at line 284 of file ByteBuffer.h.
|
inline |
Definition at line 266 of file ByteBuffer.h.
|
inline |
|
inline |
|
inline |
Definition at line 247 of file ByteBuffer.h.
|
inline |
Definition at line 253 of file ByteBuffer.h.
|
inline |
Definition at line 259 of file ByteBuffer.h.
|
inline |
Definition at line 241 of file ByteBuffer.h.
|
inlinenoexcept |
Definition at line 117 of file ByteBuffer.h.
|
inline |
Definition at line 103 of file ByteBuffer.h.
|
inline |
Definition at line 321 of file ByteBuffer.h.
ByteBuffer & ByteBuffer::operator>> | ( | double & | value | ) |
Definition at line 56 of file ByteBuffer.cpp.
ByteBuffer & ByteBuffer::operator>> | ( | float & | value | ) |
Definition at line 48 of file ByteBuffer.cpp.
|
inline |
Definition at line 358 of file ByteBuffer.h.
|
inline |
Definition at line 364 of file ByteBuffer.h.
|
inline |
Definition at line 370 of file ByteBuffer.h.
|
inline |
Definition at line 352 of file ByteBuffer.h.
|
inline |
Definition at line 379 of file ByteBuffer.h.
|
inline |
Definition at line 333 of file ByteBuffer.h.
|
inline |
Definition at line 339 of file ByteBuffer.h.
|
inline |
Definition at line 345 of file ByteBuffer.h.
|
inline |
Definition at line 327 of file ByteBuffer.h.
|
inline |
Definition at line 385 of file ByteBuffer.h.
|
inline |
Definition at line 392 of file ByteBuffer.h.
Definition at line 607 of file ByteBuffer.h.
void ByteBuffer::print_storage | ( | ) | const |
Definition at line 169 of file ByteBuffer.cpp.
void ByteBuffer::put | ( | size_t | pos, |
uint8 const * | src, | ||
size_t | cnt | ||
) |
Definition at line 144 of file ByteBuffer.cpp.
|
inline |
Definition at line 220 of file ByteBuffer.h.
void ByteBuffer::PutBits | ( | std::size_t | pos, |
std::size_t | value, | ||
uint32 | bitCount | ||
) |
Definition at line 153 of file ByteBuffer.cpp.
|
inline |
Definition at line 443 of file ByteBuffer.h.
|
inline |
Definition at line 452 of file ByteBuffer.h.
|
inline |
Definition at line 480 of file ByteBuffer.h.
|
inline |
Definition at line 463 of file ByteBuffer.h.
|
inline |
Definition at line 469 of file ByteBuffer.h.
|
inline |
Definition at line 431 of file ByteBuffer.h.
|
inline |
Definition at line 652 of file ByteBuffer.h.
|
inline |
Definition at line 659 of file ByteBuffer.h.
|
inline |
Definition at line 433 of file ByteBuffer.h.
|
inline |
Definition at line 191 of file ByteBuffer.h.
Definition at line 209 of file ByteBuffer.h.
std::string ByteBuffer::ReadCString | ( | bool | requireValidUtf8 = true | ) |
Definition at line 64 of file ByteBuffer.cpp.
uint32 ByteBuffer::ReadPackedTime | ( | ) |
Definition at line 95 of file ByteBuffer.cpp.
|
inline |
Definition at line 485 of file ByteBuffer.h.
Definition at line 491 of file ByteBuffer.h.
std::string ByteBuffer::ReadString | ( | uint32 | length, |
bool | requireValidUtf8 = true |
||
) |
Definition at line 79 of file ByteBuffer.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 401 of file ByteBuffer.h.
|
inline |
Definition at line 554 of file ByteBuffer.h.
|
inline |
void ByteBuffer::textlike | ( | ) | const |
Definition at line 183 of file ByteBuffer.cpp.
|
inline |
|
inline |
Definition at line 414 of file ByteBuffer.h.
|
inline |
Definition at line 175 of file ByteBuffer.h.
|
inline |
Definition at line 203 of file ByteBuffer.h.
|
inline |
Definition at line 512 of file ByteBuffer.h.
|
inline |
Method for writing strings that have their length sent separately in packet without null-terminating the string
Definition at line 500 of file ByteBuffer.h.
|
inline |
Definition at line 506 of file ByteBuffer.h.
|
protected |
Definition at line 638 of file ByteBuffer.h.
|
protected |
Definition at line 639 of file ByteBuffer.h.
|
protected |
Definition at line 638 of file ByteBuffer.h.
|
protected |
Definition at line 640 of file ByteBuffer.h.
|
protected |
Definition at line 638 of file ByteBuffer.h.
|
staticconstexpr |
Definition at line 64 of file ByteBuffer.h.
|
staticconstexpr |
Definition at line 65 of file ByteBuffer.h.