![]() |
TrinityCore
|
#include <ByteBuffer.h>
Inheritance diagram for ByteBuffer:Classes | |
| struct | Reserve |
| struct | Resize |
Public Member Functions | |
| ByteBuffer () | |
| ByteBuffer (size_t size, Reserve) | |
| ByteBuffer (size_t size, Resize) | |
| ByteBuffer (ByteBuffer const &right)=default | |
| ByteBuffer (ByteBuffer &&buf) noexcept | |
| ByteBuffer (std::vector< uint8 > &&buffer) noexcept | |
| std::vector< uint8 > && | Release () &&noexcept |
| ByteBuffer & | operator= (ByteBuffer const &right)=default |
| ByteBuffer & | operator= (ByteBuffer &&right) noexcept |
| virtual | ~ByteBuffer ()=default |
| void | clear () |
| template<ByteBufferNumeric T> | |
| void | append (T value) |
| bool | HasUnfinishedBitPack () const |
| void | FlushBits () |
| void | ResetBitPos () |
| bool | WriteBit (bool bit) |
| bool | ReadBit () |
| void | WriteBits (uint64 value, int32 bits) |
| uint32 | ReadBits (int32 bits) |
| template<ByteBufferNumeric T> | |
| void | put (std::size_t pos, T value) |
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 |
| uint8 | _bitpos |
| uint8 | _curbitval |
| std::vector< uint8 > | _storage |
| void | PutBits (std::size_t pos, std::size_t value, uint32 bitCount) |
| ByteBuffer & | operator<< (bool)=delete |
| ByteBuffer & | operator<< (char 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_view value) |
| ByteBuffer & | operator<< (std::string const &str) |
| ByteBuffer & | operator<< (char const *str) |
| ByteBuffer & | operator>> (bool &)=delete |
| ByteBuffer & | operator>> (char &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<ByteBufferNumeric T> | |
| void | read_skip () |
| void | read_skip (size_t skip) |
| template<ByteBufferNumeric T> | |
| T | read () |
| template<ByteBufferNumeric T> | |
| T | read (size_t pos) const |
| template<ByteBufferNumeric T> | |
| void | read (T *dest, size_t count) |
| void | read (uint8 *dest, size_t len) |
| template<ByteBufferNumeric T, size_t Size> | |
| void | read (std::array< T, Size > &arr) |
| void | WriteString (std::string const &str) |
| void | WriteString (std::string_view str) |
| void | WriteString (char const *str, size_t len) |
| void | ReadSkipCString (bool requireValidUtf8=true) |
| std::string_view | ReadCString (bool requireValidUtf8=true) |
| std::string_view | ReadString (uint32 length, bool requireValidUtf8=true) |
| uint8 * | data () |
| uint8 const * | data () const |
| size_t | size () const |
| bool | empty () const |
| void | resize (size_t newsize) |
| void | reserve (size_t ressize) |
| void | shrink_to_fit () |
| template<ByteBufferNumeric T> | |
| void | append (T const *src, size_t cnt) |
| void | append (uint8 const *src, size_t cnt) |
| void | append (ByteBuffer const &buffer) |
| template<ByteBufferNumeric T, std::size_t Size> | |
| void | append (std::array< T, Size > const &arr) |
| void | put (size_t pos, uint8 const *src, size_t cnt) |
| void | print_storage () const |
| void | textlike () const |
| void | hexlike () const |
| void | OnInvalidPosition (size_t pos, size_t valueSize) const |
Definition at line 62 of file ByteBuffer.h.
|
inlineexplicit |
Definition at line 73 of file ByteBuffer.h.
|
inlineexplicit |
Definition at line 75 of file ByteBuffer.h.
|
inlineexplicit |
Definition at line 80 of file ByteBuffer.h.
|
default |
|
inlinenoexcept |
Definition at line 87 of file ByteBuffer.h.
|
inlineexplicitnoexcept |
Definition at line 90 of file ByteBuffer.h.
|
virtualdefault |
|
inline |
|
inline |
Definition at line 609 of file ByteBuffer.h.
|
inline |
Definition at line 590 of file ByteBuffer.h.
|
inline |
Definition at line 130 of file ByteBuffer.h.
Here is the call graph for this function:
Here is the caller graph for this function:| void ByteBuffer::append | ( | uint8 const * | src, |
| size_t | cnt | ||
| ) |
|
inline |
Returns position of last written bit.
Definition at line 470 of file ByteBuffer.h.
|
inline |
Definition at line 472 of file ByteBuffer.h.
|
inline |
|
inline |
|
inline |
Definition at line 566 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 141 of file ByteBuffer.h.
|
inline |
| void ByteBuffer::hexlike | ( | ) | const |
Definition at line 166 of file ByteBuffer.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void ByteBuffer::OnInvalidPosition | ( | size_t | pos, |
| size_t | valueSize | ||
| ) | const |
Definition at line 196 of file ByteBuffer.cpp.
|
delete |
|
inline |
|
inline |
Definition at line 282 of file ByteBuffer.h.
|
inline |
Definition at line 344 of file ByteBuffer.h.
|
inline |
Definition at line 338 of file ByteBuffer.h.
|
inline |
Definition at line 319 of file ByteBuffer.h.
|
inline |
Definition at line 325 of file ByteBuffer.h.
|
inline |
Definition at line 331 of file ByteBuffer.h.
|
inline |
Definition at line 313 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 350 of file ByteBuffer.h.
|
inline |
Definition at line 294 of file ByteBuffer.h.
|
inline |
Definition at line 300 of file ByteBuffer.h.
|
inline |
Definition at line 306 of file ByteBuffer.h.
|
inline |
Definition at line 288 of file ByteBuffer.h.
|
inlinenoexcept |
Definition at line 104 of file ByteBuffer.h.
|
default |
Here is the caller graph for this function:
|
delete |
|
inline |
Definition at line 370 of file ByteBuffer.h.
| ByteBuffer & ByteBuffer::operator>> | ( | double & | value | ) |
| ByteBuffer & ByteBuffer::operator>> | ( | float & | value | ) |
|
inline |
Definition at line 407 of file ByteBuffer.h.
|
inline |
Definition at line 413 of file ByteBuffer.h.
|
inline |
Definition at line 419 of file ByteBuffer.h.
|
inline |
Definition at line 401 of file ByteBuffer.h.
|
inline |
Definition at line 428 of file ByteBuffer.h.
|
inline |
Definition at line 382 of file ByteBuffer.h.
|
inline |
Definition at line 388 of file ByteBuffer.h.
|
inline |
Definition at line 394 of file ByteBuffer.h.
|
inline |
Definition at line 376 of file ByteBuffer.h.
|
inline |
Definition at line 434 of file ByteBuffer.h.
|
inline |
Definition at line 441 of file ByteBuffer.h.
| void ByteBuffer::print_storage | ( | ) | const |
Definition at line 140 of file ByteBuffer.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void ByteBuffer::put | ( | size_t | pos, |
| uint8 const * | src, | ||
| size_t | cnt | ||
| ) |
|
inline |
Definition at line 260 of file ByteBuffer.h.
Here is the call graph for this function:
Here is the caller graph for this function:| void ByteBuffer::PutBits | ( | std::size_t | pos, |
| std::size_t | value, | ||
| uint32 | bitCount | ||
| ) |
|
inline |
|
inline |
|
inline |
Definition at line 534 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 523 of file ByteBuffer.h.
|
inline |
Definition at line 480 of file ByteBuffer.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 482 of file ByteBuffer.h.
|
inline |
Definition at line 224 of file ByteBuffer.h.
| std::string_view ByteBuffer::ReadCString | ( | bool | requireValidUtf8 = true | ) |
|
inline |
Definition at line 559 of file ByteBuffer.h.
| std::string_view ByteBuffer::ReadString | ( | uint32 | length, |
| bool | requireValidUtf8 = true |
||
| ) |
Definition at line 72 of file ByteBuffer.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinenoexcept |
Definition at line 93 of file ByteBuffer.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 450 of file ByteBuffer.h.
|
inline |
|
inline |
| void ByteBuffer::textlike | ( | ) | const |
|
inline |
|
inline |
Definition at line 463 of file ByteBuffer.h.
|
inline |
|
inline |
Definition at line 553 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 541 of file ByteBuffer.h.
|
inline |
Definition at line 547 of file ByteBuffer.h.
|
protected |
Definition at line 626 of file ByteBuffer.h.
|
protected |
Definition at line 627 of file ByteBuffer.h.
|
protected |
Definition at line 625 of file ByteBuffer.h.
|
protected |
Definition at line 628 of file ByteBuffer.h.
|
protected |
Definition at line 625 of file ByteBuffer.h.
|
staticconstexpr |
Definition at line 65 of file ByteBuffer.h.
|
staticconstexpr |
Definition at line 66 of file ByteBuffer.h.