|
JSON Voorhees
Killer JSON for C++
|
Inheritance diagram for jsonv::ostream_pretty_encoder:
Collaboration 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. | |
Public Member Functions inherited from jsonv::ostream_encoder | |
| ostream_encoder (std::ostream &output) | |
| Create an instance which places text into output. | |
| 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. | |
Public Member Functions inherited from jsonv::encoder | |
| void | encode (const jsonv::value &source) |
| Encode some source value into this encoder. | |
Protected Member Functions | |
| virtual void | write_null () override |
| Write the null value. | |
| virtual void | write_object_begin () override |
| Write the opening of an object value. | |
| virtual void | write_object_end () override |
| Write the closing of an object value. | |
| virtual void | write_object_key (std::string_view key) override |
| Write the key for an object, including the separator. | |
| virtual void | write_object_delimiter () override |
| Write the delimiter between two entries in an object. | |
| virtual void | write_array_begin () override |
| Write the opening of an array value. | |
| virtual void | write_array_end () override |
| Write the closing of an array value. | |
| virtual void | write_array_delimiter () override |
| Write the delimiter between two entries in an array. | |
| virtual void | write_string (std::string_view value) override |
| Write a string value. | |
| virtual void | write_integer (std::int64_t value) override |
| Write an integer value. | |
| virtual void | write_decimal (double value) override |
When a special value is given, this will output null. | |
| virtual void | write_boolean (bool value) override |
| Write a boolean value. | |
Protected Member Functions inherited from jsonv::ostream_encoder | |
| std::ostream & | output () |
Definition at line 205 of file encode.hpp.
When a special value is given, this will output null.
Reimplemented from jsonv::ostream_encoder.
|
overrideprotectedvirtual |
Write the key for an object, including the separator.
Reimplemented from jsonv::ostream_encoder.
|
overrideprotectedvirtual |
Write a string value.
| value | is 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. |
Reimplemented from jsonv::ostream_encoder.