Classes | Public Member Functions | Protected Attributes | List of all members
Json::StreamWriter Class Referenceabstract

#include <json.h>

Inheritance diagram for Json::StreamWriter:
Inheritance graph
[legend]

Classes

class  Factory
 A simple abstract factory. More...
 

Public Member Functions

 StreamWriter ()
 
virtual int write (Value const &root, std::ostream *sout)=0
 
virtual ~StreamWriter ()
 

Protected Attributes

std::ostream * sout_
 

Detailed Description

Usage:

using namespace Json;
void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
std::unique_ptr<StreamWriter> const writer(
factory.newStreamWriter());
writer->write(value, &std::cout);
std::cout << std::endl; // add lf and flush
}

Definition at line 1652 of file json.h.

Constructor & Destructor Documentation

Json::StreamWriter::StreamWriter ( )

Definition at line 5015 of file jsoncpp.cpp.

Json::StreamWriter::~StreamWriter ( )
virtual

Definition at line 5019 of file jsoncpp.cpp.

Member Function Documentation

virtual int Json::StreamWriter::write ( Value const &  root,
std::ostream *  sout 
)
pure virtual

Write Value into document as configured in sub-class. Do not take ownership of sout, but maintain a reference during function.

Precondition
sout != NULL
Returns
zero on success (For now, we always return zero, so check the stream instead.)
Exceptions
std::exceptionpossibly, depending on configuration

Implemented in Json::BuiltStyledStreamWriter.

Member Data Documentation

std::ostream* Json::StreamWriter::sout_
protected

Definition at line 1654 of file json.h.


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


mission_planning
Author(s): ivan
autogenerated on Thu Nov 12 2015 19:08:20