28 mSeparator(separator),
30 mValue(std::numeric_limits<
C_FLOAT64>::quiet_NaN()),
36 mSeparator(src.mSeparator),
39 mIsValue(src.mIsValue),
40 mIsEmpty(src.mIsEmpty)
63 static char buffer[256];
73 while (strlen(buffer) == 255 && !is.eof());
76 std::string::size_type begin = cell.
mName.find_first_not_of(
"\x20\x09\x0d\x0a");
78 if (begin == std::string::npos)
82 cell.
mValue = std::numeric_limits<C_FLOAT64>::quiet_NaN();
88 std::string::size_type end = cell.
mName.find_last_not_of(
"\x20\x09\x0d\x0a");
90 if (end == std::string::npos)
93 cell.
mName = cell.
mName.substr(begin, end - begin + 1);
98 const char * Tail = NULL;
101 if (Tail != NULL && *Tail == 0x0)
105 else if (cell.
mName ==
"INF")
108 cell.
mValue = std::numeric_limits<C_FLOAT64>::infinity();
110 else if (cell.
mName ==
"-INF")
113 cell.
mValue = - std::numeric_limits<C_FLOAT64>::infinity();
118 cell.
mValue = std::numeric_limits<C_FLOAT64>::quiet_NaN();
125 const char & separator):
127 mSeparator(separator),
134 mSeparator(src.mSeparator),
135 mIsEmpty(src.mIsEmpty),
148 std::vector< CTableCell >::iterator it =
mCells.begin();
149 std::vector< CTableCell >::iterator end =
mCells.end();
151 for (; it != end; ++it)
166 std::istream::pos_type pos;
168 if (rewind) pos = is.tellg();
172 if (rewind) is.seekg(pos);
187 std::stringstream line;
191 for (is.get(c); c != 0x0a && c != 0x0d; is.get(c))
193 if (is.fail() || is.eof())
break;
199 if ((c == 0x0d && is.peek() == 0x0a) ||
200 (c == 0x0a && is.peek() == 0x0d))
206 std::vector< CTableCell >::iterator it =
mCells.begin();
207 std::vector< CTableCell >::iterator end =
mCells.end();
209 unsigned C_INT count;
211 for (count = 0; it != end && !line.fail(); ++it, ++count)
222 bool Finished =
false;
229 while (!line.fail() && !line.eof())
234 if (!
mCells.back().isEmpty())
246 for (; it != end; ++it)
CTableCell(const char &separator= '\t')
const bool & isEmpty() const
CTableRow(const size_t &size=0, const char &separator= '\t')
const std::string & getName() const
const std::vector< CTableCell > & getCells() const
const size_t & getLastFilledCell() const
std::istream & readLine(std::istream &is)
const C_FLOAT64 & getValue() const
std::istream & operator>>(std::istream &is, CTableCell &cell)
std::vector< CTableCell > mCells
const char & getSeparator() const
const bool & isEmpty() const
double strToDouble(const char *str, char const **pTail)
size_t guessColumnNumber(std::istream &is, const bool &rewind)
bool setSeparator(const char &separator)
bool resize(const size_t &size)
const bool & isValue() const