Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models
diff options
context:
space:
mode:
Commit6a42c2a37829f14e312b38f8e254dc7279d5f3cc (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 16:49:13 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 16:49:13 +0300
Filesdbeaa6de5a6cc095a036b4a61fef602a8334132f /src/Models
FMI-OOP-P2_Tables-6a42c2a37829f14e312b38f8e254dc7279d5f3cc.tar
FMI-OOP-P2_Tables-6a42c2a37829f14e312b38f8e254dc7279d5f3cc.tar.gz
FMI-OOP-P2_Tables-6a42c2a37829f14e312b38f8e254dc7279d5f3cc.zip
Parentf5cfef9dc1c0cc505d48c609a1c0511cd7ed166b (diff)
Autocommit at 28.05.2022 @ 16:49
3 files changed, 12 insertions, 9 deletions
-rw-r--r--src/Models/CellDouble.cpp8
-rw-r--r--src/Models/Table.cpp5
-rw-r--r--src/Models/Table.h8
diff --git a/src/Models/CellDouble.cpp b/src/Models/CellDouble.cpp
index a823419..27713f5 100644
--- a/src/Models/CellDouble.cpp
+++ b/src/Models/CellDouble.cpp
@@ -1,14 +1,6 @@
#include "CellDouble.h"
#include <cstring>
-CellDouble::CellDouble(int val) {
- value = val;
-}
-
-CellDouble::CellDouble(const String& str) {
- value = atof(str.get_cstr());
-}
-
double CellDouble::getNumeralValue() {
return value;
}
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
new file mode 100644
index 0000000..1d98f5b
--- /dev/null
+++ b/src/Models/Table.cpp
@@ -0,0 +1,5 @@
+#include "Table.h"
+
+Table::Table(unsigned rows, unsigned cols) {
+ cells = List<List<Cell>>(rows);
+}
diff --git a/src/Models/Table.h b/src/Models/Table.h
index d53ecbb..5ed5dd9 100644
--- a/src/Models/Table.h
+++ b/src/Models/Table.h
@@ -5,8 +5,14 @@
#include "../Generic/List/List.hpp"
class Table {
- List<List<Cell>> cells;
+ Cell** cells;
List<List<Cell>> constantsCells;
+
+public:
+ Table(unsigned rows, unsigned cols);
+
+ void putCell(unsigned row, unsigned col, const char* rawValue);
+ String getAllCells();
};
#endif