-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsoimport.hpp
50 lines (39 loc) · 946 Bytes
/
soimport.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#if !defined(SOIMPORT_HPP_INCLUDED)
#define SOIMPORT_HPP_INCLUDED
#include "xmldb.hpp"
#include "tablebuilder.hpp"
#include "dbspec.hpp"
class soloader : private xmltable {
protected:
tablebuilder &builder;
table_spec table;
public:
soloader(tablebuilder &a_builder, const table_spec &a_table);
void load();
void add_indexes();
protected:
virtual void open_row();
virtual void add_column(const column_spec &col, const char *value);
virtual void row_complete();
};
struct config_t {
bool indexes;
bool posttags;
std::string only;
bool simple;
std::string connect;
std::string dir;
std::string dbfile;
config_t() : indexes(true), posttags(true), only(), simple(false),
connect(), dir(), dbfile() {
}
};
extern config_t config;
enum configset_t {
CS_PG,
CS_SQLITE,
CS_CSV,
};
void parse_config(configset_t cs, int argc, const char **argv);
void import_tables(tablebuilder &builder);
#endif // SOIMPORT_HPP_INCLUDED