diff --git a/btree.h b/btree.h index 40247ea..582fd28 100644 --- a/btree.h +++ b/btree.h @@ -1,9 +1,9 @@ #ifndef BTREE_H #define BTREE_H -#include "btypes.h" // integer definitions -#include "btree_vfs.h" // bTreeVFS class -#include "btree_key.h" // bTree key functions +#include "btree_types.h" // integer definitions +#include "btree_vfs.h" // bTreeVFS class +#include "btree_key.h" // bTree key functions enum treeTypes { BT_CUSTOM, BT_PCHAR, BT_STRING, BT_SINGLE, BT_DOUBLE, BT_INT32, BT_INT64 }; diff --git a/btree_key.cpp b/btree_key.cpp index 08763e3..93ce914 100644 --- a/btree_key.cpp +++ b/btree_key.cpp @@ -8,7 +8,7 @@ } // compareKeyNull int -compareKeyString(void * , void * ) { +compareKeyString(void *, void *) { return 0; } // compareKeyString diff --git a/btree_standardVFS.cpp b/btree_standardVFS.cpp new file mode 100644 index 0000000..30bf01d --- /dev/null +++ b/btree_standardVFS.cpp @@ -0,0 +1,3 @@ +#include "btree_vfs.h" +#include "btree_standardVFS.h" + diff --git a/btree_standardVFS.h b/btree_standardVFS.h new file mode 100644 index 0000000..447d2cb --- /dev/null +++ b/btree_standardVFS.h @@ -0,0 +1,20 @@ +#ifndef BTREE_STANDARDVFS_H +#define BTREE_STANDARDVFS_H + +#include +#include "btree_vfs.h" + +class StandardVFS : bTreeVFS { + public: + StandardVFS(void) { } + virtual bool fClose(void) { return false; } + virtual bool fCreate(char *) { return false; } + virtual bool fExist(char *) { return false; } + virtual bool fOpen(char *) { return false; } + virtual bool fRead(char *) { return false; } + virtual bool fSeek(uInt32) { return false; } + virtual bool fWrite(void *, uInt32) { return false; } + virtual ~StandardVFS(void) { } +}; + +#endif diff --git a/btree_types.h b/btree_types.h new file mode 100644 index 0000000..7e0f379 --- /dev/null +++ b/btree_types.h @@ -0,0 +1,13 @@ +#ifndef BTREE_TYPES_H +#define BTREE_TYPES_H + +typedef signed char int8; +typedef signed short int int16; +typedef signed long int int32; +typedef signed long long int int64; +typedef unsigned char uInt8; +typedef unsigned short int uInt16; +typedef unsigned int uInt32; +typedef unsigned long long int uInt64; + +#endif diff --git a/btree_vfs.h b/btree_vfs.h index b51169a..fbb6d63 100644 --- a/btree_vfs.h +++ b/btree_vfs.h @@ -1,16 +1,18 @@ #ifndef BTREE_VFS_H #define BTREE_VFS_H +#include "btree_types.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 bool fCreate(const char *) = 0; + virtual bool fExist(const char *) = 0; + virtual bool fOpen(const char *) = 0; + virtual bool fRead(const char *) = 0; + virtual bool fSeek(uInt32) = 0; + virtual bool fWrite(void *, uInt32) = 0; virtual ~bTreeVFS(void) = 0; }; // bTreeVFS diff --git a/btypes.h b/btypes.h deleted file mode 100644 index fe843e5..0000000 --- a/btypes.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef BTYPES_H -#define BTYPES_H - -typedef signed char int8; -typedef signed short int int16; -typedef signed long int int32; -typedef signed long long int int64; -typedef unsigned char uInt8; -typedef unsigned short int uInt16; -typedef unsigned int uInt32; -typedef unsigned long long int uInt64; - -#endif