diff --git a/btree.h b/btree.h index 1845bcb..338c237 100644 --- a/btree.h +++ b/btree.h @@ -2,6 +2,7 @@ #define BTREE_H #include "btypes.h" // integer definitions +#include "btree_vfs.h" // bTreeVFS class enum treeTypes { BT_CUSTOM, BT_PCHAR, BT_STRING, BT_SINGLE, BT_DOUBLE, BT_INT32, BT_INT64 }; @@ -55,4 +56,18 @@ typedef void (*copyKeyProc)(void *, void *); typedef int (*keySizeFunc)(void *); +class bTree { + protected: + compareKeyFunc compareKeys; + copyKeyProc copyKey; + keySizeFunc keySize; + bTreeInfo * info; + bTreeVFS * vfs; + bool memoryTree; + bool treeChanged; + public: + bTree(void); + virtual ~bTree(void); +};// bTree + #endif diff --git a/btree_vfs.h b/btree_vfs.h new file mode 100644 index 0000000..b51169a --- /dev/null +++ b/btree_vfs.h @@ -0,0 +1,17 @@ +#ifndef BTREE_VFS_H +#define BTREE_VFS_H + +class bTreeVFS { + public: + bTreeVFS(void); + virtual bool fClose(void) = 0; + virtual bool fCreate(char * filename) = 0; + virtual bool fExist(char * filename) = 0; + virtual bool fOpen(char * filename) = 0; + virtual bool fRead(char * filename) = 0; + virtual bool fSeek(uInt32 offset) = 0; + virtual bool fWrite(void * buf, uInt32 size) = 0; + virtual ~bTreeVFS(void) = 0; +}; // bTreeVFS + +#endif diff --git a/lists.pas b/lists.pas index 62c917e..033f5f0 100755 --- a/lists.pas +++ b/lists.pas @@ -182,7 +182,7 @@ function GetLastKey(var searchRec:BTreeSearchRec):boolean; procedure PrintList(const filename:string); procedure PrintWholeTree(const filename:string); - destructor done; + destructor done; virtual; end; // bTree implementation