6 #ifndef JSON_READER_H_INCLUDED 7 #define 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) 76 bool parse(
const std::string& document,
Value& root,
77 bool collectComments =
true);
95 bool parse(
const char* beginDoc,
const char* endDoc,
Value& root,
96 bool collectComments =
true);
100 bool parse(
IStream& is,
Value& root,
bool collectComments =
true);
111 String getFormatedErrorMessages() const;
120 String getFormattedErrorMessages() const;
138 bool pushError(const
Value& value, const
String& message);
148 bool pushError(const
Value& value, const
String& message, const
Value& extra);
159 tokenEndOfStream = 0,
170 tokenMemberSeparator,
189 using Errors = std::deque<ErrorInfo>;
191 bool readToken(Token& token);
193 bool match(
const Char* pattern,
int patternLength);
195 bool readCStyleComment();
196 bool readCppStyleComment();
200 bool readObject(Token& token);
201 bool readArray(Token& token);
202 bool decodeNumber(Token& token);
203 bool decodeNumber(Token& token,
Value& decoded);
204 bool decodeString(Token& token);
205 bool decodeString(Token& token,
String& decoded);
206 bool decodeDouble(Token& token);
207 bool decodeDouble(Token& token,
Value& decoded);
209 unsigned int& unicode);
210 bool decodeUnicodeEscapeSequence(Token& token,
Location& current,
211 Location end,
unsigned int& unicode);
212 bool addError(
const String& message, Token& token,
Location extra =
nullptr);
213 bool recoverFromError(TokenType skipUntilToken);
214 bool addErrorAndRecover(
const String& message, Token& token,
215 TokenType skipUntilToken);
216 void skipUntilSpace();
217 Value& currentValue();
219 void getLocationLineAndColumn(
Location location,
int& line,
223 void skipCommentTokens(Token& token);
228 using Nodes = std::stack<Value*>;
239 bool collectComments_{};
263 virtual bool parse(
char const* beginDoc,
char const* endDoc,
Value* root,
272 virtual CharReader* newCharReader()
const = 0;
401 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 403 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 405 #endif // JSON_READER_H_INCLUDED #define JSONCPP_DEPRECATED(message)
#define JSON_API
If defined, indicates that the source file is amalgamated to prevent private header inclusion...
Json::Value settings_
Configuration of this builder.
An error tagged with where in the JSON text it was encountered.
IStream & operator>>(IStream &, Value &)
Read from 'sin' into 'root'.
JSON (JavaScript Object Notation).
Interface for reading JSON from a char array.
Unserialize a JSON document into a Value.
bool parseFromStream(CharReader::Factory const &, IStream &, Value *root, String *errs)
Consume entire stream and use its begin/end.
Build a CharReader implementation.
Configuration passed to reader and writer.
std::basic_string< char, std::char_traits< char >, Allocator< char > > String