X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/de3b0cb3cb22673c55c267a6cfd0428df0a084f8..555cf8e7b36faa768e40d09665781c468424a91c:/src/btree.h diff --git a/src/btree.h b/src/btree.h index 5d05ae4..6feb5a8 100644 --- a/src/btree.h +++ b/src/btree.h @@ -208,6 +208,8 @@ */ struct BTreeFileHeader { uint block_size; + int tree_type; + int key_type; }; /** Encabezado de un bloque */ @@ -247,6 +249,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 +296,7 @@ class BTree { /* Funciones de manejo de archivo */ void WriteFileHeader (); + void ReadFileHeader (); /* Manejo de Bloques */ void WriteBlock (uchar *block, uint num); @@ -313,14 +318,13 @@ class BTree { std::string filename; BTreeFileHeader header; - int key_type; - int tree_type; /** Apunta al archivo de datos, asi se abre solo 1 vez * * \todo Ver si vale la pena */ FILE *fp; + std::list deleted_nodes; /* DEBUG */