Fixed 9.6 otb loading

This commit is contained in:
Mark Samman 2012-07-30 18:26:36 +02:00
parent 03b8241bbc
commit 39db801f93
3 changed files with 13 additions and 1 deletions

View File

@ -163,6 +163,17 @@ std::string BinaryTree::getString()
return ret;
}
std::string BinaryTree::getString(uint16 len)
{
unserialize();
if(m_pos+len > m_buffer.size())
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;
}
Position BinaryTree::getPosition()
{
Position ret;

View File

@ -49,6 +49,7 @@ public:
uint32 getU32();
uint64 getU64();
std::string getString();
std::string getString(uint16 len);
Position getPosition();
Point getPoint();

View File

@ -64,7 +64,7 @@ void ItemType::unserialize(const BinaryTreePtr& node)
break;
}
case ItemTypeAttrName: {
setName(node->getString());
setName(node->getString(len));
break;
}
case ItemTypeAttrDesc: {