rippled
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
Json::Compact Class Reference

Decorator for streaming out compact json. More...

#include <json_writer.h>

Collaboration diagram for Json::Compact:
Collaboration graph
[legend]

Public Member Functions

 Compact (Json::Value &&jv)
 Wrap a Json::Value for compact streaming.
 

Private Attributes

Json::Value jv_
 

Friends

std::ostreamoperator<< (std::ostream &o, Compact const &cJv)
 

Detailed Description

Decorator for streaming out compact json.

Use

Json::Value jv;
out << Json::Compact{jv}

to write a single-line, compact version of jv to the stream, rather than the styled format that comes from undecorated streaming.

Definition at line 298 of file json_writer.h.

Constructor & Destructor Documentation

◆ Compact()

Json::Compact::Compact ( Json::Value &&  jv)

Wrap a Json::Value for compact streaming.

Parameters
jvThe Json::Value to stream
Note
For now, we do not support wrapping lvalues to avoid potentially costly copies. If we find a need, we can consider adding support for compact lvalue streaming in the future.

Definition at line 311 of file json_writer.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream o,
Compact const &  cJv 
)
friend

Definition at line 315 of file json_writer.h.

Member Data Documentation

◆ jv_

Json::Value Json::Compact::jv_
private

Definition at line 300 of file json_writer.h.