- // change the index caching behavior\r
- // default BamReader/Index mode is LimitedIndexCaching\r
- // @mode - can be either FullIndexCaching, LimitedIndexCaching,\r
- // or NoIndexCaching. See BamIndex.h for more details\r
- void SetIndexCacheMode(const BamIndex::BamIndexCacheMode mode);\r
- \r
- // deprecated methods\r
- public:\r
- \r
- // deprecated (but still available): prefer HasIndex() instead\r
- //\r
- // Deprecated purely for API semantic clarity - HasIndex() should be clearer\r
- // than IsIndexLoaded() in light of the new caching modes that may clear the\r
- // index data from memory, but leave the index file open for later random access\r
- // seeks.\r
- //\r
- // For example, what would (IsIndexLoaded() == true) mean when cacheMode has been\r
- // explicitly set to NoIndexCaching? This is confusing at best, misleading about\r
- // current memory behavior at worst.\r
- //\r
- // returns whether index data is available\r
- // (e.g. if true, BamReader should be able to seek to a region)\r
- bool IsIndexLoaded(void) const;\r
+ // looks in BAM file's directory for a matching index file\r
+ bool LocateIndex(const BamIndex::IndexType& preferredType = BamIndex::STANDARD);\r
+ // opens a BAM index file\r
+ bool OpenIndex(const std::string& indexFilename);\r
+ // sets a custom BamIndex on this reader\r
+ void SetIndex(BamIndex* index);\r
+\r
+ // ----------------------\r
+ // error handling\r
+ // ----------------------\r
+\r
+ // returns a human-readable description of the last error that occurred\r
+ std::string GetErrorString(void) const;\r