Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Json::StyledWriter Class Reference

Writes a Value in JSON format in a human friendly way. More...

#include <json.h>

Inheritance diagram for Json::StyledWriter:
Inheritance graph
[legend]

Public Member Functions

 StyledWriter ()
 
 StyledWriter ()
 
std::string write (const Value &root) override
 Serialize a Value in JSON format. More...
 
std::string write (const Value &root) override
 Serialize a Value in JSON format. More...
 
 ~StyledWriter () override
 
 ~StyledWriter () override
 
- Public Member Functions inherited from Json::Writer
virtual ~Writer ()
 
virtual ~Writer ()
 

Private Types

typedef std::vector< std::string > ChildValues
 
typedef std::vector< std::string > ChildValues
 

Private Member Functions

bool hasCommentForValue (const Value &value)
 
bool hasCommentForValue (const Value &value)
 
void indent ()
 
void indent ()
 
bool isMultineArray (const Value &value)
 
bool isMultineArray (const Value &value)
 
void pushValue (const std::string &value)
 
void pushValue (const std::string &value)
 
void unindent ()
 
void unindent ()
 
void writeArrayValue (const Value &value)
 
void writeArrayValue (const Value &value)
 
void writeCommentAfterValueOnSameLine (const Value &root)
 
void writeCommentAfterValueOnSameLine (const Value &root)
 
void writeCommentBeforeValue (const Value &root)
 
void writeCommentBeforeValue (const Value &root)
 
void writeIndent ()
 
void writeIndent ()
 
void writeValue (const Value &value)
 
void writeValue (const Value &value)
 
void writeWithIndent (const std::string &value)
 
void writeWithIndent (const std::string &value)
 

Static Private Member Functions

static std::string normalizeEOL (const std::string &text)
 
static std::string normalizeEOL (const std::string &text)
 

Private Attributes

bool addChildValues_
 
ChildValues childValues_
 
std::string document_
 
int indentSize_
 
std::string indentString_
 
int rightMargin_
 

Detailed Description

Writes a Value in JSON format in a human friendly way.

The rules for line break and indent are as follow:

If the Value have comments then they are outputed according to their CommentPlacement.

See also
Reader, Value, Value::setComment()
Deprecated:
Use StreamWriterBuilder.

The rules for line break and indent are as follow:

If the Value have comments then they are outputted according to their CommentPlacement.

See also
Reader, Value, Value::setComment()
Deprecated:
Use StreamWriterBuilder.

Definition at line 1876 of file third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h.

Member Typedef Documentation

◆ ChildValues [1/2]

typedef std::vector<std::string> Json::StyledWriter::ChildValues
private

◆ ChildValues [2/2]

typedef std::vector<std::string> Json::StyledWriter::ChildValues
private

Constructor & Destructor Documentation

◆ StyledWriter() [1/2]

Json::StyledWriter::StyledWriter ( )

◆ ~StyledWriter() [1/2]

Json::StyledWriter::~StyledWriter ( )
inlineoverride

◆ StyledWriter() [2/2]

Json::StyledWriter::StyledWriter ( )

◆ ~StyledWriter() [2/2]

Json::StyledWriter::~StyledWriter ( )
inlineoverride

Member Function Documentation

◆ hasCommentForValue() [1/2]

bool Json::StyledWriter::hasCommentForValue ( const Value value)
private

◆ hasCommentForValue() [2/2]

bool Json::StyledWriter::hasCommentForValue ( const Value value)
private

◆ indent() [1/2]

void Json::StyledWriter::indent ( )
private

◆ indent() [2/2]

void Json::StyledWriter::indent ( )
private

◆ isMultineArray() [1/2]

bool Json::StyledWriter::isMultineArray ( const Value value)
private

◆ isMultineArray() [2/2]

bool Json::StyledWriter::isMultineArray ( const Value value)
private

◆ normalizeEOL() [1/2]

static std::string Json::StyledWriter::normalizeEOL ( const std::string &  text)
staticprivate

◆ normalizeEOL() [2/2]

static std::string Json::StyledWriter::normalizeEOL ( const std::string &  text)
staticprivate

◆ pushValue() [1/2]

void Json::StyledWriter::pushValue ( const std::string &  value)
private

◆ pushValue() [2/2]

void Json::StyledWriter::pushValue ( const std::string &  value)
private

◆ unindent() [1/2]

void Json::StyledWriter::unindent ( )
private

◆ unindent() [2/2]

void Json::StyledWriter::unindent ( )
private

◆ write() [1/2]

std::string Json::StyledWriter::write ( const Value root)
overridevirtual

Serialize a Value in JSON format.

Parameters
rootValue to serialize.
Returns
String containing the JSON document that represents the root value.

Implements Json::Writer.

Definition at line 4364 of file bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp.

◆ write() [2/2]

std::string Json::StyledWriter::write ( const Value root)
overridevirtual

Serialize a Value in JSON format.

Parameters
rootValue to serialize.
Returns
String containing the JSON document that represents the root value.

Implements Json::Writer.

◆ writeArrayValue() [1/2]

void Json::StyledWriter::writeArrayValue ( const Value value)
private

◆ writeArrayValue() [2/2]

void Json::StyledWriter::writeArrayValue ( const Value value)
private

◆ writeCommentAfterValueOnSameLine() [1/2]

void Json::StyledWriter::writeCommentAfterValueOnSameLine ( const Value root)
private

◆ writeCommentAfterValueOnSameLine() [2/2]

void Json::StyledWriter::writeCommentAfterValueOnSameLine ( const Value root)
private

◆ writeCommentBeforeValue() [1/2]

void Json::StyledWriter::writeCommentBeforeValue ( const Value root)
private

◆ writeCommentBeforeValue() [2/2]

void Json::StyledWriter::writeCommentBeforeValue ( const Value root)
private

◆ writeIndent() [1/2]

void Json::StyledWriter::writeIndent ( )
private

◆ writeIndent() [2/2]

void Json::StyledWriter::writeIndent ( )
private

◆ writeValue() [1/2]

void Json::StyledWriter::writeValue ( const Value value)
private

◆ writeValue() [2/2]

void Json::StyledWriter::writeValue ( const Value value)
private

◆ writeWithIndent() [1/2]

void Json::StyledWriter::writeWithIndent ( const std::string &  value)
private

◆ writeWithIndent() [2/2]

void Json::StyledWriter::writeWithIndent ( const std::string &  value)
private

Member Data Documentation

◆ addChildValues_

bool Json::StyledWriter::addChildValues_
private

◆ childValues_

ChildValues Json::StyledWriter::childValues_
private

◆ document_

std::string Json::StyledWriter::document_
private

◆ indentSize_

int Json::StyledWriter::indentSize_
private

◆ indentString_

std::string Json::StyledWriter::indentString_
private

◆ rightMargin_

int Json::StyledWriter::rightMargin_
private

The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:40