std::string getCellDisplayText(Index const& idx) { if (!hasCell(idx)) return ""; Cell const& cell = currentDoc().cells_[idx]; if (cell.display.empty()) return getText(cell); return cell.display; }
double Csv::getFloat(u32 line, u32 cell) const { char *end; double d; string str; if(!hasCell(line, cell)) return def._float; str = linevector[line][cell]; d = strtod(str.c_str(), &end); if(static_cast<u32>(end - str.c_str()) == str.size()) return d; else return def._float; }
u32 Csv::getInteger(u32 line, u32 cell) const { char *end; int i; string str; if(!hasCell(line, cell)) return def._integer; str = linevector[line][cell]; i = strtol(str.c_str(), &end, 10); if(static_cast<u32>(end - str.c_str()) == str.size()) return i; else return def._integer; }
bool Csv::isFloat(u32 line, u32 cell) const { char *end; double d; string str; if(!hasCell(line, cell)) return false; str = linevector[line][cell]; d = strtod(str.c_str(), &end); if(static_cast<u32>(end - str.c_str()) == str.size()) return true; else return false; }
bool Csv::isInteger(u32 line, u32 cell) const { char *end; int i; string str; if(!hasCell(line, cell)) return false; str = linevector[line][cell]; i = strtol(str.c_str(), &end, 10); if(static_cast<u32>(end - str.c_str()) == str.size()) return true; else return false; }