JsonCpp project page | JsonCpp home page |
Usage: More...
#include <json/writer.h>
Inherited by Json::BuiltStyledStreamWriter.
Classes | |
class | Factory |
A simple abstract factory. More... | |
Public Member Functions | |
StreamWriter () | |
virtual | ~StreamWriter () |
virtual int | write (Value const &root, std::ostream *sout)=0 |
Write Value into document as configured in sub-class. | |
Protected Attributes | |
std::ostream * | sout_ |
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 40 of file writer.h.
Json::StreamWriter::StreamWriter | ( | ) |
Definition at line 1066 of file json_writer.cpp.
Json::StreamWriter::~StreamWriter | ( | ) | [virtual] |
Definition at line 1070 of file json_writer.cpp.
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.
std::exception | possibly, depending on configuration |
std::ostream* Json::StreamWriter::sout_ [protected] |