cxxtools::CsvOObject< ObjectType > Class Template Reference

Wrapper object to easily print serializable objects as csv to a output stream. More...

#include <cxxtools/csv.h>

Inheritance diagram for cxxtools::CsvOObject< ObjectType >:
cxxtools::CsvIOObject< ObjectType >

Public Member Functions

 CsvOObject (const ObjectType &object)
 Constructor. Needs the wrapped object.
CsvOObjectdelimiter (Char delimiter)
CsvOObjectquote (Char quote)
CsvOObjectlineEnding (const String &lineEnding)
Char delimiter () const
Char quote () const
const StringlineEnding () const
const ObjectType & object () const

Detailed Description

template<typename ObjectType>
class cxxtools::CsvOObject< ObjectType >

Wrapper object to easily print serializable objects as csv to a output stream.

CsvOObject is a little wrapper which makes it easy to output serializable objects into s ostream. For this the CsvOObject expects a reference to the wrapped object and has a output operator for a std::ostream, or actually a std::basic_ostream, which prints the object in json format.

Example:

std::vector<std::vector<int> > v(2);
v[0].push_back(4);
v[0].push_back(17);
v[0].push_back(12);
v[1].push_back(45);
v[1].push_back(-3);
v[1].push_back(76);
std::cout << cxxtools::Csv(v) << std::endl;

Constructor & Destructor Documentation

template<typename ObjectType >
cxxtools::CsvOObject< ObjectType >::CsvOObject ( const ObjectType &  object)
inlineexplicit

Constructor. Needs the wrapped object.

Member Function Documentation

template<typename ObjectType >
CsvOObject& cxxtools::CsvOObject< ObjectType >::delimiter ( Char  delimiter)
inline
template<typename ObjectType >
Char cxxtools::CsvOObject< ObjectType >::delimiter ( ) const
inline
template<typename ObjectType >
CsvOObject& cxxtools::CsvOObject< ObjectType >::lineEnding ( const String lineEnding)
inline
template<typename ObjectType >
const String& cxxtools::CsvOObject< ObjectType >::lineEnding ( ) const
inline
template<typename ObjectType >
const ObjectType& cxxtools::CsvOObject< ObjectType >::object ( ) const
inline
template<typename ObjectType >
CsvOObject& cxxtools::CsvOObject< ObjectType >::quote ( Char  quote)
inline
template<typename ObjectType >
Char cxxtools::CsvOObject< ObjectType >::quote ( ) const
inline

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