+ added some assertions
[qpalma.git] / ParaParser / ParaParser.h
1 #ifndef __PARAPARSER_H__
2 #define __PARAPARSER_H__
3
4 #include <Python.h>
5 #include <map>
6 using namespace std;
7
8 struct KeyCmp {
9 //bool operator()( unsigned long s1, unsigned long s2 ) const {
10 bool operator()( int s1, int s2 ) const {
11 return ( s1 < s2 );
12 }
13 };
14
15
16 typedef map<unsigned long,char**,KeyCmp> MAP;
17
18 class ParaParser{
19
20 private:
21 char* format_string;
22 char** field_names;
23 size_t num_columns;
24 char** types_list;
25
26 MAP *entries;
27
28 public:
29 ParaParser(const char* fmt, char** _fields, int num_entries);
30 int parseFile(char* reads_filename);
31 void create_entry_from_line(const char* current_line, char* format_string);
32 PyObject* fetchEntry(int id);
33
34 ~ParaParser(){}
35 };
36
37 #endif // __PARAPARSER_H__
38