[9550] Hide unsafe templated ByteBuffer::append function only for internal use.

This commit is contained in:
VladimirMangos 2010-03-08 19:39:54 +03:00
parent 7dc6b131c8
commit ad9243ebd0
3 changed files with 9 additions and 8 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9549"
#define REVISION_NR "9550"
#endif // __REVISION_NR_H__