File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -298,12 +298,16 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
298
298
/* * Configuration of this builder.
299
299
These are case-sensitive.
300
300
Available settings (case-sensitive):
301
- - "collectComments": false or true (default=true)
302
- - TODO: other features ...
301
+ - "collectComments": false or true
302
+ - "allowComments"
303
+ - "strictRoot"
304
+ - "allowDroppedNullPlaceholders"
305
+ - "allowNumericKeys"
306
+
303
307
You can examine 'settings_` yourself
304
308
to see the defaults. You can also write and read them just like any
305
309
JSON Value.
306
- \sa setDefaults(Json::Value* )
310
+ \sa setDefaults()
307
311
*/
308
312
Json::Value settings_;
309
313
@@ -312,7 +316,7 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
312
316
313
317
virtual CharReader* newCharReader () const ;
314
318
315
- /* * \return true if 'settings' are illegal and consistent;
319
+ /* * \return true if 'settings' are legal and consistent;
316
320
* otherwise, indicate bad settings via 'invalid'.
317
321
*/
318
322
bool validate (Json::Value* invalid) const ;
Original file line number Diff line number Diff line change @@ -99,11 +99,13 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
99
99
// without a major version bump.
100
100
/* * Configuration of this builder.
101
101
Available settings (case-sensitive):
102
- - "commentStyle": "None", "Some", or "All" (default="All")
103
- - "indentation": (default="\t")
104
- But don't trust these docs. You can examine 'settings_` yourself
102
+ - "commentStyle": "None", "Some", or "All"
103
+ - "indentation": "<anything>"
104
+
105
+ You can examine 'settings_` yourself
105
106
to see the defaults. You can also write and read them just like any
106
107
JSON Value.
108
+ \sa setDefaults()
107
109
*/
108
110
Json::Value settings_;
109
111
@@ -115,7 +117,7 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
115
117
*/
116
118
virtual StreamWriter* newStreamWriter (std::ostream* sout) const ;
117
119
118
- /* * \return true if 'settings' are illegal and consistent;
120
+ /* * \return true if 'settings' are legal and consistent;
119
121
* otherwise, indicate bad settings via 'invalid'.
120
122
*/
121
123
bool validate (Json::Value* invalid) const ;
Original file line number Diff line number Diff line change @@ -925,13 +925,20 @@ CharReader* CharReaderBuilder::newCharReader() const
925
925
926
926
bool collectComments = settings_[" collectComments" ].asBool ();
927
927
Features features = Features::all ();
928
- // TODO: Fill in features.
928
+ features.allowComments_ = settings_[" allowComments" ].asBool ();
929
+ features.strictRoot_ = settings_[" strictRoot" ].asBool ();
930
+ features.allowDroppedNullPlaceholders_ = settings_[" allowDroppedNullPlaceholders" ].asBool ();
931
+ features.allowNumericKeys_ = settings_[" allowNumericKeys" ].asBool ();
929
932
return new OldReader (collectComments, features);
930
933
}
931
934
static void getValidReaderKeys (std::set<std::string>* valid_keys)
932
935
{
933
936
valid_keys->clear ();
934
937
valid_keys->insert (" collectComments" );
938
+ valid_keys->insert (" allowComments" );
939
+ valid_keys->insert (" strictRoot" );
940
+ valid_keys->insert (" allowDroppedNullPlaceholders" );
941
+ valid_keys->insert (" allowNumericKeys" );
935
942
}
936
943
bool CharReaderBuilder::validate (Json::Value* invalid) const
937
944
{
You can’t perform that action at this time.
0 commit comments