|
libdonut 2.3.6
Application framework for cross-platform game development in C++20
|
Syntactic analyzer for parsing input in the JSON5 format obtained from a json::Lexer. More...
#include <donut/json.hpp>
Classes | |
| struct | ConcretePropertyVisitor |
| Implementation of PropertyVisitor for freestanding classes that implement all or parts of its interface without directly inheriting from it. More... | |
| struct | ConcreteValueVisitor |
| Implementation of ValueVisitor for freestanding classes that implement all or parts of its interface without directly inheriting from it. More... | |
| class | PropertyVisitor |
| Polymorphic interface for visitation-based parsing of JSON object properties. More... | |
| struct | SkipPropertyVisitor |
| Implementation of PropertyVisitor that skips over the parsed property and discards the result. More... | |
| struct | SkipValueVisitor |
| Implementation of ValueVisitor that skips over the parsed value and discards the result. More... | |
| class | ValueVisitor |
| Polymorphic interface for visitation-based parsing of JSON values. More... | |
Public Member Functions | |
| Parser (Lexer< It > lexer) | |
| Construct a parser with an existing lexer as input. | |
| Parser (unicode::UTF8View codePoints) | |
| Construct a parser with a contiguous UTF-8 view as input. | |
| Parser (std::u8string_view jsonString) | |
| Construct a parser with a contiguous UTF-8 string as input. | |
| Parser (std::string_view jsonString) | |
| Construct a parser with a contiguous string of bytes, interpreted as UTF-8, as input. | |
| Parser (std::istream &stream) | |
| Construct a parser with an input stream as input. | |
| Parser (std::streambuf *streambuf) | |
| Construct a parser with an input stream buffer as input. | |
| void | parseFile (ValueVisitor &visitor) |
| Read a single JSON value from the input and visit it, then make sure the rest of the input only consists of whitespace. | |
| void | parseValue (ValueVisitor &visitor) |
| Read a single JSON value from the input and visit it. | |
| void | parseObject (PropertyVisitor &visitor) |
| Read a single JSON object from the input and visit each of its properties. | |
| void | parseArray (ValueVisitor &visitor) |
| Read a single JSON array from the input and visit each of its values. | |
| void | parseFile (ValueVisitor &&visitor) |
| void | parseValue (ValueVisitor &&visitor) |
| void | parseObject (PropertyVisitor &&visitor) |
| void | parseArray (ValueVisitor &&visitor) |
| template<typename Visitor > | |
| void | parseFile (Visitor visitor) |
| template<typename Visitor > | |
| void | parseValue (Visitor visitor) |
| template<typename Visitor > | |
| void | parseObject (Visitor visitor) |
| template<typename Visitor > | |
| void | parseArray (Visitor visitor) |
| void | skipFile () |
| Parse a single JSON value from the input and discard the result, then make sure the rest of the input only consists of whitespace. | |
| void | skipValue () |
| Parse a single JSON value from the input and discard the result. | |
| Value | parseFile () |
| Read a single JSON value from the input and make sure the rest of the input only consists of whitespace. | |
| Value | parseValue () |
| Read a single JSON value from the input. | |
| Null | parseNull () |
| Read a single JSON value of type Null from the input. | |
| Boolean | parseBoolean () |
| Read a single JSON value of type Boolean from the input. | |
| String | parseString () |
| Read a single JSON value of type String from the input. | |
| Number | parseNumber () |
| Read a single JSON value of type Number from the input. | |
| Object | parseObject () |
| Read a single JSON value of type Object from the input. | |
| Array | parseArray () |
| Read a single JSON value of type Array from the input. | |
| void | advance () |
| Advance the internal state of the underlying lexer by one token. | |
| const Token & | peek () const |
| Peek the next token without advancing the internal state of the underlying lexer. | |
| Token | eat () |
| Scan and consume the next token from the input. | |
Syntactic analyzer for parsing input in the JSON5 format obtained from a json::Lexer.
| It | iterator type of the underlying input source. Must be an input iterator. |
|
inlineexplicit |
Construct a parser with an existing lexer as input.
| lexer | lexer to scan JSON tokens from. |
|
inlineexplicit |
Construct a parser with a contiguous UTF-8 view as input.
| codePoints | non-owning read-only view over the UTF-8 string to parse JSON tokens from. |
|
inlineexplicit |
Construct a parser with a contiguous UTF-8 string as input.
| jsonString | non-owning read-only view over the UTF-8 string to parse JSON tokens from. |
|
inlineexplicit |
Construct a parser with a contiguous string of bytes, interpreted as UTF-8, as input.
| jsonString | non-owning read-only view over the byte string to parse JSON tokens from. |
|
inlineexplicit |
Construct a parser with an input stream as input.
| stream | input stream to parse JSON tokens from. |
|
inlineexplicit |
Construct a parser with an input stream buffer as input.
| streambuf | input stream buffer to parse JSON tokens from. |
|
inline |
Read a single JSON value from the input and visit it, then make sure the rest of the input only consists of whitespace.
| visitor | visitor to give the parsed value to. |
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
Read a single JSON value from the input and visit it.
| visitor | visitor to give the parsed value to. |
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
Read a single JSON object from the input and visit each of its properties.
| visitor | visitor to give each parsed property of the object to. |
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
Read a single JSON array from the input and visit each of its values.
| visitor | visitor to give each parsed value of the array to. |
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
| any | exception thrown by the visitor. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Parse a single JSON value from the input and discard the result, then make sure the rest of the input only consists of whitespace.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Parse a single JSON value from the input and discard the result.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value from the input and make sure the rest of the input only consists of whitespace.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Null from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Boolean from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type String from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Number from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Object from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Read a single JSON value of type Array from the input.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Advance the internal state of the underlying lexer by one token.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Peek the next token without advancing the internal state of the underlying lexer.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |
|
inline |
Scan and consume the next token from the input.
This advances the internal state of the underlying lexer.
| json::Error | on invalid input. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the underlying input iterator. |