Repository navigation
Expand file tree
/
Copy pathWhereFilterWrapper.cpp
More file actions
137 lines (115 loc) · 5.32 KB
/
Copy pathWhereFilterWrapper.cpp
File metadata and controls
137 lines (115 loc) · 5.32 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include <LazyOrm/WhereFilter.h>
#include <cstdint>
#include <cstring>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
extern "C" {
void* WhereFilter_create(){
return new LazyOrm::WhereFilter();
}
void WhereFilter_destroy(void* obj) {
if (obj != nullptr) {
delete static_cast<LazyOrm::WhereFilter*>(obj);
}
}
void WhereFilter_addVarinat(void* whereFilter_obj, void* variant_obj) {
if (whereFilter_obj != nullptr && variant_obj != nullptr) {
auto variant = static_cast<LazyOrm::DbVariant*>(variant_obj);
auto whereFilterObj = static_cast<LazyOrm::WhereFilter*>(whereFilter_obj);
whereFilterObj->append({*variant});
}
}
void WhereFilter_addVarinatVector(void* whereFilter_obj, void* variant_vector_obj) {
if (whereFilter_obj != nullptr && variant_vector_obj != nullptr) {
auto variantVector = static_cast<std::vector<LazyOrm::DbVariant>*>(variant_vector_obj);
auto whereFilterObj = static_cast<LazyOrm::WhereFilter*>(whereFilter_obj);
whereFilterObj->append({{*variantVector}});
}
}
void WhereFilter_addWhereFilter(void* whereFilter_obj, void* pushing_obj) {
if (whereFilter_obj != nullptr && pushing_obj != nullptr) {
auto pushingWhereFilter = static_cast<LazyOrm::WhereFilter*>(pushing_obj);
auto whereFilterObj = static_cast<LazyOrm::WhereFilter*>(whereFilter_obj);
whereFilterObj->setWhereFilterVector( {{*pushingWhereFilter}} );
}
}
const char* WhereFilter_toString(void* obj){
if (obj != nullptr) {
return strdup(static_cast<LazyOrm::WhereFilter*>(obj)->toString().c_str());
}
return "";
}
void* WhereFilter_vector_create(){
return new std::vector<LazyOrm::WhereFilter>();
}
void WhereFilter_vector_destroy(void* obj) {
if (obj != nullptr) {
delete static_cast<std::vector<LazyOrm::WhereFilter>*>(obj);
}
}
void WhereFilter_vector_push(void* whereFilter_vector_obj, void* pushing_obj) {
if (whereFilter_vector_obj != nullptr && pushing_obj != nullptr) {
auto pushingWhereFilter = static_cast<LazyOrm::WhereFilter*>(pushing_obj);
static_cast<std::vector<LazyOrm::WhereFilter>*>(whereFilter_vector_obj)->push_back(*pushingWhereFilter);
}
}
void WhereFilter_vector_pop(void* whereFilter_vector_obj, void* pushing_obj) {
if (whereFilter_vector_obj != nullptr && pushing_obj != nullptr) {
auto pushingWhereFilter = static_cast<LazyOrm::WhereFilter*>(pushing_obj);
auto whereFilterVector = static_cast<std::vector<LazyOrm::WhereFilter>*>(whereFilter_vector_obj);
auto it = std::find(whereFilterVector->begin(), whereFilterVector->end(), *pushingWhereFilter);
if (it != whereFilterVector->end()) {
whereFilterVector->erase(it);
}
}
}
void WhereFilter_vector_popback(void* whereFilter_vector_obj) {
if (whereFilter_vector_obj != nullptr) {
static_cast<std::vector<LazyOrm::DbVariant>*>(whereFilter_vector_obj)->pop_back();
}
}
void WhereFilter_addWhereFilterVector(void* whereFilter_obj, void* whereFilter_vector_obj) {
if (whereFilter_obj != nullptr && whereFilter_vector_obj != nullptr) {
auto whereFilterVector = static_cast<std::vector<LazyOrm::WhereFilter>*>(whereFilter_vector_obj);
auto whereFilterObj = static_cast<LazyOrm::WhereFilter*>(whereFilter_obj);
whereFilterObj->setWhereFilterVector( {*whereFilterVector} );
}
}
// void WhereFilter_appendVariant_null(void* obj, const char* key) {
// if (obj != nullptr) {
// static_cast<LazyOrm::WhereFilter*>(obj)->append("null");
// }
// }
// void WhereFilter_appendVariant_bool(void* obj, const char* key, const bool value) {
// if (obj != nullptr) {
// static_cast<LazyOrm::MariadbLazy*>(obj)->setProperty(std::string(key), value);
// }
// }
// void WhereFilter_appendVariant_string(void* obj, const char* key, const char* value) {
// if (obj != nullptr) {
// static_cast<LazyOrm::MariadbLazy*>(obj)->setProperty(std::string(key), value);
// }
// }
// void WhereFilter_appendVariant_ull(void* obj, const char* key, const unsigned long long value) {
// if (obj != nullptr) {
// static_cast<LazyOrm::MariadbLazy*>(obj)->setProperty(std::string(key), value);
// }
// }
// void WhereFilter_appendVariant_ll(void* obj, const char* key, const long long value) {
// if (obj != nullptr) {
// static_cast<LazyOrm::MariadbLazy*>(obj)->setProperty(std::string(key), value);
// }
// }
// void WhereFilter_appendVariant_double(void* obj, const char* key, int typeTag, const double value) {
// if (obj != nullptr) {
// static_cast<LazyOrm::MariadbLazy*>(obj)->setProperty(std::string(key), value);
// }
// }
// void WhereFilter_appendVariant_ld(void* obj, const char* key, int typeTag, const long double value) {
// if (obj != nullptr) {
// static_cast<LazyOrm::MariadbLazy*>(obj)->setProperty(std::string(key), value);
// }
// }
}