[6953] Cleanup packed guids write/read code.

* Remove unused function writeGUID and move function readGUID (with some changes) to ByteBuffer class.
* Remove now empty Tools.cpp/Tools.h from project.
This commit is contained in:
VladimirMangos 2008-12-27 17:23:00 +03:00
parent cc4b43c65d
commit 9c5dab1248
10 changed files with 32 additions and 172 deletions

View file

@ -241,6 +241,32 @@ class ByteBuffer
_rpos += len;
}
bool readPackGUID(uint64& guid)
{
if(rpos()+1 > size())
return false;
guid = 0;
uint8 guidmark=0;
(*this) >> guidmark;
for(int i=0;i<8;i++)
{
if(guidmark & (uint8(1) << i))
{
if(rpos()+1 > size())
return false;
uint8 bit;
(*this) >> bit;
guid |= (uint64(bit) << (i*8));
}
}
return true;
}
const uint8 *contents() const { return &_storage[0]; }
size_t size() const { return _storage.size(); }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "6952"
#define REVISION_NR "6953"
#endif // __REVISION_NR_H__