@@ -66,7 +66,7 @@ class JSON_API StreamWriter {
66
66
/* * \brief Write into stringstream, then return string, for convenience.
67
67
* A StreamWriter will be created from the factory, used, and then deleted.
68
68
*/
69
- std::string JSON_API writeString (StreamWriter::Factory const & factory, Value const & root);
69
+ JSONCPP_STRING JSON_API writeString (StreamWriter::Factory const & factory, Value const & root);
70
70
71
71
72
72
/* * \brief Build a StreamWriter implementation.
@@ -125,7 +125,7 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
125
125
bool validate (Json::Value* invalid) const ;
126
126
/* * A simple way to update a specific setting.
127
127
*/
128
- Value& operator [](std::string key);
128
+ Value& operator [](JSONCPP_STRING key);
129
129
130
130
/* * Called by ctor, but you can use this to reset settings_.
131
131
* \pre 'settings' != NULL (but Json::null is fine)
@@ -142,7 +142,7 @@ class JSON_API Writer {
142
142
public:
143
143
virtual ~Writer ();
144
144
145
- virtual std::string write (const Value& root) = 0;
145
+ virtual JSONCPP_STRING write (const Value& root) = 0;
146
146
};
147
147
148
148
/* * \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
@@ -172,12 +172,12 @@ class JSON_API FastWriter : public Writer {
172
172
void omitEndingLineFeed ();
173
173
174
174
public: // overridden from Writer
175
- std::string write (const Value& root) override ;
175
+ JSONCPP_STRING write (const Value& root) override ;
176
176
177
177
private:
178
178
void writeValue (const Value& value);
179
179
180
- std::string document_;
180
+ JSONCPP_STRING document_;
181
181
bool yamlCompatiblityEnabled_;
182
182
bool dropNullPlaceholders_;
183
183
bool omitEndingLineFeed_;
@@ -217,27 +217,27 @@ class JSON_API StyledWriter : public Writer {
217
217
* \param root Value to serialize.
218
218
* \return String containing the JSON document that represents the root value.
219
219
*/
220
- std::string write (const Value& root) override ;
220
+ JSONCPP_STRING write (const Value& root) override ;
221
221
222
222
private:
223
223
void writeValue (const Value& value);
224
224
void writeArrayValue (const Value& value);
225
225
bool isMultineArray (const Value& value);
226
- void pushValue (const std::string & value);
226
+ void pushValue (const JSONCPP_STRING & value);
227
227
void writeIndent ();
228
- void writeWithIndent (const std::string & value);
228
+ void writeWithIndent (const JSONCPP_STRING & value);
229
229
void indent ();
230
230
void unindent ();
231
231
void writeCommentBeforeValue (const Value& root);
232
232
void writeCommentAfterValueOnSameLine (const Value& root);
233
233
bool hasCommentForValue (const Value& value);
234
- static std::string normalizeEOL (const std::string & text);
234
+ static JSONCPP_STRING normalizeEOL (const JSONCPP_STRING & text);
235
235
236
- typedef std::vector<std::string > ChildValues;
236
+ typedef std::vector<JSONCPP_STRING > ChildValues;
237
237
238
238
ChildValues childValues_;
239
- std::string document_;
240
- std::string indentString_;
239
+ JSONCPP_STRING document_;
240
+ JSONCPP_STRING indentString_;
241
241
unsigned int rightMargin_;
242
242
unsigned int indentSize_;
243
243
bool addChildValues_;
@@ -271,7 +271,7 @@ class JSON_API StyledWriter : public Writer {
271
271
*/
272
272
class JSON_API StyledStreamWriter {
273
273
public:
274
- StyledStreamWriter (std::string indentation = " \t " );
274
+ StyledStreamWriter (JSONCPP_STRING indentation = " \t " );
275
275
~StyledStreamWriter () {}
276
276
277
277
public:
@@ -287,36 +287,36 @@ class JSON_API StyledStreamWriter {
287
287
void writeValue (const Value& value);
288
288
void writeArrayValue (const Value& value);
289
289
bool isMultineArray (const Value& value);
290
- void pushValue (const std::string & value);
290
+ void pushValue (const JSONCPP_STRING & value);
291
291
void writeIndent ();
292
- void writeWithIndent (const std::string & value);
292
+ void writeWithIndent (const JSONCPP_STRING & value);
293
293
void indent ();
294
294
void unindent ();
295
295
void writeCommentBeforeValue (const Value& root);
296
296
void writeCommentAfterValueOnSameLine (const Value& root);
297
297
bool hasCommentForValue (const Value& value);
298
- static std::string normalizeEOL (const std::string & text);
298
+ static JSONCPP_STRING normalizeEOL (const JSONCPP_STRING & text);
299
299
300
- typedef std::vector<std::string > ChildValues;
300
+ typedef std::vector<JSONCPP_STRING > ChildValues;
301
301
302
302
ChildValues childValues_;
303
303
JSONCPP_OSTREAM* document_;
304
- std::string indentString_;
304
+ JSONCPP_STRING indentString_;
305
305
unsigned int rightMargin_;
306
- std::string indentation_;
306
+ JSONCPP_STRING indentation_;
307
307
bool addChildValues_ : 1 ;
308
308
bool indented_ : 1 ;
309
309
};
310
310
311
311
#if defined(JSON_HAS_INT64)
312
- std::string JSON_API valueToString (Int value);
313
- std::string JSON_API valueToString (UInt value);
312
+ JSONCPP_STRING JSON_API valueToString (Int value);
313
+ JSONCPP_STRING JSON_API valueToString (UInt value);
314
314
#endif // if defined(JSON_HAS_INT64)
315
- std::string JSON_API valueToString (LargestInt value);
316
- std::string JSON_API valueToString (LargestUInt value);
317
- std::string JSON_API valueToString (double value);
318
- std::string JSON_API valueToString (bool value);
319
- std::string JSON_API valueToQuotedString (const char * value);
315
+ JSONCPP_STRING JSON_API valueToString (LargestInt value);
316
+ JSONCPP_STRING JSON_API valueToString (LargestUInt value);
317
+ JSONCPP_STRING JSON_API valueToString (double value);
318
+ JSONCPP_STRING JSON_API valueToString (bool value);
319
+ JSONCPP_STRING JSON_API valueToQuotedString (const char * value);
320
320
321
321
// / \brief Output using the StyledStreamWriter.
322
322
// / \see Json::operator>>()
0 commit comments