1 | // ==================================================================== // |
---|
2 | // // |
---|
3 | // File : probe_match_parser.hxx // |
---|
4 | // Purpose : parse the results of a probe match // |
---|
5 | // Time-stamp: <Thu Jun/10/2004 13:58 MET Coder@ReallySoft.de> // |
---|
6 | // // |
---|
7 | // // |
---|
8 | // Coded by Ralf Westram (coder@reallysoft.de) in June 2004 // |
---|
9 | // Copyright Department of Microbiology (Technical University Munich) // |
---|
10 | // // |
---|
11 | // Visit our web site at: http://www.arb-home.de/ // |
---|
12 | // // |
---|
13 | // ==================================================================== // |
---|
14 | |
---|
15 | #ifndef PROBE_MATCH_PARSER_HXX |
---|
16 | #define PROBE_MATCH_PARSER_HXX |
---|
17 | |
---|
18 | #ifndef ARBTOOLS_H |
---|
19 | #include <arbtools.h> |
---|
20 | #endif |
---|
21 | |
---|
22 | // -------------------------------------------------------------------------------- |
---|
23 | // helper class to parse probe match results |
---|
24 | |
---|
25 | class ProbeMatch_impl; |
---|
26 | |
---|
27 | class ProbeMatchParser : public Noncopyable { |
---|
28 | ProbeMatch_impl *pimpl; |
---|
29 | char *init_error; |
---|
30 | |
---|
31 | public: |
---|
32 | ProbeMatchParser(const char *probe_target, const char *headline); |
---|
33 | ~ProbeMatchParser(); |
---|
34 | |
---|
35 | const char * get_error() const { return init_error; } |
---|
36 | bool is_gene_result() const; |
---|
37 | int get_probe_region_offset() const; |
---|
38 | |
---|
39 | bool getColumnRange(const char *columnName, int *startCol, int *endCol) const; |
---|
40 | |
---|
41 | // bool parse_match(const char *match, const char *& result_probeRegion, int& result_startPos, GB_ERROR& error); |
---|
42 | friend class ParsedProbeMatch; |
---|
43 | }; |
---|
44 | |
---|
45 | class ParsedProbeMatch : public Noncopyable { |
---|
46 | const ProbeMatchParser& parser; |
---|
47 | char *match; |
---|
48 | mutable const char *error; |
---|
49 | public: |
---|
50 | |
---|
51 | ParsedProbeMatch(const char *match_, const ProbeMatchParser& parser_); |
---|
52 | ~ParsedProbeMatch(); |
---|
53 | |
---|
54 | const char *get_error() const { return error; } |
---|
55 | int get_position() const; |
---|
56 | const char *get_probe_region() const; |
---|
57 | |
---|
58 | char *get_column_content(const char *columnName, bool chop_spaces) const; |
---|
59 | }; |
---|
60 | |
---|
61 | |
---|
62 | #else |
---|
63 | #error probe_match_parser.hxx included twice |
---|
64 | #endif // PROBE_MATCH_PARSER_HXX |
---|
65 | |
---|