From e27521a4dfac59efb7525228011ce9d58d7f1152 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 28 May 2022 15:58:55 +0300 Subject: Autocommit at 28.05.2022 @ 15:58 --- src/Models/CellFormula.cpp | 30 +++++++++++++----------------- src/Models/CellFormula.h | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 src/Models/CellFormula.h (limited to 'src/Models') diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index d3c3304..5ed98e8 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -1,21 +1,17 @@ -#ifndef HEADER_CELLFORMULA -#define HEADER_CELLFORMULA +#include "CellFormula.h" +#include -#include "Cell.h" -#include "../Generic/List/List.hpp" +String CellFormula::getValueForPrint() { + return String() += value; +} -class CellFormula : public Cell { - List referencedCells; - String rawFormula; - double value; +void CellFormula::parseAndSetValue(const char* str) { +} -public: - CellFormula() = default; +void CellFormula::readFromFile(std::ifstream& file) { + file >> rawFormula; +} - String getValueForPrint() override; - void parseAndSetValue(const char* str) override; - void readFromFile(std::ifstream& file) override; - void writeToFile(std::ofstream& file) override; -}; - -#endif +void CellFormula::writeToFile(std::ofstream& file) { + file << rawFormula; +} diff --git a/src/Models/CellFormula.h b/src/Models/CellFormula.h new file mode 100644 index 0000000..d3c3304 --- /dev/null +++ b/src/Models/CellFormula.h @@ -0,0 +1,21 @@ +#ifndef HEADER_CELLFORMULA +#define HEADER_CELLFORMULA + +#include "Cell.h" +#include "../Generic/List/List.hpp" + +class CellFormula : public Cell { + List referencedCells; + String rawFormula; + double value; + +public: + CellFormula() = default; + + String getValueForPrint() override; + void parseAndSetValue(const char* str) override; + void readFromFile(std::ifstream& file) override; + void writeToFile(std::ofstream& file) override; +}; + +#endif -- cgit v1.3.1-26-gb76a