|
WSF
|
Classes | |
| class | Parser |
| Tokenizes a .csv text stream. More... | |
Typedefs | |
| typedef std::vector< std::string > | StringList |
Enumerations | |
| enum | ParseResult { cCSV_FIELD , cCSV_NEW_ROW , cCSV_EOF , cCSV_ERROR } |
Functions | |
| WSF_UT_EXPORT void | Escape (std::string &aText) |
| WSF_UT_EXPORT std::vector< StringList > | ToStrings (std::istream &aCsvStream) |
| Parse a CSV text stream into an array of array of strings representing the rows of cells. | |
| WSF_UT_EXPORT std::string | FromStrings (const std::vector< StringList > &aRows) |
| Create CSV text given an array of array of strings. | |
| WSF_UT_EXPORT std::string | RowFromStrings (const StringList &aRows) |
| typedef std::vector<std::string> UtCsv::StringList |
| enum UtCsv::ParseResult |
| void UtCsv::Escape | ( | std::string & | aText | ) |
Escape some text so that it can be written to a CSV field If the text contains a comma, quote, or newline, the string is quoted.
Referenced by FromStrings(), and RowFromStrings().
| std::string UtCsv::FromStrings | ( | const std::vector< StringList > & | aRows | ) |
Create CSV text given an array of array of strings.
References Escape().
| std::string UtCsv::RowFromStrings | ( | const StringList & | strings | ) |
Given a list of strings a row's field values, return a single string with conformant .csv row text Note: the field values should not be escaped yet, or they could receive additional quotes
References Escape().
| std::vector< UtCsv::StringList > UtCsv::ToStrings | ( | std::istream & | aCsvStream | ) |
Parse a CSV text stream into an array of array of strings representing the rows of cells.
References cCSV_EOF, cCSV_ERROR, cCSV_FIELD, cCSV_NEW_ROW, and UtCsv::Parser::ReadToken().