-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsqlitebuilder.hpp
More file actions
41 lines (29 loc) · 814 Bytes
/
sqlitebuilder.hpp
File metadata and controls
41 lines (29 loc) · 814 Bytes
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
#if !defined(SQLITEBUILDER_HPP_INCLUDED)
#define SQLITEBUILDER_HPP_INCLUDED
#include "tablebuilder.hpp"
#include <sqlite3.h>
#include <string>
#include <vector>
class sqlitebuilder : public tablebuilder {
private:
sqlite3 *db;
sqlite3_stmt *prepared;
int cur_index;
int row_count;
std::string name;
typedef std::vector<std::string> columns_t;
public:
sqlitebuilder(sqlite3 *a_db);
virtual void open_table(const table_spec &spec);
virtual void table_complete();
virtual void open_row();
virtual void row_complete();
virtual void add_column(const column_spec &col, const char *value);
virtual void add_index(const std::string &column);
private:
template<typename T>
void add_column_tmpl(T value);
void begin_transaction();
void end_transaction();
};
#endif // SQLITEBUILDER_HPP_INCLUDED