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)
77 parse(
const std::string& document,
Value& root,
bool collectComments =
true);
97 bool parse(
const char* beginDoc,
100 bool collectComments =
true);
162 tokenEndOfStream = 0,
173 tokenMemberSeparator,
192 typedef std::deque<ErrorInfo> Errors;
194 bool readToken(Token& token);
196 bool match(Location pattern,
int patternLength);
198 bool readCStyleComment();
199 bool readCppStyleComment();
203 bool readObject(Token& token);
204 bool readArray(Token& token);
205 bool decodeNumber(Token& token);
206 bool decodeNumber(Token& token, Value& decoded);
207 bool decodeString(Token& token);
209 bool decodeDouble(Token& token);
210 bool decodeDouble(Token& token, Value& decoded);
211 bool decodeUnicodeCodePoint(Token& token,
214 unsigned int& unicode);
215 bool decodeUnicodeEscapeSequence(Token& token,
218 unsigned int& unicode);
219 bool addError(
const JSONCPP_STRING& message, Token& token, Location extra = 0);
220 bool recoverFromError(TokenType skipUntilToken);
223 TokenType skipUntilToken);
224 void skipUntilSpace();
225 Value& currentValue();
228 getLocationLineAndColumn(Location location,
int& line,
int& column)
const;
231 void skipCommentTokens(Token& token);
233 typedef std::stack<Value*> Nodes;
240 Location lastValueEnd_;
244 bool collectComments_;
270 char const* beginDoc,
char const* endDoc,
279 virtual CharReader* newCharReader()
const = 0;
345 bool validate(
Json::
Value* invalid) const;
356 static
void setDefaults(
Json::
Value* settings);
362 static
void strictMode(
Json::
Value* settings);
398 JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&,
Value&);
404 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
406 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
408 #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.