summary refs log tree commit diff stats
path: root/lib/binding.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-09-27 21:40:52 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-09-27 21:40:52 -0400
commit38c17f093615a16a4b4ec6dc2b5d3edb5c1d3895 (patch)
tree8da5a3d0eacf5e2fd04c33f57d592e4c1ca303ad /lib/binding.h
parent3a8bfa95a5df04d97f05545d5bb8df5f3c3f96a3 (diff)
downloadverbly-38c17f093615a16a4b4ec6dc2b5d3edb5c1d3895.tar.gz
verbly-38c17f093615a16a4b4ec6dc2b5d3edb5c1d3895.tar.bz2
verbly-38c17f093615a16a4b4ec6dc2b5d3edb5c1d3895.zip
More hkutil refactoring
All database access goes through hatkirby::database now.

verbly::token, verbly::statement::condition, and verbly::part have been converted to use mpark::variant now. verbly::binding has been deleted, and replaced with a mpark::variant typedef in statement.h. This means that the only remaining tagged union class is verbly::generator::part.

refs #5
Diffstat (limited to 'lib/binding.h')
-rw-r--r--lib/binding.h82
1 files changed, 0 insertions, 82 deletions
diff --git a/lib/binding.h b/lib/binding.h deleted file mode 100644 index 5da1e71..0000000 --- a/lib/binding.h +++ /dev/null
@@ -1,82 +0,0 @@
1#ifndef BINDING_H_CAE0B18E
2#define BINDING_H_CAE0B18E
3
4#include <string>
5
6namespace verbly {
7
8 class binding {
9 public:
10 enum class type {
11 invalid,
12 integer,
13 string,
14 field
15 };
16
17 // Default constructor
18
19 binding()
20 {
21 }
22
23 // Copy and move constructors
24
25 binding(const binding& other);
26 binding(binding&& other);
27
28 // Assignment
29
30 binding& operator=(binding other);
31
32 // Swap
33
34 friend void swap(binding& first, binding& second);
35
36 // Destructor
37
38 ~binding();
39
40 // Generic accessors
41
42 type getType() const
43 {
44 return type_;
45 }
46
47 // Integer
48
49 binding(int arg);
50
51 int getInteger() const;
52
53 // String
54
55 binding(std::string arg);
56
57 std::string getString() const;
58
59 // Field
60
61 binding(std::string table, std::string column);
62
63 std::string getTable() const;
64 std::string getColumn() const;
65
66 private:
67
68 union {
69 int integer_;
70 std::string string_;
71 struct {
72 std::string table_;
73 std::string column_;
74 } field_;
75 };
76
77 type type_ = type::invalid;
78 };
79
80};
81
82#endif /* end of include guard: BINDING_H_CAE0B18E */