about summary refs log tree commit diff stats
path: root/generator/database.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-27 17:13:37 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-27 17:13:37 -0400
commitaf49d3435302118d036c512aef1def848fb88089 (patch)
tree5bdec9a528cc84e97b10dc6a62bbfc5b72037ecc /generator/database.h
parent07a11ffc6a1d23815bca45321afa0f3c8661d96d (diff)
downloadcadence-af49d3435302118d036c512aef1def848fb88089.tar.gz
cadence-af49d3435302118d036c512aef1def848fb88089.tar.bz2
cadence-af49d3435302118d036c512aef1def848fb88089.zip
Migrated to hkutil
Diffstat (limited to 'generator/database.h')
-rw-r--r--generator/database.h73
1 files changed, 0 insertions, 73 deletions
diff --git a/generator/database.h b/generator/database.h deleted file mode 100644 index e4f3ba2..0000000 --- a/generator/database.h +++ /dev/null
@@ -1,73 +0,0 @@
1#ifndef DATABASE_H_0B0A47D2
2#define DATABASE_H_0B0A47D2
3
4#include <string>
5#include <exception>
6#include <list>
7
8struct sqlite3;
9
10namespace cadence {
11 namespace generator {
12
13 class field;
14
15 class sqlite3_error : public std::exception {
16 public:
17
18 sqlite3_error(const std::string& what, const std::string& db_err);
19
20 const char* what() const noexcept override;
21 const char* db_err() const noexcept;
22
23 private:
24 std::string what_;
25 std::string db_err_;
26
27 };
28
29 class database {
30 public:
31
32 // Constructor
33
34 explicit database(std::string path);
35
36 // Disable copying
37
38 database(const database& other) = delete;
39 database& operator=(const database& other) = delete;
40
41 // Move constructor and move assignment
42
43 database(database&& other);
44 database& operator=(database&& other);
45
46 // Swap
47
48 friend void swap(database& first, database& second);
49
50 // Destructor
51
52 ~database();
53
54 // Actions
55
56 void runQuery(std::string query);
57
58 void insertIntoTable(std::string table, std::list<field> fields);
59
60 private:
61
62 database()
63 {
64 }
65
66 sqlite3* ppdb_ = nullptr;
67
68 };
69
70 };
71};
72
73#endif /* end of include guard: DATABASE_H_0B0A47D2 */