-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRow.cpp
More file actions
44 lines (33 loc) · 1011 Bytes
/
Row.cpp
File metadata and controls
44 lines (33 loc) · 1011 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
//
// Created by Piotrek Rybiec on 05/05/2025.
//
#include "Row.hpp"
#include "Column.hpp"
auto Row::getValue(const std::string& column_name) const -> const Value& {
return values.at(column_name);
}
auto Row::getValue(const Column& col) const -> const Value& {
return values.at(col.getName());
}
void Row::setValue(const std::string& column_name, const Value& val) {
values[column_name] = val;
}
auto Row::hasColumn(const std::string& column_name) const -> bool {
return values.find(column_name) != values.end();
}
auto Row::hasColumn(const Column& col) const -> bool {
return values.find(col.getName()) != values.end();
}
auto Row::getValues() const -> const ValueMap& {
return values;
}
auto Row::size() const -> int {
return values.size();
}
auto Row::empty() const -> bool {
return values.empty();
}
auto Row::removeColumn(const std::string& column_name) -> bool {
// if column existed and was removed returns true
return values.erase(column_name) > 0;
}