/* Inicializo el header */
header.block_size = block_size;
- write_tree_header ();
+ WriteFileHeader ();
/* Creo el primer bloque vacio */
node = new uchar[block_size];
nh.free_space = block_size - sizeof (BTreeNodeHeader);
nh.item_count = 0;
WriteNodoHeader (node, &nh);
- write_block (node, 0);
+ WriteBlock (node, 0);
delete [] node;
}
fclose (fp);
}
-void BTree::write_tree_header ()
+void BTree::WriteFileHeader ()
{
fseek (fp, 0L, SEEK_SET);
fwrite (&header, 1, sizeof (BTreeFileHeader), fp);
}
-void BTree::write_block (uchar *block, uint num)
+void BTree::WriteBlock (uchar *block, uint num)
{
fseek (fp, num*header.block_size + sizeof (BTreeFileHeader), SEEK_SET);
fwrite (block, 1, header.block_size, fp);
WriteKeys (root, root_header, node_keys);
WriteNodoHeader (root, &root_header);
- write_block (root, 0);
+ WriteBlock (root, 0);
delete [] root;
}
void DelKey (const Clave &k);
private:
- void write_tree_header ();
- void write_block (uchar *block, uint num);
+ void WriteFileHeader ();
+ void WriteBlock (uchar *block, uint num);
uchar *ReadBlock (uint num);
void ReadNodoHeader (uchar *node, BTreeNodeHeader *header);