1 #ifndef CPPTL_JSON_READER_H_INCLUDED 2 # define CPPTL_JSON_READER_H_INCLUDED 44 bool parse(
const std::string &document,
46 bool collectComments =
true );
58 bool parse(
const char *beginDoc,
const char *endDoc,
60 bool collectComments =
true );
64 bool parse( std::istream &is,
66 bool collectComments =
true );
73 std::string getFormatedErrorMessages()
const;
112 bool expectToken(
TokenType type,
Token &token,
const char *message );
113 bool readToken(
Token &token );
115 bool match( Location pattern,
118 bool readCStyleComment();
119 bool readCppStyleComment();
123 bool readObject(
Token &token );
124 bool readArray(
Token &token );
125 bool decodeNumber(
Token &token );
126 bool decodeString(
Token &token );
127 bool decodeString(
Token &token, std::string &decoded );
128 bool decodeDouble(
Token &token );
129 bool decodeUnicodeCodePoint(
Token &token,
132 unsigned int &unicode );
133 bool decodeUnicodeEscapeSequence(
Token &token,
136 unsigned int &unicode );
137 bool addError(
const std::string &message,
139 Location extra = 0 );
140 bool recoverFromError(
TokenType skipUntilToken );
141 bool addErrorAndRecover(
const std::string &message,
144 void skipUntilSpace();
145 Value ¤tValue();
147 void getLocationLineAndColumn( Location location,
150 std::string getLocationLineAndColumn( Location location )
const;
151 void addComment( Location begin,
154 void skipCommentTokens(
Token &token );
200 #endif // CPPTL_JSON_READER_H_INCLUDED Location extra_
Definition: reader.h:107
const Char * Location
Definition: reader.h:22
#define JSON_API
Definition: config.h:40
Location start_
Definition: reader.h:98
TokenType type_
Definition: reader.h:97
char Char
Definition: reader.h:21
std::stack< Value * > Nodes
Definition: reader.h:156
Location end_
Definition: reader.h:161
Location end_
Definition: reader.h:99
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
Definition: features.h:14
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Location current_
Definition: reader.h:162
Nodes nodes_
Definition: reader.h:157
Represents a JSON value.
Definition: value.h:114
Unserialize a JSON document into a Value.
Definition: reader.h:18
std::string document_
Definition: reader.h:159
TokenType
Definition: reader.h:76
std::string message_
Definition: reader.h:106
bool collectComments_
Definition: reader.h:167
Token token_
Definition: reader.h:105
Errors errors_
Definition: reader.h:158
std::deque< ErrorInfo > Errors
Definition: reader.h:110
std::string commentsBefore_
Definition: reader.h:165
Location begin_
Definition: reader.h:160
Features features_
Definition: reader.h:166
std::istream & operator>>(std::istream &, Value &)
Read from 'sin' into 'root'.
CommentPlacement
Definition: value.h:38
Location lastValueEnd_
Definition: reader.h:163
Value * lastValue_
Definition: reader.h:164