]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/BamReader_p.h
Updated CMakeLists.txt files
[bamtools.git] / src / api / internal / BamReader_p.h
index 2901e54d2edca656d77810322672c0c0ae08aa76..f9282731d24fd66224ffc78d8f378b4a537001ec 100644 (file)
@@ -2,7 +2,7 @@
 // BamReader_p.h (c) 2010 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 5 April 2011 (DB)
+// Last modified: 10 October 2011 (DB)
 // ---------------------------------------------------------------------------
 // Provides the basic functionality for reading BAM files
 // ***************************************************************************
 //
 // We mean it.
 
-#include <api/BamAlignment.h>
-#include <api/BamIndex.h>
-#include <api/BamReader.h>
-#include <api/SamHeader.h>
-#include <api/internal/BamHeader_p.h>
-#include <api/internal/BamRandomAccessController_p.h>
-#include <api/internal/BgzfStream_p.h>
+#include "api/BamAlignment.h"
+#include "api/BamIndex.h"
+#include "api/BamReader.h"
+#include "api/SamHeader.h"
+#include "api/internal/BamHeader_p.h"
+#include "api/internal/BamRandomAccessController_p.h"
+#include "api/internal/BgzfStream_p.h"
 #include <string>
 
 namespace BamTools {
@@ -43,7 +43,7 @@ class BamReaderPrivate {
     public:
 
         // file operations
-        void Close(void);
+        bool Close(void);
         const std::string Filename(void) const;
         bool IsOpen(void) const;
         bool Open(const std::string& filename);
@@ -67,7 +67,10 @@ class BamReaderPrivate {
         bool LocateIndex(const BamIndex::IndexType& preferredType);
         bool OpenIndex(const std::string& indexFilename);
         void SetIndex(BamIndex* index);
-        void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode);
+
+        // error handling
+        std::string GetErrorString(void) const;
+        void SetErrorString(const std::string& where, const std::string& what);
 
     // internal methods, but available as a BamReaderPrivate 'interface'
     //
@@ -75,7 +78,7 @@ class BamReaderPrivate {
     // (currently only used by the BamIndex subclasses)
     public:
         // retrieves header text from BAM file
-        bool LoadHeaderData(void);
+        void LoadHeaderData(void);
         // retrieves BAM alignment under file pointer
         // (does no overlap checking or character data parsing)
         bool LoadNextAlignment(BamAlignment& alignment);
@@ -104,6 +107,9 @@ class BamReaderPrivate {
         BamHeader m_header;
         BamRandomAccessController m_randomAccessController;
         BgzfStream m_stream;
+
+        // error handling
+        std::string m_errorString;
 };
 
 } // namespace Internal