mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9550] Hide unsafe templated ByteBuffer::append function only for internal use.
This commit is contained in:
parent
7dc6b131c8
commit
ad9243ebd0
3 changed files with 9 additions and 8 deletions
|
|
@ -51,7 +51,7 @@ std::string ObjectGuid::GetString() const
|
|||
|
||||
ByteBuffer& operator<< (ByteBuffer& buf, ObjectGuid const& guid)
|
||||
{
|
||||
buf.append(guid.GetRawValue());
|
||||
buf << uint64(guid.GetRawValue());
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,12 +71,6 @@ class ByteBuffer
|
|||
_rpos = _wpos = 0;
|
||||
}
|
||||
|
||||
template <typename T> void append(T value)
|
||||
{
|
||||
EndianConvert(value);
|
||||
append((uint8 *)&value, sizeof(value));
|
||||
}
|
||||
|
||||
template <typename T> void put(size_t pos,T value)
|
||||
{
|
||||
EndianConvert(value);
|
||||
|
|
@ -491,6 +485,13 @@ class ByteBuffer
|
|||
}
|
||||
sLog.outDebugInLine("\n");
|
||||
}
|
||||
private:
|
||||
// limited for internal use because can "append" any unexpected type (like pointer and etc) with hard detection problem
|
||||
template <typename T> void append(T value)
|
||||
{
|
||||
EndianConvert(value);
|
||||
append((uint8 *)&value, sizeof(value));
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t _rpos, _wpos;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9549"
|
||||
#define REVISION_NR "9550"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue