X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2Finternal%2FBamReader_p.h;h=2f670d59d94d829aead92868f0ed8c7a13e2cec3;hb=9f1ce8c47aeadb6dc1320b52ee671c3341b97935;hp=2901e54d2edca656d77810322672c0c0ae08aa76;hpb=c1fc1c5423ca73a1b5bcbe790650821d73e5959c;p=bamtools.git diff --git a/src/api/internal/BamReader_p.h b/src/api/internal/BamReader_p.h index 2901e54..2f670d5 100644 --- a/src/api/internal/BamReader_p.h +++ b/src/api/internal/BamReader_p.h @@ -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 // *************************************************************************** @@ -20,13 +20,13 @@ // // We mean it. -#include -#include -#include -#include -#include -#include -#include +#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 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); @@ -69,13 +69,17 @@ class BamReaderPrivate { 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' // // these methods should only be used by BamTools::Internal classes // (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 +108,9 @@ class BamReaderPrivate { BamHeader m_header; BamRandomAccessController m_randomAccessController; BgzfStream m_stream; + + // error handling + std::string m_errorString; }; } // namespace Internal