* Added specialized ByteBuffer::read for std::string. This will aid in packet processing later.
--HG-- branch : trunk
This commit is contained in:
@@ -228,6 +228,12 @@ class ByteBuffer
|
|||||||
_rpos += sizeof(T);
|
_rpos += sizeof(T);
|
||||||
return r;
|
return r;
|
||||||
};
|
};
|
||||||
|
template<> std::string read<std::string>()
|
||||||
|
{
|
||||||
|
std::string tmp;
|
||||||
|
*this >> tmp;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
template <typename T> T read(size_t pos) const
|
template <typename T> T read(size_t pos) const
|
||||||
{
|
{
|
||||||
ASSERT(pos + sizeof(T) <= size() || PrintPosError(false,pos,sizeof(T)));
|
ASSERT(pos + sizeof(T) <= size() || PrintPosError(false,pos,sizeof(T)));
|
||||||
|
|||||||
Reference in New Issue
Block a user