-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColumn.cpp
More file actions
42 lines (36 loc) · 749 Bytes
/
Column.cpp
File metadata and controls
42 lines (36 loc) · 749 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
#include <algorithm>
#include "Column.h"
Columns::~Columns()
{
std::for_each(begin(), end(), free);
}
void Columns::add(const std::string & name, const std::string table)
{
Column * c = new Column();
c->m_name = name;
c->m_table = table;
c->m_qualified_name = table + "." + name;
push_back(c);
}
bool Columns::contains(const std::string & column) const
{
for (int i = 0; i < size(); i++)
{
const Column * c = std::vector<Column *>::at(i);
if (c->m_qualified_name == column)
return true;
}
return false;
}
const Column * Columns::at(int c) const
{
return std::vector<Column *>::at(c);
}
const Column * Columns::operator[](int c) const
{
return at(c);
}
int Columns::count() const
{
return size();
}