diff --git a/btree_standardVFS.cpp b/btree_standardVFS.cpp index 34b497e..9db223a 100644 --- a/btree_standardVFS.cpp +++ b/btree_standardVFS.cpp @@ -4,11 +4,16 @@ StandardVFS::StandardVFS(void) { + dataFile = NULL; + openFile = false; } // StandardVFS::StandardVFS bool StandardVFS::fClose(void) { - return false; + int result = 0; // failure by default; + if (openFile) result = fclose(dataFile); // if open close it + openFile = (result == 0); // was it closed properly? + return result; // return true if closed } // StandardVFS::fClose bool @@ -27,7 +32,7 @@ } // StandardVFS::fOpen bool -StandardVFS::fRead(const char *) { +StandardVFS::fRead(void *, uInt32) { return false; } // StandardVFS::fRead diff --git a/btree_standardVFS.h b/btree_standardVFS.h index 247159e..44079b2 100644 --- a/btree_standardVFS.h +++ b/btree_standardVFS.h @@ -5,13 +5,16 @@ #include "btree_vfs.h" class StandardVFS : bTreeVFS { + protected: + FILE * dataFile; + bool openFile; public: StandardVFS(void); virtual bool fClose(void); virtual bool fCreate(const char *); virtual bool fExist(const char *); virtual bool fOpen(const char *); - virtual bool fRead(const char *); + virtual bool fRead(void *, uInt32); virtual bool fSeek(uInt32); virtual bool fWrite(void *, uInt32); virtual ~StandardVFS(void); diff --git a/btree_vfs.h b/btree_vfs.h index fbb6d63..3c1a36e 100644 --- a/btree_vfs.h +++ b/btree_vfs.h @@ -10,7 +10,7 @@ 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 fRead(void *, uInt32) = 0; virtual bool fSeek(uInt32) = 0; virtual bool fWrite(void *, uInt32) = 0; virtual ~bTreeVFS(void) = 0;