Repository navigation
Expand file tree
/
Copy pathTable.h
More file actions
59 lines (59 loc) · 1.37 KB
/
Copy pathTable.h
File metadata and controls
59 lines (59 loc) · 1.37 KB
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
#pragma once
#include "Column.h"
#include"FractionalNumber.h"
#include"Integer.h"
#include"String.h"
#include"NullValue.h"
class Table {
size_t capacity;
size_t size;
const char* nameFile;
Column** table;
void free();
void copyFrom(const Table& other);
void resize();
void createFile();
public:
Table();
Table(const Table& other);
const char* getName()const;
void setName(const char* newName);
void setName(char* newName);
void addColumn(const Column& other);
void addColumn(Column& other);
void addCol();
size_t getCapacity()const;
void printRow(size_t index)const;
size_t getSize()const;
Column*& operator[](size_t index)const;
Column*& operator[](size_t index);
void setSize(size_t size);
void setCapacity(size_t capacity);
void printRows()const;
Table& operator=(const Table& other);
Column*& operator[](size_t index)const;
Column*& operator[](size_t index);
void writeInFile(const char* writeFile)const;
void rewriteFile(const char* writeFile)const;
void readFromFile(const char* readFile);
void describe()const;
void rename();
void renameWith(char* name);
void close();
void save()const;
void saveas();
void help()const;
void exit();
void interface();
~Table();
};
static const char* takeName(const char* name) {
char* temp = new char[strlen(name)];
size_t i = 0;
while (name[i] != '.') {
temp[i] = name[i];
i++;
}
temp[i] = '\0';
return temp;
}