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) 20 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 22 #pragma warning(disable : 4251) 23 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 73 parse(
const std::string &document,
Value &root,
bool collectComments =
true);
93 bool parse(
const char *beginDoc,
96 bool collectComments =
true);
100 bool parse(std::istream &is,
Value &root,
bool collectComments =
true);
112 std::
string getFormatedErrorMessages() const;
122 std::
string getFormattedErrorMessages() const;
135 tokenEndOfStream = 0,
146 tokenMemberSeparator,
161 std::string message_;
165 typedef std::deque<ErrorInfo> Errors;
167 bool expectToken(TokenType type, Token &token,
const char *message);
168 bool readToken(Token &token);
170 bool match(Location pattern,
int patternLength);
172 bool readCStyleComment();
173 bool readCppStyleComment();
177 bool readObject(Token &token);
178 bool readArray(Token &token);
179 bool decodeNumber(Token &token);
180 bool decodeNumber(Token &token,
Value &decoded);
181 bool decodeString(Token &token);
182 bool decodeString(Token &token, std::string &decoded);
183 bool decodeDouble(Token &token);
184 bool decodeDouble(Token &token,
Value &decoded);
185 bool decodeUnicodeCodePoint(Token &token,
188 unsigned int &unicode);
189 bool decodeUnicodeEscapeSequence(Token &token,
192 unsigned int &unicode);
193 bool addError(
const std::string &message, Token &token, Location extra = 0);
194 bool recoverFromError(TokenType skipUntilToken);
195 bool addErrorAndRecover(
const std::string &message,
197 TokenType skipUntilToken);
198 void skipUntilSpace();
199 Value ¤tValue();
202 getLocationLineAndColumn(Location location,
int &line,
int &column)
const;
203 std::string getLocationLineAndColumn(Location location)
const;
205 void skipCommentTokens(Token &token);
207 typedef std::stack<Value *> Nodes;
210 std::string document_;
214 Location lastValueEnd_;
216 std::string commentsBefore_;
218 bool collectComments_;
249 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 251 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 253 #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...
std::istream & operator>>(std::istream &, Value &)
Read from 'sin' into 'root'.
An error tagged with where in the JSON text it was encountered.
JSON (JavaScript Object Notation).
Unserialize a JSON document into a Value.
Configuration passed to reader and writer.