Ejemplo n.º 1
0
  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;
  }
Ejemplo n.º 2
0
  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;
  }
Ejemplo n.º 3
0
  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;
  }
Ejemplo n.º 4
0
  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;
  }
Ejemplo n.º 5
0
  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;
  }