From c5431e4d321dbf0152e6826841c1ef5c1291ba5b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 14 Jun 2022 15:38:50 +0300 Subject: Added files from project 2 (mirror) --- .../Project 2/docs/html/classCellFormula.html | 254 +++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 Year 1/Object-oriented Programming/Project 2/docs/html/classCellFormula.html (limited to 'Year 1/Object-oriented Programming/Project 2/docs/html/classCellFormula.html') diff --git a/Year 1/Object-oriented Programming/Project 2/docs/html/classCellFormula.html b/Year 1/Object-oriented Programming/Project 2/docs/html/classCellFormula.html new file mode 100644 index 0000000..2fed2ce --- /dev/null +++ b/Year 1/Object-oriented Programming/Project 2/docs/html/classCellFormula.html @@ -0,0 +1,254 @@ + + + + + + + +FMI Table: CellFormula Class Reference + + + + + + + + + +
+
+ + + + + + +
+
FMI Table +
+
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |
+
+
+ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
CellFormula Class Reference
+
+
+ +

A table cell which contains a formula. + More...

+ +

#include <CellFormula.h>

+
+Inheritance diagram for CellFormula:
+
+
+ + +Cell + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+ CellFormula (const char *str, const List< List< Cell * > > *tableCells)
 
double getNumeralValue () const override
 
String getValueForPrint () const override
 
void parseAndSetValue (const char *str) override
 
void writeToFile (std::ofstream &file) override
 Writes value to a text file. More...
 
virtual double getNumeralValue () const =0
 Returns the value of the cell as a double-precision floating point number. More...
 
virtual String getValueForPrint () const =0
 Returns the value of the cell as a String. More...
 
virtual void parseAndSetValue (const char *str)=0
 Parses given C-style string and stores value. More...
 
virtual void writeToFile (std::ofstream &file)=0
 Writes value to a text file. More...
 
+

Detailed Description

+

A table cell which contains a formula.

+

Implements the Cell class by storing a formula as a String and in a dynamic List

+

Member Function Documentation

+ +

◆ getNumeralValue()

+ +
+
+ + + + + +
+ + + + + + + +
double CellFormula::getNumeralValue () const
+
+overridevirtual
+
+

Value is recalculated every time this function is called (in case a referenced cell is changed).

+
Returns
0
+ +

Implements Cell.

+ +
+
+ +

◆ getValueForPrint()

+ +
+
+ + + + + +
+ + + + + + + +
String CellFormula::getValueForPrint () const
+
+overridevirtual
+
+

Value is recalculated every time this function is called (in case a referenced cell is changed).

+
Returns
"Error"
+ +

Implements Cell.

+ +
+
+ +

◆ parseAndSetValue()

+ +
+
+ + + + + +
+ + + + + + + + +
void CellFormula::parseAndSetValue (const char * str)
+
+overridevirtual
+
+

Each math operation is represented with a Pair that holds indecies of cell reference and a character for the operation.

+

Negatve value for the operation character means it's with priority and the result get's calculated immediately (rather than recursively, taking into account other values).

+
Exceptions
+ + +
std::logic_error("ErrorInvalid column character!") Thrown when there is something between Rx and C in cell references +\exception std::logic_error("Error: Invalid value!") Thrown when met value isn't a cell reference or number +\exception throw std::logic_error("Error: Could not find operand!") Thrown when there isn't an operator character between two values
+
+
+ +

Implements Cell.

+ +
+
+ +

◆ writeToFile()

+ +
+
+ + + + + +
+ + + + + + + + +
void CellFormula::writeToFile (std::ofstream & file)
+
+overridevirtual
+
+ +

Writes value to a text file.

+ +

Implements Cell.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + -- cgit v1.3.1-23-gd82d