-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParameter.cpp
More file actions
60 lines (47 loc) · 934 Bytes
/
Parameter.cpp
File metadata and controls
60 lines (47 loc) · 934 Bytes
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
#include "Parameter.hpp"
#include "sqlite3.h"
#include <cstring>
#include <cstdio>
Parameter::Parameter(int val) {
intVal = val;
type = INTEGER;
}
Parameter::Parameter(double val) {
realVal = val;
type = REAL;
}
Parameter::Parameter(const char* val) {
textVal = val;
type = TEXT;
}
Parameter::Parameter(std::string& val) {
textVal = val;
type = TEXT;
}
Parameter::Parameter(void* obj, int size) {
if(obj == nullptr) {
type = NULLTYPE;
} else {
blobVal = obj;
blobSize = size;
type = BLOB;
}
}
Parameter::Type Parameter::getType() {
return type;
}
const int Parameter::getValueInt() const {
return intVal;
}
const double Parameter::getValueReal() const {
return realVal;
}
const std::string& Parameter::getValueText() const {
return textVal;
}
const void* Parameter::getValueBlob() const {
return blobVal;
}
const int Parameter::getBlobSize() const {
return blobSize;
}