// BgzfStream_p.h (c) 2011 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 7 October 2011(DB)
+// Last modified: 10 October 2011(DB)
// ---------------------------------------------------------------------------
// Based on BGZF routines developed at the Broad Institute.
// Provides the basic functionality for reading & writing BGZF files
//
// We mean it.
-#include <api/BamAux.h>
-#include <api/BamConstants.h>
-#include <api/IBamIODevice.h>
-#include "zlib.h"
-#include <cstdio>
-#include <memory>
+#include "api/api_global.h"
+#include "api/IBamIODevice.h"
#include <string>
namespace BamTools {
void Close(void);
// returns true if BgzfStream open for IO
bool IsOpen(void) const;
- // opens the BGZF file (mode is either "rb" for reading, or "wb" for writing)
- void Open(const std::string& filename, const char* mode);
+ // opens the BGZF file
void Open(const std::string& filename, const IBamIODevice::OpenMode mode);
// reads BGZF data into a byte buffer
size_t Read(char* data, const size_t dataLength);
unsigned int m_blockOffset;
uint64_t m_blockAddress;
- bool m_isOpen;
- bool m_isWriteOnly;
bool m_isWriteCompressed;
-
IBamIODevice* m_device;
struct RaiiWrapper {
~RaiiWrapper(void);
char* UncompressedBlock;
char* CompressedBlock;
- FILE* Stream;
};
RaiiWrapper Resources;
};