File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -299,10 +299,17 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
299
299
These are case-sensitive.
300
300
Available settings (case-sensitive):
301
301
- "collectComments": false or true
302
- - "allowComments"
303
- - "strictRoot"
304
- - "allowDroppedNullPlaceholders"
305
- - "allowNumericKeys"
302
+ - true to collect comment and allow writing them
303
+ back during serialization, false to discard comments.
304
+ This parameter is ignored if allowComments is false.
305
+ - "allowComments": false or true
306
+ - true if comments are allowed.
307
+ - "strictRoot": false or true
308
+ - true if root must be either an array or an object value
309
+ - "allowDroppedNullPlaceholders": false or true
310
+ - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
311
+ - "allowNumericKeys": false or true
312
+ - true if numeric object keys are allowed.
306
313
307
314
You can examine 'settings_` yourself
308
315
to see the defaults. You can also write and read them just like any
Original file line number Diff line number Diff line change @@ -92,9 +92,9 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
92
92
Available settings (case-sensitive):
93
93
- "commentStyle": "None" or "All"
94
94
- "indentation": "<anything>"
95
- - "enableYAMLCompatibility": False or True
95
+ - "enableYAMLCompatibility": false or true
96
96
- slightly change the whitespace around colons
97
- - "dropNullPlaceholders": False or True
97
+ - "dropNullPlaceholders": false or true
98
98
- Drop the "null" string from the writer's output for nullValues.
99
99
Strictly speaking, this is not valid JSON. But when the output is being
100
100
fed to a browser's Javascript, it makes for smaller output and the
Original file line number Diff line number Diff line change @@ -981,7 +981,7 @@ StreamWriter* StreamWriterBuilder::newStreamWriter() const
981
981
} else if (cs_str == " None" ) {
982
982
cs = CommentStyle::None;
983
983
} else {
984
- return NULL ;
984
+ throw std::runtime_error ( " commentStyle must be 'All' or 'None' " ) ;
985
985
}
986
986
std::string colonSymbol = " : " ;
987
987
if (eyc) {
You can’t perform that action at this time.
0 commit comments