diff options
| Commit | d06a884302f3f771ed9b595c76b460f692d71893 (patch) | |
|---|---|---|
| Author | 2022-05-29 07:48:42 +0300 | |
| Committer | 2022-05-29 07:48:42 +0300 | |
| Files | 38993ef01b5e91a676ecb4796efab8f664ecde35 /src | |
| FMI-OOP-P2_Tables-d06a884302f3f771ed9b595c76b460f692d71893.tar FMI-OOP-P2_Tables-d06a884302f3f771ed9b595c76b460f692d71893.tar.gz FMI-OOP-P2_Tables-d06a884302f3f771ed9b595c76b460f692d71893.zip | ||
| Parent | b76f0b2c39895e3f037e1ff1e1a9c17d84e93c2d (diff) | |
Autocommit at 29.05.2022 @ 07:48
2 files changed, 19 insertions, 0 deletions
| -rw-r--r-- | src/Models/Table.h | 1 | ||||
| -rw-r--r-- | src/UserInterface/UserInterface.cpp | 18 |
diff --git a/src/Models/Table.h b/src/Models/Table.h index 6fb516a..136cd92 100644 --- a/src/Models/Table.h +++ b/src/Models/Table.h @@ -9,6 +9,7 @@ class Table { public: Table(unsigned rows, unsigned cols); + unsigned getCellCount(); void putCell(unsigned row, unsigned col, const char* rawValue); List<String> getAllCells() const; diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp index 9b8e727..f9d7d87 100644 --- a/src/UserInterface/UserInterface.cpp +++ b/src/UserInterface/UserInterface.cpp @@ -1,7 +1,25 @@ #include "UserInterface.h" +#include "../Generic/List/List.hpp" +#include "../Generic/String/String.h" +#include <stdexcept> + +/* Private (static) */ + +void UserInterface::com_print(const char* params) { + List<String> cells = this->table.getAllCells(); +} + +/* Public */ UserInterface::UserInterface(Table& table) : menu() { + if (this->table.getCellCount() > 0) + throw new std::logic_error("Singleton instance!"); + this->table = table; menu.addCommand(Command("print", com_print)); menu.addCommand(Command("edit", com_edit)); } + +void UserInterface::run() { + menu.navigate(); +} |
