blob: 602b42496541a602e9cc6d908f2ac1044ed7ad6f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "Table.h"
#include "CellDouble.h"
#include "CellInt.h"
#include "CellString.h"
#include "CellFormula.h"
#include <cstring>
Table::Table(unsigned rows, unsigned cols) {
cells = List<List<Cell*>>(rows);
for (unsigned i = 0; i < rows; i++)
cells[i] = List<Cell*>(cols);
}
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)
newCell = new CellDouble(doubleParse);
}
|