@@ -90,8 +90,15 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
90
90
// without a major version bump.
91
91
/* * Configuration of this builder.
92
92
Available settings (case-sensitive):
93
- - "commentStyle": "None", "Some", or "All"
93
+ - "commentStyle": "None" or "All"
94
94
- "indentation": "<anything>"
95
+ - "enableYAMLCompatibility": False or True
96
+ - slightly change the whitespace around colons
97
+ - "dropNullPlaceholders": False or True
98
+ - Drop the "null" string from the writer's output for nullValues.
99
+ Strictly speaking, this is not valid JSON. But when the output is being
100
+ fed to a browser's Javascript, it makes for smaller output and the
101
+ browser can handle the output just fine.
95
102
96
103
You can examine 'settings_` yourself
97
104
to see the defaults. You can also write and read them just like any
@@ -120,54 +127,6 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
120
127
static void setDefaults (Json::Value* settings);
121
128
};
122
129
123
- /* * \brief Build a StreamWriter implementation.
124
- * Comments are not written, and most whitespace is omitted.
125
- * In addition, there are some special settings to allow compatibility
126
- * with the old FastWriter.
127
- * Usage:
128
- * \code
129
- * OldCompressingStreamWriterBuilder b;
130
- * b.dropNullPlaceHolders_ = true; // etc.
131
- * StreamWriter* w = b.newStreamWriter();
132
- * w->write(value, &std::cout);
133
- * delete w;
134
- * \endcode
135
- *
136
- * \deprecated Use StreamWriterBuilder
137
- */
138
- class JSON_API OldCompressingStreamWriterBuilder : public StreamWriter::Factory
139
- {
140
- public:
141
- // Note: We cannot add data-members to this class without a major version bump.
142
- // So these might as well be completely exposed.
143
-
144
- /* * \brief Drop the "null" string from the writer's output for nullValues.
145
- * Strictly speaking, this is not valid JSON. But when the output is being
146
- * fed to a browser's Javascript, it makes for smaller output and the
147
- * browser can handle the output just fine.
148
- */
149
- bool dropNullPlaceholders_;
150
- /* * \brief Do not add \n at end of document.
151
- * Normally, we add an extra newline, just because.
152
- */
153
- bool omitEndingLineFeed_;
154
- /* * \brief Add a space after ':'.
155
- * If indentation is non-empty, we surround colon with whitespace,
156
- * e.g. " : "
157
- * This will add back the trailing space when there is no indentation.
158
- * This seems dubious when the entire document is on a single line,
159
- * but we leave this here to repduce the behavior of the old `FastWriter`.
160
- */
161
- bool enableYAMLCompatibility_;
162
-
163
- OldCompressingStreamWriterBuilder ()
164
- : dropNullPlaceholders_(false )
165
- , omitEndingLineFeed_(false )
166
- , enableYAMLCompatibility_(false )
167
- {}
168
- virtual StreamWriter* newStreamWriter () const ;
169
- };
170
-
171
130
/* * \brief Abstract class for writers.
172
131
* \deprecated Use StreamWriter.
173
132
*/
@@ -185,7 +144,7 @@ class JSON_API Writer {
185
144
*consumption,
186
145
* but may be usefull to support feature such as RPC where bandwith is limited.
187
146
* \sa Reader, Value
188
- * \deprecated Use OldCompressingStreamWriterBuilder .
147
+ * \deprecated Use StreamWriterBuilder .
189
148
*/
190
149
class JSON_API FastWriter : public Writer {
191
150
public:
0 commit comments