-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathccorm.cpp
More file actions
46 lines (41 loc) · 814 Bytes
/
ccorm.cpp
File metadata and controls
46 lines (41 loc) · 814 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
#include "ccorm.h"
FieldInfo * TableInfo::getField(unsigned int index)
{
if (index < _fields.size())
{
return &_fields[index];
}
return 0;
}
bool TableInfo::addField(int type, const std::string& name)
{
FieldInfo field;
field.type = type;
field.name = name;
_fields.push_back(field);
return true;
}
void Record::put(const char *fieldName)
{
_values[fieldName] = 0;
}
void Record::put(const char* fieldName, const AnyValue& value)
{
_values[fieldName] = value;
}
void Record::put(const char* fieldName, const char* value, unsigned int size)
{
std::string data;
data.resize(size);
memcpy(&data[0], value, size);
_values[fieldName] = data;
}
bool Record::find(const std::string& fieldName)
{
auto it = _values.find(fieldName);
if (it != _values.end())
{
return true;
}
return false;
}