backing up at OTBM loading, if someone can continue working on it until I'm available again, I would appreciate it much, here is current progress: http://pastebin.com/qEfC9ftv

This commit is contained in:
otfallen
2012-07-09 08:46:11 +02:00
parent 1e8491cdcd
commit 42971b10f8
6 changed files with 187 additions and 73 deletions

View File

@@ -93,3 +93,14 @@ uint64 BinaryTree::getU64()
m_pos += 8;
return v;
}
std::string BinaryTree::getString()
{
uint16 len = getU16();
if (len == 0 || len > 8192)
stdext::throw_exception("failed to get string from binary tree - invalid size read.");
std::string ret((char *)&m_buffer[m_pos], len);
m_pos += len;
return ret;
}

View File

@@ -254,7 +254,7 @@ BinaryTreePtr FileStream::getBinaryTree()
if(byte == BINARYTREE_NODE_START)
root->unserialize(asFileStream());
else
stdext::throw_exception(stdext::format("failed to read node start (getFirstNode): %d", byte));
stdext::throw_exception(stdext::format("failed to read node start (getBinaryTree): %d", byte));
return root;
}