From d06a884302f3f771ed9b595c76b460f692d71893 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 May 2022 07:48:42 +0300 Subject: Autocommit at 29.05.2022 @ 07:48 --- src/Models/Table.h | 1 + src/UserInterface/UserInterface.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'src') 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 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 + +/* Private (static) */ + +void UserInterface::com_print(const char* params) { + List 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(); +} -- cgit v1.3.1-26-gb76a