20 #ifndef RIPPLE_JSON_JSON_READER_H_INCLUDED
21 #define RIPPLE_JSON_JSON_READER_H_INCLUDED
23 #define CPPTL_JSON_READER_H_INCLUDED
25 #include <ripple/json/json_forwards.h>
26 #include <ripple/json/json_value.h>
27 #include <boost/asio/buffer.hpp>
65 parse(
const char* beginDoc,
const char* endDoc,
Value& root);
78 template <
class BufferSequence>
114 explicit Token() =
default;
170 unsigned int& unicode);
176 unsigned int& unicode);
210 template <
class BufferSequence>
217 for (
auto const& b : bs)
218 s.
append(buffer_cast<char const*>(b), buffer_size(b));
219 return parse(s, root);
251 #endif // CPPTL_JSON_READER_H_INCLUDED
bool addError(std::string const &message, Token &token, Location extra=0)
void skipCommentTokens(Token &token)
bool decodeDouble(Token &token)
bool decodeString(Token &token)
bool readObject(Token &token, unsigned depth)
Unserialize a JSON document into a Value.
bool expectToken(TokenType type, Token &token, const char *message)
bool readValue(unsigned depth)
JSON (JavaScript Object Notation).
bool decodeNumber(Token &token)
bool match(Location pattern, int patternLength)
bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, unsigned int &unicode)
void getLocationLineAndColumn(Location location, int &line, int &column) const
bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, Location end, unsigned int &unicode)
std::istream & operator>>(std::istream &sin, Value &root)
Read from 'sin' into 'root'.
Reader()=default
Constructs a Reader allowing all features for parsing.
static constexpr unsigned nest_limit
bool readToken(Token &token)
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
std::string getFormatedErrorMessages() const
Returns a user friendly string that list errors in the parsed document.
bool recoverFromError(TokenType skipUntilToken)
bool readArray(Token &token, unsigned depth)
Reader::TokenType readNumber()
bool readCppStyleComment()
bool addErrorAndRecover(std::string const &message, Token &token, TokenType skipUntilToken)