]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/index/BamStandardIndex_p.h
Added generic I/O device to BamIndex side of things
[bamtools.git] / src / api / internal / index / BamStandardIndex_p.h
index 03e0042405176fc13a320ee0d06a5bba7f0ada9c..dfa81ee822f7ffb02e0c4d48841fbf5eee2aa8ec 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "api/BamAux.h"
 #include "api/BamIndex.h"
+#include "api/IBamIODevice.h"
 #include <map>
 #include <set>
 #include <string>
@@ -132,9 +133,9 @@ class BamStandardIndex : public BamIndex {
         // index file ops
         void CheckMagicNumber(void);
         void CloseFile(void);
-        bool IsFileOpen(void) const;
-        void OpenFile(const std::string& filename, const char* mode);
-        void Seek(const int64_t& position, const int& origin);
+        bool IsDeviceOpen(void) const;
+        void OpenFile(const std::string& filename, IBamIODevice::OpenMode mode);
+        void Seek(const int64_t& position, const int origin);
         int64_t Tell(void) const;
 
         // BAI index building methods
@@ -200,14 +201,13 @@ class BamStandardIndex : public BamIndex {
 
         // our input buffer
         unsigned int m_bufferLength;
-
         struct RaiiWrapper {
-            FILE* IndexStream;
+            IBamIODevice* Device;
             char* Buffer;
             RaiiWrapper(void);
             ~RaiiWrapper(void);
         };
-        RaiiWrapper Resources;
+        RaiiWrapper m_resources;
 
     // static methods
     private: