X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FBamReader.h;h=15b41354d9e2e119e2c1e4e2cc38cd80fd500ecc;hb=e9977c58d60d1a1b2034eb3f01cd0183cbfe8736;hp=836fbf5e3cbac860f62916c3e717c72618089a7b;hpb=1a93ff03d7e40d97c32e6f5966045ceaeb2f038a;p=bamtools.git diff --git a/src/api/BamReader.h b/src/api/BamReader.h index 836fbf5..15b4135 100644 --- a/src/api/BamReader.h +++ b/src/api/BamReader.h @@ -2,7 +2,7 @@ // BamReader.h (c) 2009 Derek Barnett, Michael Str�mberg // Marth Lab, Department of Biology, Boston College // --------------------------------------------------------------------------- -// Last modified: 4 March 2011 (DB) +// Last modified: 18 November 2012 (DB) // --------------------------------------------------------------------------- // Provides read access to BAM files. // *************************************************************************** @@ -10,10 +10,10 @@ #ifndef BAMREADER_H #define BAMREADER_H -#include -#include -#include -#include +#include "api/api_global.h" +#include "api/BamAlignment.h" +#include "api/BamIndex.h" +#include "api/SamHeader.h" #include namespace BamTools { @@ -37,7 +37,7 @@ class API_EXPORT BamReader { // ---------------------- // closes the current BAM file - void Close(void); + bool Close(void); // returns filename of current BAM file const std::string GetFilename(void) const; // returns true if a BAM file is open for reading @@ -69,7 +69,9 @@ class API_EXPORT BamReader { // access header data // ---------------------- - // returns SAM header data + // returns a read-only reference to SAM header data + const SamHeader& GetConstSamHeader(void) const; + // returns an editable copy of SAM header data SamHeader GetHeader(void) const; // returns SAM header data, as SAM-formatted text std::string GetHeaderText(void) const; @@ -99,13 +101,13 @@ class API_EXPORT BamReader { bool OpenIndex(const std::string& indexFilename); // sets a custom BamIndex on this reader void SetIndex(BamIndex* index); - // changes the caching behavior of the index data - void SetIndexCacheMode(const BamIndex::IndexCacheMode& mode); - // deprecated methods - public: - // returns true if index data is available - bool IsIndexLoaded(void) const; + // ---------------------- + // error handling + // ---------------------- + + // returns a human-readable description of the last error that occurred + std::string GetErrorString(void) const; // private implementation private: