Beispiel #1
0
BinaryTreePtr FileStream::getBinaryTree()
{
    uint8 byte = getU8();
    if(byte != BINARYTREE_NODE_START)
        stdext::throw_exception(stdext::format("failed to read node start (getBinaryTree): %d", byte));

    return BinaryTreePtr(new BinaryTree(asFileStream()));
}
BinaryTreePtr FileStream::getBinaryTree()
{
    BinaryTreePtr root = BinaryTreePtr(new BinaryTree);
    uint8 byte = getU8();
    if(byte == BINARYTREE_NODE_START)
        root->unserialize(asFileStream());
    else
        stdext::throw_exception(stdext::format("failed to read node start (getBinaryTree): %d", byte));
    return root;
}