diff options
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(); +} |
