Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models
diff options
context:
space:
mode:
2 files changed, 11 insertions, 0 deletions
-rw-r--r--src/Models/Table.cpp9
-rw-r--r--src/Models/Table.h2
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index 132559f..9403696 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -4,6 +4,15 @@
#include "CellString.h"
#include "CellFormula.h"
#include <cstring>
+#include <fstream>
+#include <exception>
+
+Table::Table(const char* filePath) {
+ std::ifstream inFile(filePath);
+ if (inFile.is_open())
+ throw new std::logic_error("Could now open file!");
+ cells = List<List<Cell*>>();
+}
Table::Table(unsigned rows, unsigned cols) {
if (rows == 0 || cols == 0)
diff --git a/src/Models/Table.h b/src/Models/Table.h
index 6da817c..e15ee37 100644
--- a/src/Models/Table.h
+++ b/src/Models/Table.h
@@ -3,9 +3,11 @@
#include "Cell.h"
#include "../Generic/List/List.hpp"
+#include <fstream>
class Table {
List<List<Cell*>> cells;
+ void readFromFile(std::ifstream);
public:
Table(const char* filePath);