@@ -66,7 +66,7 @@ class JSON_API StreamWriter {
6666/* * \brief Write into stringstream, then return string, for convenience.
6767 * A StreamWriter will be created from the factory, used, and then deleted.
6868 */
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);
7070
7171
7272/* * \brief Build a StreamWriter implementation.
@@ -125,7 +125,7 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
125125 bool validate (Json::Value* invalid) const ;
126126 /* * A simple way to update a specific setting.
127127 */
128- Value& operator [](std::string key);
128+ Value& operator [](JSONCPP_STRING key);
129129
130130 /* * Called by ctor, but you can use this to reset settings_.
131131 * \pre 'settings' != NULL (but Json::null is fine)
@@ -142,7 +142,7 @@ class JSON_API Writer {
142142public:
143143 virtual ~Writer ();
144144
145- virtual std::string write (const Value& root) = 0;
145+ virtual JSONCPP_STRING write (const Value& root) = 0;
146146};
147147
148148/* * \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
@@ -172,12 +172,12 @@ class JSON_API FastWriter : public Writer {
172172 void omitEndingLineFeed ();
173173
174174public: // overridden from Writer
175- std::string write (const Value& root) override ;
175+ JSONCPP_STRING write (const Value& root) override ;
176176
177177private:
178178 void writeValue (const Value& value);
179179
180- std::string document_;
180+ JSONCPP_STRING document_;
181181 bool yamlCompatiblityEnabled_;
182182 bool dropNullPlaceholders_;
183183 bool omitEndingLineFeed_;
@@ -217,27 +217,27 @@ class JSON_API StyledWriter : public Writer {
217217 * \param root Value to serialize.
218218 * \return String containing the JSON document that represents the root value.
219219 */
220- std::string write (const Value& root) override ;
220+ JSONCPP_STRING write (const Value& root) override ;
221221
222222private:
223223 void writeValue (const Value& value);
224224 void writeArrayValue (const Value& value);
225225 bool isMultineArray (const Value& value);
226- void pushValue (const std::string & value);
226+ void pushValue (const JSONCPP_STRING & value);
227227 void writeIndent ();
228- void writeWithIndent (const std::string & value);
228+ void writeWithIndent (const JSONCPP_STRING & value);
229229 void indent ();
230230 void unindent ();
231231 void writeCommentBeforeValue (const Value& root);
232232 void writeCommentAfterValueOnSameLine (const Value& root);
233233 bool hasCommentForValue (const Value& value);
234- static std::string normalizeEOL (const std::string & text);
234+ static JSONCPP_STRING normalizeEOL (const JSONCPP_STRING & text);
235235
236- typedef std::vector<std::string > ChildValues;
236+ typedef std::vector<JSONCPP_STRING > ChildValues;
237237
238238 ChildValues childValues_;
239- std::string document_;
240- std::string indentString_;
239+ JSONCPP_STRING document_;
240+ JSONCPP_STRING indentString_;
241241 unsigned int rightMargin_;
242242 unsigned int indentSize_;
243243 bool addChildValues_;
@@ -271,7 +271,7 @@ class JSON_API StyledWriter : public Writer {
271271 */
272272class JSON_API StyledStreamWriter {
273273public:
274- StyledStreamWriter (std::string indentation = " \t " );
274+ StyledStreamWriter (JSONCPP_STRING indentation = " \t " );
275275 ~StyledStreamWriter () {}
276276
277277public:
@@ -287,36 +287,36 @@ class JSON_API StyledStreamWriter {
287287 void writeValue (const Value& value);
288288 void writeArrayValue (const Value& value);
289289 bool isMultineArray (const Value& value);
290- void pushValue (const std::string & value);
290+ void pushValue (const JSONCPP_STRING & value);
291291 void writeIndent ();
292- void writeWithIndent (const std::string & value);
292+ void writeWithIndent (const JSONCPP_STRING & value);
293293 void indent ();
294294 void unindent ();
295295 void writeCommentBeforeValue (const Value& root);
296296 void writeCommentAfterValueOnSameLine (const Value& root);
297297 bool hasCommentForValue (const Value& value);
298- static std::string normalizeEOL (const std::string & text);
298+ static JSONCPP_STRING normalizeEOL (const JSONCPP_STRING & text);
299299
300- typedef std::vector<std::string > ChildValues;
300+ typedef std::vector<JSONCPP_STRING > ChildValues;
301301
302302 ChildValues childValues_;
303303 JSONCPP_OSTREAM* document_;
304- std::string indentString_;
304+ JSONCPP_STRING indentString_;
305305 unsigned int rightMargin_;
306- std::string indentation_;
306+ JSONCPP_STRING indentation_;
307307 bool addChildValues_ : 1 ;
308308 bool indented_ : 1 ;
309309};
310310
311311#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);
314314#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);
320320
321321// / \brief Output using the StyledStreamWriter.
322322// / \see Json::operator>>()
0 commit comments