-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql_column.cpp
More file actions
92 lines (70 loc) · 1.51 KB
/
sql_column.cpp
File metadata and controls
92 lines (70 loc) · 1.51 KB
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
#include "stdafx.h"
#include "sql_column.h"
void orm::sql::swap(orm::sql::sql_column &left, orm::sql::sql_column &right)
{
using std::swap;
swap(left._column, right._column);
swap(left._table, right._table);
}
orm::sql::sql_column::sql_column()
{
}
orm::sql::sql_column::sql_column(const orm::sql::sql_column &other) :
_table(other._table)
, _column(other._column)
{
}
orm::sql::sql_column::sql_column(orm::sql::sql_column &&other) :
orm::sql::sql_column()
{
swap(*this, other);
}
orm::sql::sql_column::~sql_column()
{
}
orm::sql::sql_column &orm::sql::sql_column::operator =(orm::sql::sql_column other)
{
swap(*this, other);
return *this;
}
bool orm::sql::sql_column::operator ==(const orm::sql::sql_column &other) const
{
bool result = (this == &other);
if (this != &other)
{
result = (_table == other._table)
&& (_column == other._column);
}
return result;
}
bool orm::sql::sql_column::operator !=(const orm::sql::sql_column &other) const
{
bool result = !(*this == other);
return result;
}
void orm::sql::sql_column::SetTable(const std::string &table)
{
_table = table;
}
std::string orm::sql::sql_column::GetTable() const
{
return _table;
}
void orm::sql::sql_column::SetColumn(const std::string &column)
{
_column = column;
}
std::string orm::sql::sql_column::GetColumn() const
{
return _column;
}
std::string orm::sql::sql_column::GetColumnString() const
{
std::string result = _table;
if (_table.empty() == false)
{
result.append(".");
}
result.append(_column);
return result;
}