std::string writeString(Value const& root, StreamWriter::Factory const& builder) { std::ostringstream sout; StreamWriterPtr const sw(builder.newStreamWriter(&sout)); sw->write(root); return sout.str(); }
std::ostream& operator<<(std::ostream& sout, Value const& root) { StreamWriterBuilder builder; StreamWriterPtr const writer(builder.newStreamWriter(&sout)); writer->write(root); return sout; }
std::string writeString(StreamWriter::Factory const& builder, Value const& root) { std::ostringstream sout; StreamWriterPtr const writer(builder.newStreamWriter()); writer->write(root, &sout); return sout.str(); }