JSON Voorhees
Killer JSON for C++
jsonv::ostream_pretty_encoder Class Reference
+ Inheritance diagram for jsonv::ostream_pretty_encoder:

Public Member Functions

 ostream_pretty_encoder (std::ostream &output, std::size_t indent_size=2)
 Create an instance which places text into output. More...
 
- Public Member Functions inherited from jsonv::ostream_encoder
 ostream_encoder (std::ostream &output)
 Create an instance which places text into output. More...
 
void ensure_ascii (bool value)
 If set to true (the default), then all non-ASCII characters in strings will be replaced with their numeric encodings. More...
 
- Public Member Functions inherited from jsonv::encoder
void encode (const jsonv::value &source)
 Encode some source value into this encoder. More...
 

Protected Member Functions

virtual void write_null () override
 Write the null value. More...
 
virtual void write_object_begin () override
 Write the opening of an object value. More...
 
virtual void write_object_end () override
 Write the closing of an object value. More...
 
virtual void write_object_key (string_view key) override
 Write the key for an object, including the separator. More...
 
virtual void write_object_delimiter () override
 Write the delimiter between two entries in an object. More...
 
virtual void write_array_begin () override
 Write the opening of an array value. More...
 
virtual void write_array_end () override
 Write the closing of an array value. More...
 
virtual void write_array_delimiter () override
 Write the delimiter between two entries in an array. More...
 
virtual void write_string (string_view value) override
 Write a string value. More...
 
virtual void write_integer (std::int64_t value) override
 Write an integer value. More...
 
virtual void write_decimal (double value) override
 When a special value is given, this will output null. More...
 
virtual void write_boolean (bool value) override
 Write a boolean value. More...
 
- Protected Member Functions inherited from jsonv::ostream_encoder
std::ostream & output ()
 

Detailed Description

Constructor & Destructor Documentation

jsonv::ostream_pretty_encoder::ostream_pretty_encoder ( std::ostream &  output,
std::size_t  indent_size = 2 
)
explicit

Create an instance which places text into output.

Member Function Documentation

virtual void jsonv::ostream_pretty_encoder::write_array_begin ( )
overrideprotectedvirtual

Write the opening of an array value.

[

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_array_delimiter ( )
overrideprotectedvirtual

Write the delimiter between two entries in an array.

,

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_array_end ( )
overrideprotectedvirtual

Write the closing of an array value.

]

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_boolean ( bool  value)
overrideprotectedvirtual

Write a boolean value.

true

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_decimal ( double  value)
overrideprotectedvirtual

When a special value is given, this will output null.

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_integer ( std::int64_t  value)
overrideprotectedvirtual

Write an integer value.

902

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_null ( )
overrideprotectedvirtual

Write the null value.

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_object_begin ( )
overrideprotectedvirtual

Write the opening of an object value.

{

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_object_delimiter ( )
overrideprotectedvirtual

Write the delimiter between two entries in an object.

,

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_object_end ( )
overrideprotectedvirtual

Write the closing of an object value.

}

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_object_key ( string_view  key)
overrideprotectedvirtual

Write the key for an object, including the separator.

"key":

Reimplemented from jsonv::ostream_encoder.

virtual void jsonv::ostream_pretty_encoder::write_string ( string_view  value)
overrideprotectedvirtual

Write a string value.

Parameters
valueis the string to write. It will hopefully be encoded as valid UTF-8. It is the implementation's choice of how to deal with malformed string values. Two common options are to replace malformed sequences with ?s or to simply output these encodings and let the receiver deal with them.
"value"

Reimplemented from jsonv::ostream_encoder.


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