

Usage:
using namespace Json; Value value = ...; StreamWriterBuilder builder; builder.settings_["commentStyle"] = "None"; builder.settings_["indentation"] = " "; // or whatever you like std::unique_ptr<Json::StreamWriter> writer( builder.newStreamWriter()); writer->write(value, &std::cout); std::cout << std::endl; // add lf and flush
Public Member Functions | ||||
| StreamWriterBuilder () | ||||
| virtual | ~StreamWriterBuilder () | |||
| virtual StreamWriter * | newStreamWriter () const | |||
| ||||
| bool | validate (Json::Value *invalid) const | |||
| ||||
| StreamWriterBuilder () | ||||
| virtual | ~StreamWriterBuilder () | |||
| virtual StreamWriter * | newStreamWriter () const | |||
| ||||
| bool | validate (Json::Value *invalid) const | |||
| ||||
Static Public Member Functions | ||||
| static void | setDefaults (Json::Value *settings) | |||
| Called by ctor, but you can use this to reset settings_. | ||||
| static void | setDefaults (Json::Value *settings) | |||
| Called by ctor, but you can use this to reset settings_. | ||||
Public Attributes | ||||
| Json::Value | settings_ | |||
| Configuration of this builder. | ||||
| ~StreamWriterBuilder | ( | ) | [virtual] |
| virtual ~StreamWriterBuilder | ( | ) | [virtual] |
| StreamWriter * newStreamWriter | ( | ) | const [virtual] |
| std::exception | if something goes wrong (e.g. |
invalid settings)
Implements StreamWriter::Factory.
| bool validate | ( | Json::Value * | invalid | ) | const |
| void setDefaults | ( | Json::Value * | settings | ) | [static] |
Called by ctor, but you can use this to reset settings_.
[StreamWriterBuilderDefaults]
[StreamWriterBuilderDefaults]
| virtual StreamWriter* newStreamWriter | ( | ) | const [virtual] |
| std::exception | if something goes wrong (e.g. |
invalid settings)
Implements StreamWriter::Factory.
| bool validate | ( | Json::Value * | invalid | ) | const |
| static void setDefaults | ( | Json::Value * | settings | ) | [static] |
Called by ctor, but you can use this to reset settings_.
Configuration of this builder.
Available settings (case-sensitive):
You can examine 'settings_` yourself to see the defaults. You can also write and read them just like any JSON Value.
1.5.3