]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/IBamIODevice.h
merge with remoteio branch
[bamtools.git] / src / api / IBamIODevice.h
index 8e148279605857a02b89acc41b9ff392d09dc712..cf641298a9df17d19b5cbd71b5f9027fbaeb334a 100644 (file)
@@ -2,7 +2,7 @@
 // IBamIODevice.h (c) 2011 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 10 October 2011 (DB)
+// Last modified: 10 November 2011 (DB)
 // ---------------------------------------------------------------------------
 // Base class for all BAM I/O devices (e.g. local file, pipe, HTTP, FTP, etc.)
 //
@@ -19,6 +19,7 @@
 #define IBAMIODEVICE_H
 
 #include "api/api_global.h"
+#include <cstdio>
 #include <string>
 
 namespace BamTools {
@@ -39,12 +40,14 @@ class API_EXPORT IBamIODevice {
     // IBamIODevice interface
     public:
 
+        // TODO: add seek(pos, *from*)
+
         // pure virtuals
         virtual void Close(void) =0;
         virtual bool IsRandomAccess(void) const =0;
         virtual bool Open(const OpenMode mode) =0;
         virtual int64_t Read(char* data, const unsigned int numBytes) =0;
-        virtual bool Seek(const int64_t& position) =0;
+        virtual bool Seek(const int64_t& position, const int origin = SEEK_SET) =0;
         virtual int64_t Tell(void) const =0;
         virtual int64_t Write(const char* data, const unsigned int numBytes) =0;