X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/46f8786311d03a7d9869d814a3d6f020a3498ed4..HEAD:/src/btree.h diff --git a/src/btree.h b/src/btree.h index 3860d38..9e49213 100644 --- a/src/btree.h +++ b/src/btree.h @@ -207,9 +207,11 @@ * ocupe block_size de tamaƱo. */ struct BTreeFileHeader { + char magic[7]; uint block_size; int tree_type; int key_type; + uint block_data_counter; }; /** Encabezado de un bloque */ @@ -249,6 +251,8 @@ struct BTreeFindResult { class BTree { public: BTree (const std::string &filename, unsigned int block_size, int t_t = TYPE_IDENTIFICACION, int k_t = KEY_FIXED, bool create_new_file = false); + BTree (const std::string &filename); + ~BTree (); /** Tipos de clave a usar */ @@ -294,6 +298,7 @@ class BTree { /* Funciones de manejo de archivo */ void WriteFileHeader (); + void ReadFileHeader (); /* Manejo de Bloques */ void WriteBlock (uchar *block, uint num); @@ -316,12 +321,15 @@ class BTree { std::string filename; BTreeFileHeader header; + uint GetNextBlockData (); + /** Apunta al archivo de datos, asi se abre solo 1 vez * * \todo Ver si vale la pena */ FILE *fp; std::list deleted_nodes; + std::list deleted_block_data; /* DEBUG */