Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models
diff options
context:
space:
mode:
Commitd27d9f27df792e2afa5fc16cd43d0efd919e0367 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 15:33:49 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 15:33:49 +0300
Files6385cb0327d0b96aa7587496e6ed04f01c4243ce /src/Models
FMI-OOP-P2_Tables-d27d9f27df792e2afa5fc16cd43d0efd919e0367.tar
FMI-OOP-P2_Tables-d27d9f27df792e2afa5fc16cd43d0efd919e0367.tar.gz
FMI-OOP-P2_Tables-d27d9f27df792e2afa5fc16cd43d0efd919e0367.zip
Parentbc6a38c81c440780b2ae4823b24172f3e41f12eb (diff)
Autocommit at 28.05.2022 @ 15:33
3 files changed, 18 insertions, 1 deletions
-rw-r--r--src/Models/Cell.h5
-rw-r--r--src/Models/CellString.cpp9
-rw-r--r--src/Models/CellString.h5
diff --git a/src/Models/Cell.h b/src/Models/Cell.h
index 2c614de..4bf26bd 100644
--- a/src/Models/Cell.h
+++ b/src/Models/Cell.h
@@ -1,14 +1,17 @@
#ifndef HEADER_CELL
#define HEADER_CELL
+#include <fstream>
#include "../Generic/String/String.h"
class Cell {
public:
virtual String getValueForPrint() = 0;
virtual void parseAndSetValue(const char* str) = 0;
- virtual void readFromFile(const char* filePath) = 0;
+ virtual void readFromFile(std::ifstream& filePath) = 0;
virtual void saveToFile(const char* filePath) = 0;
+
+ virtual ~Cell() = default;
};
#endif
diff --git a/src/Models/CellString.cpp b/src/Models/CellString.cpp
new file mode 100644
index 0000000..82f7b29
--- /dev/null
+++ b/src/Models/CellString.cpp
@@ -0,0 +1,9 @@
+#include "CellString.h"
+
+String CellString::getValueForPrint() {
+ return value;
+}
+
+void CellString::parseAndSetValue(const char* str) {
+ value = String(str);
+}
diff --git a/src/Models/CellString.h b/src/Models/CellString.h
index 0a34c76..1f311da 100644
--- a/src/Models/CellString.h
+++ b/src/Models/CellString.h
@@ -7,7 +7,12 @@ class CellString : public Cell {
String value;
public:
+ CellString() = default;
+
String getValueForPrint() override;
+ void parseAndSetValue(const char* str) override;
+ void readFromFile(const char* filePath) override;
+ void saveToFile(const char* filePath) override;
};
#endif