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)
49 bool parse(
const std::string &document,
51 bool collectComments =
true );
65 bool parse(
const char *beginDoc,
const char *endDoc,
67 bool collectComments =
true );
71 bool parse( std::istream &is,
73 bool collectComments =
true );
82 std::
string getFormatedErrorMessages() const;
89 std::
string getFormattedErrorMessages() const;
105 tokenMemberSeparator,
122 std::string message_;
126 typedef std::deque<ErrorInfo> Errors;
128 bool expectToken( TokenType type, Token &token,
const char *message );
129 bool readToken( Token &token );
131 bool match( Location pattern,
134 bool readCStyleComment();
135 bool readCppStyleComment();
139 bool readObject( Token &token );
140 bool readArray( Token &token );
141 bool decodeNumber( Token &token );
142 bool decodeString( Token &token );
143 bool decodeString( Token &token, std::string &decoded );
144 bool decodeDouble( Token &token );
145 bool decodeUnicodeCodePoint( Token &token,
148 unsigned int &unicode );
149 bool decodeUnicodeEscapeSequence( Token &token,
152 unsigned int &unicode );
153 bool addError(
const std::string &message,
155 Location extra = 0 );
156 bool recoverFromError( TokenType skipUntilToken );
157 bool addErrorAndRecover(
const std::string &message,
159 TokenType skipUntilToken );
160 void skipUntilSpace();
161 Value ¤tValue();
163 void getLocationLineAndColumn( Location location,
166 std::string getLocationLineAndColumn( Location location )
const;
167 void addComment( Location begin,
170 void skipCommentTokens( Token &token );
172 typedef std::stack<Value *> Nodes;
175 std::string document_;
179 Location lastValueEnd_;
181 std::string commentsBefore_;
183 bool collectComments_;
210 std::istream&
operator>>( std::istream&, Value& );
214 #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'.
JSON (JavaScript Object Notation).
Unserialize a JSON document into a Value.
Configuration passed to reader and writer.