OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::util::StreamCSV Class Reference

#include <osvr/Util/CSV.h>

Inheritance diagram for osvr::util::StreamCSV:
osvr::util::CSVBase< StreamCSV > osvr::util::detail::CSVCommonBase

Public Member Functions

 StreamCSV (std::ostream &os)
 
void startOutput ()
 
- Public Member Functions inherited from osvr::util::CSVBase< StreamCSV >
RowProxy row ()
 
std::size_t numDataRows () const
 
std::size_t numRows () const
 

Additional Inherited Members

- Protected Member Functions inherited from osvr::util::CSVBase< StreamCSV >
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()
 

Detailed Description

A CSV object taking a reference to an ostream that should remain valid throughout the entire lifetime of this object.

Once you start output, it will output the headers and any existing rows, and from then on, it will will output each row as it is finalized. Of course, any additional headers acquired after you start streaming can't be added to the first row retroactively, but they will be consistent (leaving blanks if appropriate, etc.)

Definition at line 358 of file CSV.h.

Constructor & Destructor Documentation

osvr::util::StreamCSV::StreamCSV ( std::ostream &  os)
inlineexplicit

Constructor

Parameters
osReference to the desired output stream, which must remain valid for the lifetime of this object.

Definition at line 366 of file CSV.h.

Member Function Documentation

void osvr::util::StreamCSV::startOutput ( )
inline

Outputs all the stored rows and columns, with the union of all headers in the first row, quoted, to the std::ostream given at construction, and starts streaming any additional rows.

Definition at line 371 of file CSV.h.


The documentation for this class was generated from the following file: