Build a StreamWriter implementation.
More...
#include <json.h>
Build a StreamWriter implementation.
Usage:
builder["commentStyle"] = "None";
builder["indentation"] = " ";
std::unique_ptr<Json::StreamWriter> writer(
◆ StreamWriterBuilder()
Json::StreamWriterBuilder::StreamWriterBuilder |
( |
| ) |
|
◆ ~StreamWriterBuilder()
Json::StreamWriterBuilder::~StreamWriterBuilder |
( |
| ) |
|
|
override |
◆ newStreamWriter()
StreamWriter * Json::StreamWriterBuilder::newStreamWriter |
( |
| ) |
const |
|
overridevirtual |
◆ operator[]()
A simple way to update a specific setting.
◆ setDefaults()
Called by ctor, but you can use this to reset settings_.
- Precondition
- 'settings' != NULL (but Json::null is fine)
[StreamWriterBuilderDefaults]
[StreamWriterBuilderDefaults]
◆ validate()
bool Json::StreamWriterBuilder::validate |
( |
Json::Value * |
invalid | ) |
const |
- Returns
- true if 'settings' are legal and consistent; otherwise, indicate bad settings via 'invalid'.
◆ settings_
Configuration of this builder. Available settings (case-sensitive):
- "commentStyle": "None" or "All"
- "indentation": "<anything>"
- "enableYAMLCompatibility": false or true
- slightly change the whitespace around colons
- "dropNullPlaceholders": false or true
- Drop the "null" string from the writer's output for nullValues. Strictly speaking, this is not valid JSON. But when the output is being fed to a browser's Javascript, it makes for smaller output and the browser can handle the output just fine.
- "useSpecialFloats": false or true
- If true, outputs non-finite floating point values in the following way: NaN values as "NaN", positive infinity as "Infinity", and negative infinity as "-Infinity".
You can examine 'settings_` yourself to see the defaults. You can also write and read them just like any JSON Value.
- See also
- setDefaults()
The documentation for this class was generated from the following files:
- Source/ThirdParty/libwebrtc/Source/third_party/protobuf/conformance/third_party/jsoncpp/json.h
- Source/ThirdParty/libwebrtc/Source/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp