X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/de3b0cb3cb22673c55c267a6cfd0428df0a084f8..HEAD:/src/btree.h diff --git a/src/btree.h b/src/btree.h index 5d05ae4..9e49213 100644 --- a/src/btree.h +++ b/src/btree.h @@ -207,7 +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 */ @@ -247,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 */ @@ -292,6 +298,7 @@ class BTree { /* Funciones de manejo de archivo */ void WriteFileHeader (); + void ReadFileHeader (); /* Manejo de Bloques */ void WriteBlock (uchar *block, uint num); @@ -313,14 +320,16 @@ class BTree { std::string filename; BTreeFileHeader header; - int key_type; - int tree_type; + + 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 */