#include <osvr/Util/CSV.h>
Public Member Functions | |
RowProxy | row () |
std::size_t | numDataRows () const |
std::size_t | numRows () const |
Protected Member Functions | |
void | prepareForRow () |
Called by CSVRowProxy life cycle, on row creation. | |
void | dataForLatestRow (std::string const &heading, std::string const &data) |
Called by CSVRowProxy life cycle, on cell addition. | |
void | finalizeLatestRow () |
DataRow & | latestRow () |
void | outputRow (std::ostream &os, DataRow const &row) const |
void | outputData (std::ostream &os) const |
Called by derived classes to output stored data rows. | |
void | moveLatestRowToData () |
utility function for use in derived finalizeLatestRow() | |
(Base) Class for easily outputting CSV files. Just call the .row() method and feed it << cell("header", yourdata) << cell("anotherheader", moredata); for as many rows as you want (one row call per row, of course).
Methods of outputting the CSV data to an ostream vary between subclasses. This is a "curiously-recurring template pattern" base class for compile-time polymorphism.
|
inline |
|
inline |
|
inline |
Gets the total number of rows that have been streamed/added to this CSV object, whether or not they're in the internal data storage. That is, numRows() >= numDataRows()
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Called by outputData() and by derived classes to format individual rows.