another ugly basic implementation
This commit is contained in:
16
table.h
16
table.h
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "parser.h"
|
||||
#include "row.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -8,14 +9,21 @@
|
||||
struct Table {
|
||||
|
||||
// public:
|
||||
Table(const Table& other);
|
||||
|
||||
Table(const std::string name, const std::vector<ColDefNode> columns);
|
||||
|
||||
ColDefNode get_column_def(const std::string col_name);
|
||||
ColDefNode get_column_def(const std::string& col_name);
|
||||
int columns_count() { return m_col_defs.size(); };
|
||||
|
||||
Row createEmptyRow(); // TODO this means unnecessary copying
|
||||
void addRow(const Row &row);
|
||||
|
||||
void print();
|
||||
|
||||
|
||||
// private:
|
||||
std::string m_name;
|
||||
std::vector<ColDefNode> m_col_defs;
|
||||
std::vector<std::vector<std::string>> m_rows;
|
||||
std::string m_name;
|
||||
std::vector<ColDefNode> m_col_defs;
|
||||
std::vector<Row> m_rows;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user