6 #ifndef CPPTL_JSON_READER_H_INCLUDED
7 #define CPPTL_JSON_READER_H_INCLUDED
9 #if !defined(JSON_IS_AMALGAMATION)
12 #endif // if !defined(JSON_IS_AMALGAMATION)
21 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
23 #pragma warning(disable : 4251)
24 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
75 parse(
const std::string& document,
Value& root,
bool collectComments =
true);
95 bool parse(
const char* beginDoc,
98 bool collectComments =
true);
160 tokenEndOfStream = 0,
171 tokenMemberSeparator,
190 typedef std::deque<ErrorInfo> Errors;
192 bool readToken(Token& token);
194 bool match(Location pattern,
int patternLength);
196 bool readCStyleComment();
197 bool readCppStyleComment();
201 bool readObject(Token& token);
202 bool readArray(Token& token);
203 bool decodeNumber(Token& token);
204 bool decodeNumber(Token& token, Value& decoded);
205 bool decodeString(Token& token);
207 bool decodeDouble(Token& token);
208 bool decodeDouble(Token& token, Value& decoded);
209 bool decodeUnicodeCodePoint(Token& token,
212 unsigned int& unicode);
213 bool decodeUnicodeEscapeSequence(Token& token,
216 unsigned int& unicode);
217 bool addError(
const JSONCPP_STRING& message, Token& token, Location extra = 0);
218 bool recoverFromError(TokenType skipUntilToken);
221 TokenType skipUntilToken);
222 void skipUntilSpace();
223 Value& currentValue();
226 getLocationLineAndColumn(Location location,
int& line,
int& column)
const;
229 void skipCommentTokens(Token& token);
231 typedef std::stack<Value*> Nodes;
238 Location lastValueEnd_;
242 bool collectComments_;
268 char const* beginDoc,
char const* endDoc,
277 virtual CharReader* newCharReader()
const = 0;
343 bool validate(
Json::
Value* invalid) const;
354 static
void setDefaults(
Json::
Value* settings);
360 static
void strictMode(
Json::
Value* settings);
396 JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&,
Value&);
400 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
402 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
404 #endif // CPPTL_JSON_READER_H_INCLUDED
#define JSONCPP_DEPRECATED(message)
#define JSON_API
If defined, indicates that the source file is amalgated to prevent private header inclusion...
bool parseFromStream(CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
Consume entire stream and use its begin/end.
Json::Value settings_
Configuration of this builder.
An error tagged with where in the JSON text it was encountered.
JSON (JavaScript Object Notation).
Interface for reading JSON from a char array.
Unserialize a JSON document into a Value.
Build a CharReader implementation.
Configuration passed to reader and writer.