]> git.donarmstrong.com Git - bamtools.git/blob - src/api/internal/SamFormatParser_p.h
Removed some debugging 'error string' messages that snuck into last
[bamtools.git] / src / api / internal / SamFormatParser_p.h
1 // ***************************************************************************
2 // SamFormatParser.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 23 December 2010 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides functionality for parsing SAM header text into SamHeader object
8 // ***************************************************************************
9
10 #ifndef SAM_FORMAT_PARSER_H
11 #define SAM_FORMAT_PARSER_H
12
13 //  -------------
14 //  W A R N I N G
15 //  -------------
16 //
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.
20 //
21 // We mean it.
22
23 #include <string>
24 #include <vector>
25
26 namespace BamTools {
27
28 class SamHeader;
29
30 namespace Internal {
31
32 class SamFormatParser {
33
34     // ctor & dtor
35     public:
36         SamFormatParser(BamTools::SamHeader& header);
37         ~SamFormatParser(void);
38
39     // parse text & populate header data
40     public:
41         void Parse(const std::string& headerText);
42
43     // internal methods
44     private:
45         void ParseSamLine(const std::string& line);
46         void ParseHDLine(const std::string& line);
47         void ParseSQLine(const std::string& line);
48         void ParseRGLine(const std::string& line);
49         void ParsePGLine(const std::string& line);
50         void ParseCOLine(const std::string& line);
51         const std::vector<std::string> Split(const std::string& line, const char delim);
52
53     // data members
54     private:
55         SamHeader& m_header;
56 };
57
58 } // namespace Internal
59 } // namespace BamTools
60
61 #endif // SAM_FORMAT_PARSER_H