Skip to content

Commit 37dde9d

Browse files
committed
fix example in docs
1 parent c312dd5 commit 37dde9d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/jsoncpp.dox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ features without losing binary-compatibility.
9696
\code
9797
// For convenience, use `writeString()` with a specialized builder.
9898
Json::StreamWriterBuilder wbuilder;
99-
wbuilder.settings_["indentation"] = "\t"; // simple Json::Value
99+
wbuilder["indentation"] = "\t";
100100
std::string document = Json::writeString(wbuilder, root);
101101

102102
// Here, using a specialized Builder, we discard comments and
103103
// record errors as we parse.
104104
Json::CharReaderBuilder rbuilder;
105-
rbuilder.settings_["collectComments"] = false; // simple Json::Value
105+
rbuilder["collectComments"] = false;
106106
std::string errs;
107107
bool ok = Json::parseFromStream(rbuilder, std::cin, &root, &errs);
108108
\endcode

include/json/writer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ std::string writeString(StreamWriter::Factory const& factory, Value const& root)
7676
using namespace Json;
7777
Value value = ...;
7878
StreamWriterBuilder builder;
79-
builder.settings_["commentStyle"] = "None";
80-
builder.settings_["indentation"] = " "; // or whatever you like
79+
builder["commentStyle"] = "None";
80+
builder["indentation"] = " "; // or whatever you like
8181
std::unique_ptr<Json::StreamWriter> writer(
8282
builder.newStreamWriter());
8383
writer->write(value, &std::cout);

0 commit comments

Comments
 (0)