+ added generice parser code
[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 return ( s1 == s2 );
11 }
12 };
13
14
15 class ParaParser{
16
17 private:
18 char* format_string;
19 char** field_names;
20 int num_columns;
21 char** types_list;
22
23 map<unsigned long,void***,KeyCmp> *entries;
24
25 public:
26 ParaParser(const char* fmt, char** _fields, int num_entries);
27 int parseFile(char* reads_filename);
28 void create_entry_from_line(const char* current_line, char* format_string, ...);
29 //PyObject* fetchEntry(int id);
30
31 ~ParaParser(){}
32 };
33
34 #endif // __PARAPARSER_H__
35