Wt examples  3.3.0
Functions
/home/koen/project/wt/public-git/wt/examples/treeview-dragdrop/CsvUtil.C File Reference
#include <fstream>
#include <boost/tokenizer.hpp>
#include <boost/lexical_cast.hpp>
#include <Wt/WAbstractItemModel>
#include <Wt/WStandardItemModel>
#include <Wt/WString>
#include "CsvUtil.h"

Go to the source code of this file.

Functions

Wt::WStandardItemModelcsvToModel (const std::string &csvFile, Wt::WObject *parent)
void readFromCsv (std::istream &f, Wt::WAbstractItemModel *model, int numRows, bool firstLineIsHeaders)
 Utility function that reads a model from a CSV file.

Function Documentation

Wt::WStandardItemModel* csvToModel ( const std::string &  csvFile,
Wt::WObject parent 
)

Definition at line 12 of file CsvUtil.C.

{
  std::ifstream f(csvFile.c_str());

  if (f) {
    Wt::WStandardItemModel *result = new Wt::WStandardItemModel(0, 0, parent);
    readFromCsv(f, result);
    return result;
  } else
    return 0;
}

Generated on Mon Apr 8 2013 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1