forked from ryjen/libcoda-db
/
column.cpp
98 lines (77 loc) · 1.82 KB
/
column.cpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "column.h"
namespace arg3
{
namespace db
{
column::column()
{}
column::column(shared_ptr<column_impl> impl) : impl_(impl)
{
}
column::column(const column &other) : impl_(other.impl_)
{}
column::column(column &&other) : impl_(std::move(other.impl_))
{
other.impl_ = nullptr;
}
column &column::operator=(const column &other)
{
impl_ = other.impl_;
return *this;
}
column &column::operator=(column && other)
{
impl_ = std::move(other.impl_);
other.impl_ = nullptr;
return *this;
}
bool column::is_valid() const
{
return impl_->is_valid();
}
sql_blob column::to_blob() const
{
return impl_->to_blob();
}
double column::to_double() const
{
return impl_->to_double();
}
int column::to_int() const
{
return impl_->to_int();
}
bool column::to_bool() const
{
return impl_->to_bool();
}
int64_t column::to_int64() const
{
return impl_->to_int64();
}
string column::to_string() const
{
return impl_->to_string();
}
sql_value column::to_value() const
{
return impl_->to_value();
}
column::operator string() const
{
return to_string();
}
column::operator int() const
{
return to_int();
}
column::operator int64_t() const
{
return to_int64();
}
column::operator double() const
{
return to_double();
}
}
}