Merge both getString functions in binarytree
This commit is contained in:
parent
12e6602925
commit
e316c0b5cd
|
@ -153,14 +153,8 @@ uint64 BinaryTree::getU64()
|
||||||
|
|
||||||
std::string BinaryTree::getString()
|
std::string BinaryTree::getString()
|
||||||
{
|
{
|
||||||
unserialize();
|
|
||||||
uint16 len = getU16();
|
uint16 len = getU16();
|
||||||
if(m_pos+len > m_buffer.size())
|
return getString(len);
|
||||||
stdext::throw_exception("BinaryTree: getString failed: string length exceeded buffer size.");
|
|
||||||
|
|
||||||
std::string ret((char *)&m_buffer[m_pos], len);
|
|
||||||
m_pos += len;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string BinaryTree::getString(uint16 len)
|
std::string BinaryTree::getString(uint16 len)
|
||||||
|
|
Loading…
Reference in New Issue