1#ifndef XRPL_JSON_JSON_READER_H_INCLUDED
2#define XRPL_JSON_JSON_READER_H_INCLUDED
4#define CPPTL_JSON_READER_H_INCLUDED
6#include <xrpl/json/json_forwards.h>
7#include <xrpl/json/json_value.h>
9#include <boost/asio/buffer.hpp>
48 parse(
char const* beginDoc,
char const* endDoc,
Value& root);
61 template <
class BufferSequence>
153 unsigned int& unicode);
159 unsigned int& unicode);
193template <
class BufferSequence>
200 for (
auto const& b : bs)
201 s.
append(
static_cast<char const*
>(b.data()), buffer_size(b));
202 return parse(s, root);
Unserialize a JSON document into a Value.
Reader()=default
Constructs a Reader allowing all features for parsing.
void skipCommentTokens(Token &token)
bool addErrorAndRecover(std::string const &message, Token &token, TokenType skipUntilToken)
bool decodeDouble(Token &token)
std::string getFormatedErrorMessages() const
Returns a user friendly string that list errors in the parsed document.
bool match(Location pattern, int patternLength)
bool expectToken(TokenType type, Token &token, char const *message)
bool decodeNumber(Token &token)
bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, Location end, unsigned int &unicode)
bool readCppStyleComment()
static constexpr unsigned nest_limit
bool readToken(Token &token)
bool readValue(unsigned depth)
void getLocationLineAndColumn(Location location, int &line, int &column) const
bool recoverFromError(TokenType skipUntilToken)
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, unsigned int &unicode)
bool decodeString(Token &token)
bool readArray(Token &token, unsigned depth)
bool addError(std::string const &message, Token &token, Location extra=0)
Reader::TokenType readNumber()
bool readObject(Token &token, unsigned depth)
JSON (JavaScript Object Notation).
std::istream & operator>>(std::istream &, Value &)
Read from 'sin' into 'root'.