@@ -46,7 +46,7 @@ class JSON_API Reader {
4646 struct StructuredError {
4747 ptrdiff_t offset_start;
4848 ptrdiff_t offset_limit;
49- JSONCPP_STRING message;
49+ String message;
5050 };
5151
5252 /* * \brief Constructs a Reader allowing all features
@@ -103,7 +103,7 @@ class JSON_API Reader {
103103
104104 // / \brief Parse from input stream.
105105 // / \see Json::operator>>(std::istream&, Json::Value&).
106- bool parse (JSONCPP_ISTREAM & is, Value& root, bool collectComments = true );
106+ bool parse (IStream & is, Value& root, bool collectComments = true );
107107
108108 /* * \brief Returns a user friendly string that list errors in the parsed
109109 * document.
@@ -115,7 +115,7 @@ class JSON_API Reader {
115115 * \deprecated Use getFormattedErrorMessages() instead (typo fix).
116116 */
117117 JSONCPP_DEPRECATED (" Use getFormattedErrorMessages() instead." )
118- JSONCPP_STRING getFormatedErrorMessages () const ;
118+ String getFormatedErrorMessages () const ;
119119
120120 /* * \brief Returns a user friendly string that list errors in the parsed
121121 * document.
@@ -125,7 +125,7 @@ class JSON_API Reader {
125125 * occurred
126126 * during parsing.
127127 */
128- JSONCPP_STRING getFormattedErrorMessages () const ;
128+ String getFormattedErrorMessages () const ;
129129
130130 /* * \brief Returns a vector of structured erros encounted while parsing.
131131 * \return A (possibly empty) vector of StructuredError objects. Currently
@@ -142,7 +142,7 @@ class JSON_API Reader {
142142 * \return \c true if the error was successfully added, \c false if the
143143 * Value offset exceeds the document size.
144144 */
145- bool pushError (const Value& value, const JSONCPP_STRING & message);
145+ bool pushError (const Value& value, const String & message);
146146
147147 /* * \brief Add a semantic error message with extra context.
148148 * \param value JSON Value location associated with the error
@@ -151,9 +151,7 @@ class JSON_API Reader {
151151 * \return \c true if the error was successfully added, \c false if either
152152 * Value offset exceeds the document size.
153153 */
154- bool pushError (const Value& value,
155- const JSONCPP_STRING& message,
156- const Value& extra);
154+ bool pushError (const Value& value, const String& message, const Value& extra);
157155
158156 /* * \brief Return whether there are any errors.
159157 * \return \c true if there are no errors to report \c false if
@@ -189,7 +187,7 @@ class JSON_API Reader {
189187 class ErrorInfo {
190188 public:
191189 Token token_;
192- JSONCPP_STRING message_;
190+ String message_;
193191 Location extra_;
194192 };
195193
@@ -209,7 +207,7 @@ class JSON_API Reader {
209207 bool decodeNumber (Token& token);
210208 bool decodeNumber (Token& token, Value& decoded);
211209 bool decodeString (Token& token);
212- bool decodeString (Token& token, JSONCPP_STRING & decoded);
210+ bool decodeString (Token& token, String & decoded);
213211 bool decodeDouble (Token& token);
214212 bool decodeDouble (Token& token, Value& decoded);
215213 bool decodeUnicodeCodePoint (Token& token,
@@ -220,35 +218,33 @@ class JSON_API Reader {
220218 Location& current,
221219 Location end,
222220 unsigned int & unicode);
223- bool addError (const JSONCPP_STRING& message,
224- Token& token,
225- Location extra = nullptr );
221+ bool addError (const String& message, Token& token, Location extra = nullptr );
226222 bool recoverFromError (TokenType skipUntilToken);
227- bool addErrorAndRecover (const JSONCPP_STRING & message,
223+ bool addErrorAndRecover (const String & message,
228224 Token& token,
229225 TokenType skipUntilToken);
230226 void skipUntilSpace ();
231227 Value& currentValue ();
232228 Char getNextChar ();
233229 void
234230 getLocationLineAndColumn (Location location, int & line, int & column) const ;
235- JSONCPP_STRING getLocationLineAndColumn (Location location) const ;
231+ String getLocationLineAndColumn (Location location) const ;
236232 void addComment (Location begin, Location end, CommentPlacement placement);
237233 void skipCommentTokens (Token& token);
238234
239235 static bool containsNewLine (Location begin, Location end);
240- static JSONCPP_STRING normalizeEOL (Location begin, Location end);
236+ static String normalizeEOL (Location begin, Location end);
241237
242238 typedef std::stack<Value*> Nodes;
243239 Nodes nodes_;
244240 Errors errors_;
245- JSONCPP_STRING document_;
241+ String document_;
246242 Location begin_{};
247243 Location end_{};
248244 Location current_{};
249245 Location lastValueEnd_{};
250246 Value* lastValue_{};
251- JSONCPP_STRING commentsBefore_;
247+ String commentsBefore_;
252248 Features features_;
253249 bool collectComments_{};
254250}; // Reader
@@ -279,7 +275,7 @@ class JSON_API CharReader {
279275 virtual bool parse (char const * beginDoc,
280276 char const * endDoc,
281277 Value* root,
282- JSONCPP_STRING * errs) = 0;
278+ String * errs) = 0;
283279
284280 class JSON_API Factory {
285281 public:
@@ -299,7 +295,7 @@ class JSON_API CharReader {
299295 CharReaderBuilder builder;
300296 builder["collectComments"] = false;
301297 Value value;
302- JSONCPP_STRING errs;
298+ String errs;
303299 bool ok = parseFromStream(builder, std::cin, &value, &errs);
304300\endcode
305301*/
@@ -359,7 +355,7 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
359355
360356 /* * A simple way to update a specific setting.
361357 */
362- Value& operator [](const JSONCPP_STRING & key);
358+ Value& operator [](const String & key);
363359
364360 /* * Called by ctor, but you can use this to reset settings_.
365361 * \pre 'settings' != NULL (but Json::null is fine)
@@ -380,7 +376,7 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
380376 * is convenient.
381377 */
382378bool JSON_API parseFromStream (CharReader::Factory const &,
383- JSONCPP_ISTREAM &,
379+ IStream &,
384380 Value* root,
385381 std::string* errs);
386382
@@ -408,7 +404,7 @@ bool JSON_API parseFromStream(CharReader::Factory const&,
408404 \throw std::exception on parse error.
409405 \see Json::operator<<()
410406*/
411- JSON_API JSONCPP_ISTREAM & operator >>(JSONCPP_ISTREAM &, Value&);
407+ JSON_API IStream & operator >>(IStream &, Value&);
412408
413409} // namespace Json
414410
0 commit comments