xrpld
Loading...
Searching...
No Matches
json::FastWriter Class Reference

Outputs a Value in JSON format without formatting (not human friendly). More...

#include <json_writer.h>

Inheritance diagram for json::FastWriter:
Collaboration diagram for json::FastWriter:

Public Member Functions

 FastWriter ()=default
 ~FastWriter () override=default
std::string write (Value const &root) override

Private Member Functions

void writeValue (Value const &value)

Private Attributes

std::string document_

Detailed Description

Outputs a Value in JSON format without formatting (not human friendly).

The JSON document is written in a single line. It is not intended for 'human' consumption, but may be useful to support feature such as RPC where bandwidth is limited.

See also
Reader, Value

Definition at line 31 of file json_writer.h.

Constructor & Destructor Documentation

◆ FastWriter()

json::FastWriter::FastWriter ( )
default

◆ ~FastWriter()

json::FastWriter::~FastWriter ( )
overridedefault

Member Function Documentation

◆ write()

std::string json::FastWriter::write ( Value const & root)
overridevirtual

Implements json::WriterBase.

Definition at line 179 of file json_writer.cpp.

◆ writeValue()

void json::FastWriter::writeValue ( Value const & value)
private

Definition at line 187 of file json_writer.cpp.

Member Data Documentation

◆ document_

std::string json::FastWriter::document_
private

Definition at line 45 of file json_writer.h.