Inheritance diagram for CSVReader:Public Member Functions | |
| CSVReader (const bool firstLineContainsHeaders, const std::string &delimiters=",;\t", const std::string &escapeCharacters="\\", const std::string "eCharacters="\"", const char eolMarker='\n') | |
| void | setStream (std::istream *stream) |
| const std::vector< std::string > & | fields () const |
| const bool | hasField (const std::string &field) const |
| Size | numberOfColumns () const |
| bool | next () |
| Size | currentLine () const |
| std::string | get (const std::string &field) const |
| std::string | get (const Size column) const |
| virtual void | close () |
| CSVReader | ( | const bool | firstLineContainsHeaders, |
| const std::string & | delimiters = ",;\t", |
||
| const std::string & | escapeCharacters = "\\", |
||
| const std::string & | quoteCharacters = "\"", |
||
| const char | eolMarker = '\n' |
||
| ) |
Ctor
| void setStream | ( | std::istream * | stream | ) |
Set stream for function
| const std::vector<std::string>& fields | ( | ) | const |
Returns the fields, if a header line is present, otherwise throws
| const bool hasField | ( | const std::string & | field | ) | const |
Return true if a field is present
| Size numberOfColumns | ( | ) | const |
Returns the number of columns
| bool next | ( | ) |
Go to next line in file, returns false if there are no more lines
| Size currentLine | ( | ) | const |
Number of the current data line
| std::string get | ( | const std::string & | field | ) | const |
Get content of field in current data line, throws if field is not present
| std::string get | ( | const Size | column | ) | const |
Get content of column in current data line, throws if column is out of range
|
virtual |
Close the file
Reimplemented in CSVFileReader.