OregonCore  revision 3611e8a-git
Your Favourite TBC server
ByteBuffer Class Reference

#include <ByteBuffer.h>

+ Inheritance diagram for ByteBuffer:

Public Member Functions

 ByteBuffer ()
 
 ByteBuffer (size_t res)
 
 ByteBuffer (const ByteBuffer &buf)
 
void clear ()
 
template<typename T >
void put (size_t pos, T value)
 
ByteBufferoperator<< (uint8 value)
 
ByteBufferoperator<< (uint16 value)
 
ByteBufferoperator<< (uint32 value)
 
ByteBufferoperator<< (uint64 value)
 
ByteBufferoperator<< (int8 value)
 
ByteBufferoperator<< (int16 value)
 
ByteBufferoperator<< (int32 value)
 
ByteBufferoperator<< (int64 value)
 
ByteBufferoperator<< (float value)
 
ByteBufferoperator<< (double value)
 
ByteBufferoperator<< (const std::string &value)
 
ByteBufferoperator<< (const char *str)
 
ByteBufferoperator>> (bool &value)
 
ByteBufferoperator>> (uint8 &value)
 
ByteBufferoperator>> (uint16 &value)
 
ByteBufferoperator>> (uint32 &value)
 
ByteBufferoperator>> (uint64 &value)
 
ByteBufferoperator>> (int8 &value)
 
ByteBufferoperator>> (int16 &value)
 
ByteBufferoperator>> (int32 &value)
 
ByteBufferoperator>> (int64 &value)
 
ByteBufferoperator>> (float &value)
 
ByteBufferoperator>> (double &value)
 
ByteBufferoperator>> (std::string &value)
 
template<class T >
ByteBufferoperator>> (Unused< T > const &)
 
uint8 operator[] (size_t pos) const
 
size_t rpos () const
 
size_t rpos (size_t rpos_)
 
size_t wpos () const
 
size_t wpos (size_t wpos_)
 
template<typename T >
void read_skip ()
 
void read_skip (size_t skip)
 
template<typename T >
read ()
 
template<typename T >
read (size_t pos) const
 
void read (uint8 *dest, size_t len)
 
uint64 readPackGUID ()
 
const uint8contents () const
 
size_t size () const
 
bool empty () const
 
void resize (size_t newsize)
 
void reserve (size_t ressize)
 
void append (const std::string &str)
 
void append (const char *src, size_t cnt)
 
template<class T >
void append (const T *src, size_t cnt)
 
void append (const uint8 *src, size_t cnt)
 
void append (const ByteBuffer &buffer)
 
void appendPackXYZ (float x, float y, float z)
 
void appendPackGUID (uint64 guid)
 
void put (size_t pos, const uint8 *src, size_t cnt)
 
void print_storage () const
 
void textlike () const
 
void hexlike () const
 
template<>
void read_skip ()
 
template<>
void read_skip ()
 

Static Public Attributes

static const size_t DEFAULT_SIZE = 0x1000
 

Protected Attributes

size_t _rpos
 
size_t _wpos
 
std::vector< uint8_storage
 

Private Member Functions

template<typename T >
void append (T value)
 

Detailed Description

Definition at line 53 of file ByteBuffer.h.

Constructor & Destructor Documentation

ByteBuffer::ByteBuffer ( )
inline

Definition at line 59 of file ByteBuffer.h.

59  : _rpos(0), _wpos(0)
60  {
61  _storage.reserve(DEFAULT_SIZE);
62  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
static const size_t DEFAULT_SIZE
Definition: ByteBuffer.h:56
size_t _wpos
Definition: ByteBuffer.h:506
size_t _rpos
Definition: ByteBuffer.h:506
ByteBuffer::ByteBuffer ( size_t  res)
inline

Definition at line 65 of file ByteBuffer.h.

65  : _rpos(0), _wpos(0)
66  {
67  _storage.reserve(res);
68  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t _wpos
Definition: ByteBuffer.h:506
size_t _rpos
Definition: ByteBuffer.h:506
ByteBuffer::ByteBuffer ( const ByteBuffer buf)
inline

Definition at line 71 of file ByteBuffer.h.

71 : _rpos(buf._rpos), _wpos(buf._wpos), _storage(buf._storage) { }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t _wpos
Definition: ByteBuffer.h:506
size_t _rpos
Definition: ByteBuffer.h:506

Member Function Documentation

void ByteBuffer::append ( const char *  src,
size_t  cnt 
)
inline

Definition at line 363 of file ByteBuffer.h.

364  {
365  return append((const uint8*)src, cnt);
366  }
ACE_UINT8 uint8
Definition: Define.h:73
void append(const std::string &str)
Definition: ByteBuffer.h:358
template<class T >
void ByteBuffer::append ( const T *  src,
size_t  cnt 
)
inline

Definition at line 368 of file ByteBuffer.h.

369  {
370  return append((const uint8*)src, cnt * sizeof(T));
371  }
ACE_UINT8 uint8
Definition: Define.h:73
void append(const std::string &str)
Definition: ByteBuffer.h:358
void ByteBuffer::append ( const uint8 src,
size_t  cnt 
)
inline

Definition at line 373 of file ByteBuffer.h.

References ASSERT, and ByteBufferException::size.

374  {
375  if (!cnt)
376  return;
377 
378  ASSERT(size() < 10000000);
379 
380  if (_storage.size() < _wpos + cnt)
381  _storage.resize(_wpos + cnt);
382  memcpy(&_storage[_wpos], src, cnt);
383  _wpos += cnt;
384  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t size() const
Definition: ByteBuffer.h:336
#define ASSERT
Definition: Errors.h:33
size_t _wpos
Definition: ByteBuffer.h:506
void ByteBuffer::append ( const ByteBuffer buffer)
inline

Definition at line 386 of file ByteBuffer.h.

References contents(), and wpos().

387  {
388  if (buffer.wpos())
389  append(buffer.contents(), buffer.wpos());
390  }
const uint8 * contents() const
Definition: ByteBuffer.h:331
size_t wpos() const
Definition: ByteBuffer.h:264
void append(const std::string &str)
Definition: ByteBuffer.h:358
template<typename T >
void ByteBuffer::append ( value)
inlineprivate

Definition at line 499 of file ByteBuffer.h.

References EndianConvert().

500  {
502  append((uint8*)&value, sizeof(value));
503  }
void EndianConvert(T &val)
Definition: ByteConverter.h:48
ACE_UINT8 uint8
Definition: Define.h:73
etc mysql my cnf *Then change max_allowed_packet to a bigger value
void append(const std::string &str)
Definition: ByteBuffer.h:358
void ByteBuffer::appendPackGUID ( uint64  guid)
inline

Definition at line 402 of file ByteBuffer.h.

References ByteBufferException::size.

Referenced by WorldSession::HandleMoveKnockBackAck(), WorldSession::HandleRequestPartyMemberStatsOpcode(), Aura::PeriodicTick(), and Spell::SendLogExecute().

403  {
404  uint8 packGUID[8 + 1];
405  packGUID[0] = 0;
406  size_t size = 1;
407  for (uint8 i = 0; guid != 0; ++i)
408  {
409  if (guid & 0xFF)
410  {
411  packGUID[0] |= uint8(1 << i);
412  packGUID[size] = uint8(guid & 0xFF);
413  ++size;
414  }
415 
416  guid >>= 8;
417  }
418 
419  append(packGUID, size);
420  }
ACE_UINT8 uint8
Definition: Define.h:73
size_t size() const
Definition: ByteBuffer.h:336
void append(const std::string &str)
Definition: ByteBuffer.h:358
void ByteBuffer::appendPackXYZ ( float  x,
float  y,
float  z 
)
inline

Definition at line 393 of file ByteBuffer.h.

Referenced by Movement::WriteLinearPath().

394  {
395  uint32 packed = 0;
396  packed |= ((int)(x / 0.25f) & 0x7FF);
397  packed |= ((int)(y / 0.25f) & 0x7FF) << 11;
398  packed |= ((int)(z / 0.25f) & 0x3FF) << 22;
399  *this << packed;
400  }
ACE_UINT32 uint32
Definition: Define.h:71
void ByteBuffer::clear ( )
inline

Definition at line 73 of file ByteBuffer.h.

Referenced by UpdateData::Clear(), WorldSession::HandleCharEnum(), WorldPacket::Initialize(), Channel::Invite(), Channel::Join(), Channel::Leave(), operator>>(), and ObjectAccessor::Update().

74  {
75  _storage.clear();
76  _rpos = _wpos = 0;
77  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t _wpos
Definition: ByteBuffer.h:506
size_t _rpos
Definition: ByteBuffer.h:506
bool ByteBuffer::empty ( ) const
inline

Definition at line 340 of file ByteBuffer.h.

Referenced by WorldSession::HandleGuildMOTDOpcode(), WorldSession::HandleRaidReadyCheckOpcode(), WorldSession::HandleWardenDataOpcode(), and WorldSocket::iSendPacket().

341  {
342  return _storage.empty();
343  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
void ByteBuffer::hexlike ( ) const
inline

Definition at line 451 of file ByteBuffer.h.

References ByteBufferException::size, and sLog.

Referenced by WorldSession::HandleChannelEnableVoiceOpcode(), WorldSession::HandleChannelVoiceChatQuery(), WorldSession::HandleMoveNotActiveMoverOpcode(), WorldSession::HandlePageQueryOpcode(), WorldSession::HandleReportSpamOpcode(), ChatHandler::HandleSendOpcodeCommand(), WorldSession::HandleVoiceSettingsOpcode(), WorldSession::HandleWardenDataOpcode(), WorldSession::LogUnprocessedTail(), WorldSocket::ProcessIncoming(), WardenMac::RequestData(), WardenWin::RequestData(), and WorldSession::Update().

452  {
453  if (!sLog.IsOutDebug()) // optimize disabled debug output
454  return;
455 
456  uint32 j = 1, k = 1;
457  sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
458 
459  for (uint32 i = 0; i < size(); ++i)
460  {
461  if ((i == (j * 8)) && ((i != (k * 16))))
462  {
463  if (read<uint8>(i) < 0x10)
464  sLog.outDebugInLine("| 0%X ", read<uint8>(i) );
465  else
466  sLog.outDebugInLine("| %X ", read<uint8>(i) );
467  ++j;
468  }
469  else if (i == (k * 16))
470  {
471  if (read<uint8>(i) < 0x10)
472  {
473  sLog.outDebugInLine("\n");
474 
475  sLog.outDebugInLine("0%X ", read<uint8>(i) );
476  }
477  else
478  {
479  sLog.outDebugInLine("\n");
480 
481  sLog.outDebugInLine("%X ", read<uint8>(i) );
482  }
483 
484  ++k;
485  ++j;
486  }
487  else
488  {
489  if (read<uint8>(i) < 0x10)
490  sLog.outDebugInLine("0%X ", read<uint8>(i) );
491  else
492  sLog.outDebugInLine("%X ", read<uint8>(i) );
493  }
494  }
495  sLog.outDebugInLine("\n");
496  }
#define sLog
Log class singleton.
Definition: Log.h:187
size_t size() const
Definition: ByteBuffer.h:336
ACE_UINT32 uint32
Definition: Define.h:71
ByteBuffer& ByteBuffer::operator<< ( uint8  value)
inline

Definition at line 85 of file ByteBuffer.h.

References value.

86  {
87  append<uint8>(value);
88  return *this;
89  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( uint16  value)
inline

Definition at line 91 of file ByteBuffer.h.

References value.

92  {
93  append<uint16>(value);
94  return *this;
95  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( uint32  value)
inline

Definition at line 97 of file ByteBuffer.h.

References value.

98  {
99  append<uint32>(value);
100  return *this;
101  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( uint64  value)
inline

Definition at line 103 of file ByteBuffer.h.

References value.

104  {
105  append<uint64>(value);
106  return *this;
107  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( int8  value)
inline

Definition at line 110 of file ByteBuffer.h.

References value.

111  {
112  append<int8>(value);
113  return *this;
114  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( int16  value)
inline

Definition at line 116 of file ByteBuffer.h.

References value.

117  {
118  append<int16>(value);
119  return *this;
120  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( int32  value)
inline

Definition at line 122 of file ByteBuffer.h.

References value.

123  {
124  append<int32>(value);
125  return *this;
126  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( int64  value)
inline

Definition at line 128 of file ByteBuffer.h.

References value.

129  {
130  append<int64>(value);
131  return *this;
132  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( float  value)
inline

Definition at line 135 of file ByteBuffer.h.

References value.

136  {
137  append<float>(value);
138  return *this;
139  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( double  value)
inline

Definition at line 141 of file ByteBuffer.h.

References value.

142  {
143  append<double>(value);
144  return *this;
145  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator<< ( const std::string &  value)
inline

Definition at line 147 of file ByteBuffer.h.

148  {
149  append((uint8 const*)value.c_str(), value.length());
150  append((uint8)0);
151  return *this;
152  }
ACE_UINT8 uint8
Definition: Define.h:73
etc mysql my cnf *Then change max_allowed_packet to a bigger value
void append(const std::string &str)
Definition: ByteBuffer.h:358
ByteBuffer& ByteBuffer::operator<< ( const char *  str)
inline

Definition at line 154 of file ByteBuffer.h.

155  {
156  append((uint8 const*)str, str ? strlen(str) : 0);
157  append((uint8)0);
158  return *this;
159  }
ACE_UINT8 uint8
Definition: Define.h:73
void append(const std::string &str)
Definition: ByteBuffer.h:358
ByteBuffer& ByteBuffer::operator>> ( bool &  value)
inline

Definition at line 161 of file ByteBuffer.h.

162  {
163  value = read<char>() > 0 ? true : false;
164  return *this;
165  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( uint8 value)
inline

Definition at line 167 of file ByteBuffer.h.

168  {
169  value = read<uint8>();
170  return *this;
171  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( uint16 value)
inline

Definition at line 173 of file ByteBuffer.h.

174  {
175  value = read<uint16>();
176  return *this;
177  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( uint32 value)
inline

Definition at line 179 of file ByteBuffer.h.

180  {
181  value = read<uint32>();
182  return *this;
183  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( uint64 value)
inline

Definition at line 185 of file ByteBuffer.h.

186  {
187  value = read<uint64>();
188  return *this;
189  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( int8 value)
inline

Definition at line 192 of file ByteBuffer.h.

193  {
194  value = read<int8>();
195  return *this;
196  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( int16 value)
inline

Definition at line 198 of file ByteBuffer.h.

199  {
200  value = read<int16>();
201  return *this;
202  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( int32 value)
inline

Definition at line 204 of file ByteBuffer.h.

205  {
206  value = read<int32>();
207  return *this;
208  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( int64 value)
inline

Definition at line 210 of file ByteBuffer.h.

211  {
212  value = read<int64>();
213  return *this;
214  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( float &  value)
inline

Definition at line 216 of file ByteBuffer.h.

217  {
218  value = read<float>();
219  return *this;
220  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( double &  value)
inline

Definition at line 222 of file ByteBuffer.h.

223  {
224  value = read<double>();
225  return *this;
226  }
etc mysql my cnf *Then change max_allowed_packet to a bigger value
ByteBuffer& ByteBuffer::operator>> ( std::string &  value)
inline

Definition at line 228 of file ByteBuffer.h.

References clear(), and ByteBufferException::size.

229  {
230  value.clear();
231  while (rpos() < size()) // prevent crash at wrong string format in packet
232  {
233  char c = read<char>();
234  if (c == 0)
235  break;
236  value += c;
237  }
238  return *this;
239  }
size_t size() const
Definition: ByteBuffer.h:336
etc mysql my cnf *Then change max_allowed_packet to a bigger value
size_t rpos() const
Definition: ByteBuffer.h:253
template<class T >
ByteBuffer& ByteBuffer::operator>> ( Unused< T > const &  )
inline

Definition at line 242 of file ByteBuffer.h.

243  {
244  read_skip<T>();
245  return *this;
246  }
uint8 ByteBuffer::operator[] ( size_t  pos) const
inline

Definition at line 248 of file ByteBuffer.h.

References ByteBufferException::pos.

249  {
250  return read<uint8>(pos);
251  }
void ByteBuffer::print_storage ( ) const
inline

Definition at line 429 of file ByteBuffer.h.

References ByteBufferException::size, and sLog.

430  {
431  if (!sLog.IsOutDebug()) // optimize disabled debug output
432  return;
433 
434  sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
435  for (uint32 i = 0; i < size(); ++i)
436  sLog.outDebugInLine("%u - ", read<uint8>(i) );
437  sLog.outDebug(" ");
438  }
#define sLog
Log class singleton.
Definition: Log.h:187
size_t size() const
Definition: ByteBuffer.h:336
ACE_UINT32 uint32
Definition: Define.h:71
void ByteBuffer::put ( size_t  pos,
const uint8 src,
size_t  cnt 
)
inline

Definition at line 422 of file ByteBuffer.h.

References ByteBufferException::ByteBufferException(), and ByteBufferException::size.

423  {
424  if (pos + cnt > size())
425  throw ByteBufferException(true, pos, cnt, size());
426  memcpy(&_storage[pos], src, cnt);
427  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t size() const
Definition: ByteBuffer.h:336
template<typename T >
T ByteBuffer::read ( )
inline

Definition at line 288 of file ByteBuffer.h.

Referenced by WorldSocket::HandleAuthSession(), WardenMac::HandleData(), WorldSession::HandleInspectOpcode(), operator>>(), and MovementInfo::Read().

289  {
290  T r = read<T>(_rpos);
291  _rpos += sizeof(T);
292  return r;
293  }
size_t _rpos
Definition: ByteBuffer.h:506
template<typename T >
T ByteBuffer::read ( size_t  pos) const
inline

Definition at line 295 of file ByteBuffer.h.

References ByteBufferException::ByteBufferException(), EndianConvert(), and ByteBufferException::size.

296  {
297  if (pos + sizeof(T) > size())
298  throw ByteBufferException(false, pos, sizeof(T), size());
299  T val = *((T const*)&_storage[pos]);
300  EndianConvert(val);
301  return val;
302  }
void EndianConvert(T &val)
Definition: ByteConverter.h:48
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t size() const
Definition: ByteBuffer.h:336
void ByteBuffer::read ( uint8 dest,
size_t  len 
)
inline

Definition at line 304 of file ByteBuffer.h.

References ByteBufferException::ByteBufferException(), and ByteBufferException::size.

305  {
306  if (_rpos + len > size())
307  throw ByteBufferException(false, _rpos, len, size());
308  memcpy(dest, &_storage[_rpos], len);
309  _rpos += len;
310  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t size() const
Definition: ByteBuffer.h:336
size_t _rpos
Definition: ByteBuffer.h:506
void ByteBuffer::read_skip ( size_t  skip)
inline

Definition at line 281 of file ByteBuffer.h.

References ByteBufferException::ByteBufferException(), and ByteBufferException::size.

282  {
283  if (_rpos + skip > size())
284  throw ByteBufferException(false, _rpos, skip, size());
285  _rpos += skip;
286  }
size_t size() const
Definition: ByteBuffer.h:336
size_t _rpos
Definition: ByteBuffer.h:506
template<>
void ByteBuffer::read_skip ( )
inline

Definition at line 584 of file ByteBuffer.h.

585 {
586  std::string temp;
587  *this >> temp;
588 }
template<>
void ByteBuffer::read_skip ( )
inline

Definition at line 591 of file ByteBuffer.h.

592 {
593  read_skip<char*>();
594 }
uint64 ByteBuffer::readPackGUID ( )
inline

Definition at line 312 of file ByteBuffer.h.

Referenced by WorldSession::HandleAcceptGrantLevel(), WorldSession::HandleGrantLevel(), and operator>>().

313  {
314  uint64 guid = 0;
315  uint8 guidmark = 0;
316  (*this) >> guidmark;
317 
318  for (int i = 0; i < 8; ++i)
319  {
320  if (guidmark & (uint8(1) << i))
321  {
322  uint8 bit;
323  (*this) >> bit;
324  guid |= (uint64(bit) << (i * 8));
325  }
326  }
327 
328  return guid;
329  }
ACE_UINT8 uint8
Definition: Define.h:73
ACE_UINT64 uint64
Definition: Define.h:70
void ByteBuffer::reserve ( size_t  ressize)
inline

Definition at line 352 of file ByteBuffer.h.

References ByteBufferException::size.

353  {
354  if (ressize > size())
355  _storage.reserve(ressize);
356  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t size() const
Definition: ByteBuffer.h:336
void ByteBuffer::resize ( size_t  newsize)
inline

Definition at line 345 of file ByteBuffer.h.

References ByteBufferException::size.

Referenced by AddonHandler::BuildAddonPacket(), UpdateData::BuildPacket(), WorldSocket::handle_input_header(), and Oregon::LocalizedPacketDo< Builder >::operator()().

346  {
347  _storage.resize(newsize);
348  _rpos = 0;
349  _wpos = size();
350  }
std::vector< uint8 > _storage
Definition: ByteBuffer.h:507
size_t size() const
Definition: ByteBuffer.h:336
size_t _wpos
Definition: ByteBuffer.h:506
size_t _rpos
Definition: ByteBuffer.h:506
size_t ByteBuffer::rpos ( size_t  rpos_)
inline

Definition at line 258 of file ByteBuffer.h.

259  {
260  _rpos = rpos_;
261  return _rpos;
262  }
size_t _rpos
Definition: ByteBuffer.h:506
void ByteBuffer::textlike ( ) const
inline

Definition at line 440 of file ByteBuffer.h.

References ByteBufferException::size, and sLog.

441  {
442  if (!sLog.IsOutDebug()) // optimize disabled debug output
443  return;
444 
445  sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
446  for (uint32 i = 0; i < size(); ++i)
447  sLog.outDebugInLine("%c", read<uint8>(i) );
448  sLog.outDebug(" ");
449  }
#define sLog
Log class singleton.
Definition: Log.h:187
size_t size() const
Definition: ByteBuffer.h:336
ACE_UINT32 uint32
Definition: Define.h:71
size_t ByteBuffer::wpos ( size_t  wpos_)
inline

Definition at line 269 of file ByteBuffer.h.

270  {
271  _wpos = wpos_;
272  return _wpos;
273  }
size_t _wpos
Definition: ByteBuffer.h:506

Member Data Documentation

size_t ByteBuffer::_rpos
protected

Definition at line 506 of file ByteBuffer.h.

std::vector<uint8> ByteBuffer::_storage
protected

Definition at line 507 of file ByteBuffer.h.

Referenced by WorldPacket::Initialize().

size_t ByteBuffer::_wpos
protected

Definition at line 506 of file ByteBuffer.h.

const size_t ByteBuffer::DEFAULT_SIZE = 0x1000
static

Definition at line 56 of file ByteBuffer.h.


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