@@ -46,7 +46,7 @@ class JSON_API Reader {
46
46
struct StructuredError {
47
47
ptrdiff_t offset_start;
48
48
ptrdiff_t offset_limit;
49
- JSONCPP_STRING message;
49
+ String message;
50
50
};
51
51
52
52
/* * \brief Constructs a Reader allowing all features
@@ -103,7 +103,7 @@ class JSON_API Reader {
103
103
104
104
// / \brief Parse from input stream.
105
105
// / \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 );
107
107
108
108
/* * \brief Returns a user friendly string that list errors in the parsed
109
109
* document.
@@ -115,7 +115,7 @@ class JSON_API Reader {
115
115
* \deprecated Use getFormattedErrorMessages() instead (typo fix).
116
116
*/
117
117
JSONCPP_DEPRECATED (" Use getFormattedErrorMessages() instead." )
118
- JSONCPP_STRING getFormatedErrorMessages () const ;
118
+ String getFormatedErrorMessages () const ;
119
119
120
120
/* * \brief Returns a user friendly string that list errors in the parsed
121
121
* document.
@@ -125,7 +125,7 @@ class JSON_API Reader {
125
125
* occurred
126
126
* during parsing.
127
127
*/
128
- JSONCPP_STRING getFormattedErrorMessages () const ;
128
+ String getFormattedErrorMessages () const ;
129
129
130
130
/* * \brief Returns a vector of structured erros encounted while parsing.
131
131
* \return A (possibly empty) vector of StructuredError objects. Currently
@@ -142,7 +142,7 @@ class JSON_API Reader {
142
142
* \return \c true if the error was successfully added, \c false if the
143
143
* Value offset exceeds the document size.
144
144
*/
145
- bool pushError (const Value& value, const JSONCPP_STRING & message);
145
+ bool pushError (const Value& value, const String & message);
146
146
147
147
/* * \brief Add a semantic error message with extra context.
148
148
* \param value JSON Value location associated with the error
@@ -151,9 +151,7 @@ class JSON_API Reader {
151
151
* \return \c true if the error was successfully added, \c false if either
152
152
* Value offset exceeds the document size.
153
153
*/
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);
157
155
158
156
/* * \brief Return whether there are any errors.
159
157
* \return \c true if there are no errors to report \c false if
@@ -189,7 +187,7 @@ class JSON_API Reader {
189
187
class ErrorInfo {
190
188
public:
191
189
Token token_;
192
- JSONCPP_STRING message_;
190
+ String message_;
193
191
Location extra_;
194
192
};
195
193
@@ -209,7 +207,7 @@ class JSON_API Reader {
209
207
bool decodeNumber (Token& token);
210
208
bool decodeNumber (Token& token, Value& decoded);
211
209
bool decodeString (Token& token);
212
- bool decodeString (Token& token, JSONCPP_STRING & decoded);
210
+ bool decodeString (Token& token, String & decoded);
213
211
bool decodeDouble (Token& token);
214
212
bool decodeDouble (Token& token, Value& decoded);
215
213
bool decodeUnicodeCodePoint (Token& token,
@@ -220,35 +218,33 @@ class JSON_API Reader {
220
218
Location& current,
221
219
Location end,
222
220
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 );
226
222
bool recoverFromError (TokenType skipUntilToken);
227
- bool addErrorAndRecover (const JSONCPP_STRING & message,
223
+ bool addErrorAndRecover (const String & message,
228
224
Token& token,
229
225
TokenType skipUntilToken);
230
226
void skipUntilSpace ();
231
227
Value& currentValue ();
232
228
Char getNextChar ();
233
229
void
234
230
getLocationLineAndColumn (Location location, int & line, int & column) const ;
235
- JSONCPP_STRING getLocationLineAndColumn (Location location) const ;
231
+ String getLocationLineAndColumn (Location location) const ;
236
232
void addComment (Location begin, Location end, CommentPlacement placement);
237
233
void skipCommentTokens (Token& token);
238
234
239
235
static bool containsNewLine (Location begin, Location end);
240
- static JSONCPP_STRING normalizeEOL (Location begin, Location end);
236
+ static String normalizeEOL (Location begin, Location end);
241
237
242
238
typedef std::stack<Value*> Nodes;
243
239
Nodes nodes_;
244
240
Errors errors_;
245
- JSONCPP_STRING document_;
241
+ String document_;
246
242
Location begin_{};
247
243
Location end_{};
248
244
Location current_{};
249
245
Location lastValueEnd_{};
250
246
Value* lastValue_{};
251
- JSONCPP_STRING commentsBefore_;
247
+ String commentsBefore_;
252
248
Features features_;
253
249
bool collectComments_{};
254
250
}; // Reader
@@ -279,7 +275,7 @@ class JSON_API CharReader {
279
275
virtual bool parse (char const * beginDoc,
280
276
char const * endDoc,
281
277
Value* root,
282
- JSONCPP_STRING * errs) = 0;
278
+ String * errs) = 0;
283
279
284
280
class JSON_API Factory {
285
281
public:
@@ -299,7 +295,7 @@ class JSON_API CharReader {
299
295
CharReaderBuilder builder;
300
296
builder["collectComments"] = false;
301
297
Value value;
302
- JSONCPP_STRING errs;
298
+ String errs;
303
299
bool ok = parseFromStream(builder, std::cin, &value, &errs);
304
300
\endcode
305
301
*/
@@ -359,7 +355,7 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
359
355
360
356
/* * A simple way to update a specific setting.
361
357
*/
362
- Value& operator [](const JSONCPP_STRING & key);
358
+ Value& operator [](const String & key);
363
359
364
360
/* * Called by ctor, but you can use this to reset settings_.
365
361
* \pre 'settings' != NULL (but Json::null is fine)
@@ -380,7 +376,7 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
380
376
* is convenient.
381
377
*/
382
378
bool JSON_API parseFromStream (CharReader::Factory const &,
383
- JSONCPP_ISTREAM &,
379
+ IStream &,
384
380
Value* root,
385
381
std::string* errs);
386
382
@@ -408,7 +404,7 @@ bool JSON_API parseFromStream(CharReader::Factory const&,
408
404
\throw std::exception on parse error.
409
405
\see Json::operator<<()
410
406
*/
411
- JSON_API JSONCPP_ISTREAM & operator >>(JSONCPP_ISTREAM &, Value&);
407
+ JSON_API IStream & operator >>(IStream &, Value&);
412
408
413
409
} // namespace Json
414
410
0 commit comments