X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/113597e3c369b18fa4e73a0b9744398a0e9e0a79..3a9e92af5fe004d068e161c66e308e4401dfc21b:/src/btree.cpp diff --git a/src/btree.cpp b/src/btree.cpp index d1fbab3..9591ec8 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -109,3 +109,18 @@ std::list BTree::ReadKeys (uchar *node, BTreeNodeHeader &node_header) return keys; } +void BTree::WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list &keys) +{ + std::list::iterator it = keys.begin (); + + node += sizeof (BTreeNodeHeader); + + while (it != keys.end ()) { + Clave *c = (*it); + memcpy (node, c->ToArray(), c->Size ()); + node += c->Size (); + it++; + } + + /* TODO : incrementar node_header.item_count aca o fuera de este metodo? */ +}