#include <iostream>
Go to the source code of this file.
Definition at line 40 of file CsvUtil.C.
44 std::ifstream f(csvFile.c_str());
void readFromCsv |
( |
std::istream & |
f, |
|
|
Wt::WAbstractItemModel * |
model, |
|
|
int |
numRows = -1 , |
|
|
bool |
firstLineIsHeaders = true |
|
) |
| |
Definition at line 55 of file CsvUtil.C.
65 typedef boost::tokenizer<boost::escaped_list_separator<char> >
67 CsvTokenizer tok(line);
70 for (CsvTokenizer::iterator i = tok.begin();
71 i != tok.end(); ++i, ++col) {
77 if (firstLineIsHeaders && csvRow == 0)
80 int dataRow = firstLineIsHeaders ? csvRow - 1 : csvRow;
82 if (numRows != -1 && dataRow >= numRows)
90 model->
setData(dataRow, col, data);