-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table.h
60 lines (52 loc) · 1.57 KB
/
Table.h
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
//
// Created by Christo on 3/5/2019.
//
#ifndef MONRAZD_TABLE_H
#define MONRAZD_TABLE_H
#pragma once
#include "Column.h"
#include "ColumnInt.h"
#include "ColumnChar.h"
#include "ColumnString.h"
#include "ColumnDouble.h"
#include "ColumnBool.h"
#include "Column.cpp"
#include "ColumnInt.cpp"
#include "ColumnChar.cpp"
#include "ColumnString.cpp"
#include "ColumnDouble.cpp"
#include "ColumnBool.cpp"
#include "WrongPathException.cpp"
#include <iostream>
#include <string>
#include <map>
#include <fstream>
#include "Database.h"
#include <memory>
#include <iomanip>
class Table {
std::string tableName;
std::string tableFilePath;
std::fstream tableFile;
std::vector<std::string> tableInfoVector;
const char separator =' ';
const int cellWidht = 16;
public:
std::vector<std::string>tableColumnVector;
Table(std::string tableName, std::string databaseName);
Table(std::string path, std::string databaseName, bool boolean) noexcept(false);
Table(std::string tableFilePath);
const std::string &getTableFilePath() const;
std::string getTableName(bool withoutSignature);
void refreshTableInfo();
std::vector<std::string> getColumns();
void addRow (std::vector<std::string> stringVector);
void printColumn(bool enumerated);
std::vector<std::string> getRowFromUser();
void deleteColumn(std::shared_ptr<Column> column);
void deleteAllColumns();
void exportFile(std::string name, std::string query);
void query();
void showTable();
};
#endif //MONRAZD_TABLE_H