diff options
| Commit | 14da4290639763ed79249c90f95e2387025a4764 (patch) | |
|---|---|---|
| Author | 2022-05-30 18:27:45 +0300 | |
| Committer | 2022-05-30 18:27:45 +0300 | |
| Files | 354ff9107a88da2a40909910f1125c8d1cab1c17 /src | |
| FMI-OOP-P2_Tables-14da4290639763ed79249c90f95e2387025a4764.tar FMI-OOP-P2_Tables-14da4290639763ed79249c90f95e2387025a4764.tar.gz FMI-OOP-P2_Tables-14da4290639763ed79249c90f95e2387025a4764.zip | ||
| Parent | b53dc76d5e4d08ff81040a226b34beffaa0ccefa (diff) | |
Autocommit at 30.05.2022 @ 18:27
2 files changed, 12 insertions, 0 deletions
| -rw-r--r-- | src/Models/Table.h | 1 | ||||
| -rw-r--r-- | src/UserInterface/UserInterface.cpp | 11 |
diff --git a/src/Models/Table.h b/src/Models/Table.h index 23b518d..468a7ba 100644 --- a/src/Models/Table.h +++ b/src/Models/Table.h @@ -8,6 +8,7 @@ class Table { List<List<Cell*>> cells; public: + Table(const char* filePath); Table(unsigned rows, unsigned cols); unsigned get_cols() const; diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp index 4520d61..3fd51a7 100644 --- a/src/UserInterface/UserInterface.cpp +++ b/src/UserInterface/UserInterface.cpp @@ -9,6 +9,17 @@ Table* UserInterface::table = nullptr; void UserInterface::com_open(const char* params) { + if (table != nullptr) { + printLine("A file has already been opened!"); + return; + } + + try { + table = new Table(params); + } + catch (std::logic_error err) { + printLine(err.what()); + } } void UserInterface::com_close(const char* params) { } |
