1 // ***************************************************************************
2 // BamHeader_p.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 6 October 2011 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides the basic functionality for handling BAM headers.
8 // ***************************************************************************
17 // This file is not part of the BamTools API. It exists purely as an
18 // implementation detail. This header file may change from version to version
19 // without notice, or even be removed.
23 #include <api/SamHeader.h>
38 // BamHeader interface
40 // clear SamHeader data
42 // return true if SamHeader data is valid
43 bool IsValid(void) const;
44 // load BAM header ('magic number' and SAM header text) from BGZF stream
45 // returns true if all OK
46 void Load(BgzfStream* stream);
47 // returns (editable) copy of SamHeader data object
48 SamHeader ToSamHeader(void) const;
49 // returns SAM-formatted string of header data
50 std::string ToString(void) const;
54 // reads magic number from BGZF stream
55 void CheckMagicNumber(BgzfStream* stream);
56 // reads SAM header length from BGZF stream, stores it in @length
57 void ReadHeaderLength(BgzfStream* stream, uint32_t& length);
58 // reads SAM header text from BGZF stream, stores in SamHeader object
59 void ReadHeaderText(BgzfStream* stream, const uint32_t& length);
66 } // namespace Internal
67 } // namespace BamTools
69 #endif // BAMHEADER_P_H