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. More... | |
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_view | ReadCString (bool requireValidUtf8=true) |
std::string_view | ReadString (uint32 length, bool requireValidUtf8=true) |
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 | 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 55 of file ByteBuffer.h.
|
inline |
Definition at line 62 of file ByteBuffer.h.
|
inline |
|
inline |
|
inlinenoexcept |
Definition at line 81 of file ByteBuffer.h.
|
default |
ByteBuffer::ByteBuffer | ( | MessageBuffer && | buffer | ) |
Definition at line 28 of file ByteBuffer.cpp.
|
virtualdefault |
|
inline |
|
inline |
Definition at line 551 of file ByteBuffer.h.
|
inline |
Definition at line 557 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 137 of file ByteBuffer.h.
void ByteBuffer::append | ( | uint8 const * | src, |
size_t | cnt | ||
) |
|
inline |
Definition at line 586 of file ByteBuffer.h.
|
inline |
|
inline |
Returns position of last written bit.
Definition at line 415 of file ByteBuffer.h.
|
inline |
Definition at line 417 of file ByteBuffer.h.
|
inline |
|
inline |
|
inline |
Definition at line 523 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 149 of file ByteBuffer.h.
|
inline |
void ByteBuffer::hexlike | ( | ) | const |
Definition at line 177 of file ByteBuffer.cpp.
|
inlinenoexcept |
Definition at line 88 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 291 of file ByteBuffer.h.
|
inline |
Definition at line 285 of file ByteBuffer.h.
|
inline |
Definition at line 266 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 260 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 297 of file ByteBuffer.h.
|
inline |
Definition at line 241 of file ByteBuffer.h.
|
inline |
Definition at line 247 of file ByteBuffer.h.
|
inline |
Definition at line 253 of file ByteBuffer.h.
|
inline |
Definition at line 235 of file ByteBuffer.h.
|
inlinenoexcept |
Definition at line 111 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 315 of file ByteBuffer.h.
ByteBuffer & ByteBuffer::operator>> | ( | double & | value | ) |
Definition at line 50 of file ByteBuffer.cpp.
ByteBuffer & ByteBuffer::operator>> | ( | float & | value | ) |
Definition at line 42 of file ByteBuffer.cpp.
|
inline |
Definition at line 352 of file ByteBuffer.h.
|
inline |
Definition at line 358 of file ByteBuffer.h.
|
inline |
Definition at line 364 of file ByteBuffer.h.
|
inline |
Definition at line 346 of file ByteBuffer.h.
|
inline |
Definition at line 373 of file ByteBuffer.h.
|
inline |
Definition at line 327 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 321 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 599 of file ByteBuffer.h.
void ByteBuffer::print_storage | ( | ) | const |
Definition at line 146 of file ByteBuffer.cpp.
void ByteBuffer::put | ( | size_t | pos, |
uint8 const * | src, | ||
size_t | cnt | ||
) |
|
inline |
Definition at line 214 of file ByteBuffer.h.
void ByteBuffer::PutBits | ( | std::size_t | pos, |
std::size_t | value, | ||
uint32 | bitCount | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 457 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 425 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 646 of file ByteBuffer.h.
|
inline |
|
inline |
std::string_view ByteBuffer::ReadCString | ( | bool | requireValidUtf8 = true | ) |
Definition at line 58 of file ByteBuffer.cpp.
|
inline |
Definition at line 479 of file ByteBuffer.h.
Definition at line 485 of file ByteBuffer.h.
std::string_view ByteBuffer::ReadString | ( | uint32 | length, |
bool | requireValidUtf8 = true |
||
) |
Definition at line 78 of file ByteBuffer.cpp.
|
inline |
Definition at line 540 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 533 of file ByteBuffer.h.
|
inline |
|
inline |
|
inline |
Definition at line 395 of file ByteBuffer.h.
|
inline |
Definition at line 546 of file ByteBuffer.h.
|
inline |
void ByteBuffer::textlike | ( | ) | const |
|
inline |
|
inline |
Definition at line 408 of file ByteBuffer.h.
|
inline |
|
inline |
|
inline |
Definition at line 506 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 494 of file ByteBuffer.h.
|
inline |
Definition at line 500 of file ByteBuffer.h.
|
protected |
Definition at line 628 of file ByteBuffer.h.
|
protected |
Definition at line 629 of file ByteBuffer.h.
|
protected |
Definition at line 628 of file ByteBuffer.h.
|
protected |
Definition at line 630 of file ByteBuffer.h.
|
protected |
Definition at line 628 of file ByteBuffer.h.
|
staticconstexpr |
Definition at line 58 of file ByteBuffer.h.
|
staticconstexpr |
Definition at line 59 of file ByteBuffer.h.