ADTF  3.18.2
StreamWriterabstract

Usage: More...

Classes

class  Factory
 A simple abstract factory. More...
 

Public Member Functions

virtual int write (Value const &root, JSONCPP_OSTREAM *sout)=0
 Write Value into document as configured in sub-class. More...
 

Protected Attributes

JSONCPP_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
}
JSON (JavaScript Object Notation).
Definition: allocator.h:14

Definition at line 42 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/json/writer.h.

Member Function Documentation

◆ write()

virtual int write ( Value const &  root,
JSONCPP_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