Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
Commit9e7af3dd34b747c44aeb2b29fcef7531dc83b17b (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-28 18:24:25 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-28 18:24:25 +0300
Files652d5f0991f8d4ffe9324dd15db85c9f1f7022f2 /src/Models/Table.cpp
FMI-OOP-P2_Tables-9e7af3dd34b747c44aeb2b29fcef7531dc83b17b.tar
FMI-OOP-P2_Tables-9e7af3dd34b747c44aeb2b29fcef7531dc83b17b.tar.gz
FMI-OOP-P2_Tables-9e7af3dd34b747c44aeb2b29fcef7531dc83b17b.zip
Parent1f5f431447ef530b2b7e5e3140fcafe9379f09cb (diff)
Autocommit at 28.05.2022 @ 18:24
1 files changed, 10 insertions, 1 deletions
-rw-r--r--src/Models/Table.cpp11
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index 602b424..bcaffb7 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -11,11 +11,20 @@ Table::Table(unsigned rows, unsigned cols) {
cells[i] = List<Cell*>(cols);
}
+
+bool containsNumber(const char*& str) {
+ while (*str == ' ') str++;
+ return ((*str == '+' || *str == '-') && (*(str + 1) >= '0' && *(str + 1) <= '9')) ||
+ (*str >= '0' && *str <= '9');
+}
+
void Table::putCell(unsigned row, unsigned col, const char* rawValue) {
unsigned intParse = atoi(rawValue);
unsigned doubleParse = atof(rawValue);
Cell* newCell;
- if (doubleParse - intParse > 0.00001)
+ if (doubleParse - intParse > 0.00001 && doublePrase > 0.00001)
newCell = new CellDouble(doubleParse);
+ else if (intParse )
+ newCell =
}