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 }
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_ |
Classes | |
class | Factory |
StreamWriter | ( | ) |
~StreamWriter | ( | ) | [virtual] |
virtual int 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* sout_ [protected] |