OpenWalnut
1.5.0dev
|
Read content from a CSV file. More...
#include <WReaderCSV.h>
Public Member Functions | |
WReaderCSV (std::string fname) | |
Constructs a CSV reader object. More... | |
virtual | ~WReaderCSV () throw () |
Destroys this instance. More... | |
virtual std::shared_ptr< WDataSetCSV > | read () |
Read the file and create a dataset as a vector. More... | |
Private Member Functions | |
std::vector< std::string > | transformLineToVector (std::string line) |
Transforms a given string into a string vector, by a predefined delimiter. More... | |
Private Member Functions inherited from WReader | |
WReader (std::string fname) | |
Creates a read object for file reading. More... | |
OW_API_DEPRECATED void | setFileName (std::string fname) |
Reset the file name and checks if it exists. More... | |
void | setFilename (std::string fname) |
Reset the file name and checks if it exists. More... | |
Friends | |
class | WReaderCSVTest |
Only WReaderCSVTest class may be friend. More... | |
Additional Inherited Members | |
Private Attributes inherited from WReader | |
std::string | m_fname |
Absolute path of the file to read from. More... | |
Read content from a CSV file.
Definition at line 42 of file WReaderCSV.h.
|
explicit |
Constructs a CSV reader object.
fname | path of the file to load. |
Definition at line 32 of file WReaderCSV.cpp.
|
virtual |
Destroys this instance.
Definition at line 37 of file WReaderCSV.cpp.
|
virtual |
Read the file and create a dataset as a vector.
WException | If the file could not be opened. |
Definition at line 74 of file WReaderCSV.cpp.
References WReader::m_fname, and transformLineToVector().
Referenced by WCsvConverterTest::setUp(), WReaderCSVTest::testCRLFLineEnding(), WReaderCSVTest::testCRLineEnding(), WReaderCSVTest::testEmptyColumns(), WReaderCSVTest::testLFLineEnding(), and WReaderCSVTest::testValidCSV().
|
private |
Transforms a given string into a string vector, by a predefined delimiter.
line | The line, which shell be split into a string vector |
Definition at line 135 of file WReaderCSV.cpp.
Referenced by read().
|
friend |
Only WReaderCSVTest class may be friend.
Definition at line 47 of file WReaderCSV.h.