Builder::settings_

We use Json::Value to configure the builders so we can maintain
binary-compatibility easily.
This commit is contained in:
Christopher Dunn
2015-02-09 17:22:28 -06:00
parent 694dbcb328
commit a9e1ab302d
5 changed files with 149 additions and 44 deletions

View File

@@ -92,13 +92,13 @@ features without losing binary-compatibility.
\code
// For convenience, use `writeString()` with a specialized builder.
Json::StreamWriterBuilder wbuilder;
wbuilder.settings["indentation"] = "\t";
wbuilder.settings_["indentation"] = "\t";
std::string document = Json::writeString(wbuilder, root);
// Here, using a specialized Builder, we discard comments and
// record errors as we parse.
Json::CharReaderBuilder rbuilder;
rbuilder.settings["collectComments"] = false;
rbuilder.settings_["collectComments"] = false;
std::string errs;
bool ok = Json::parseFromStream(rbuilder, std::cin, &root, &errs);
\endcode