|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Classes | |
| class | ObjectBase |
| JSON object type whose API mimics that of std::map<String, Value>. More... | |
| class | ArrayBase |
| JSON array type whose API mimics that of std::vector<Value>. More... | |
| struct | SourceLocation |
| Line and column numbers of a location in a JSON source string. More... | |
| struct | Error |
| Exception type for errors originating from the JSON API. More... | |
| struct | SerializationOptions |
| Options for JSON serialization. More... | |
| struct | DeserializationOptions |
| Options for JSON deserialization. More... | |
| class | VariantBase |
| JSON value type. More... | |
| class | ValueBase |
| JSON value with an associated SourceLocation. More... | |
| struct | TokenBase |
| Token data scanned from JSON. More... | |
| class | Lexer |
| Lexical analyzer for scanning and tokenizing input in the JSON5 format. More... | |
| class | Parser |
| Syntactic analyzer for parsing input in the JSON5 format obtained from a json::Lexer. More... | |
| struct | Serializer |
| Base template to specialize in order to implement JSON serialization for a specific type. More... | |
| struct | Deserializer |
| Base template to specialize in order to implement JSON deserialization for a specific type. More... | |
| struct | Writer |
| Stateful wrapper object of an output stream for JSON serialization. More... | |
| struct | Reader |
| Stateful wrapper object of an input stream for JSON deserialization. More... | |
| struct | Serializer< grem::physics::Quantity< N, UnitT > > |
| struct | Deserializer< grem::physics::Quantity< N, UnitT > > |
Typedefs | |
| using | Null = Monostate |
| JSON null type. | |
| using | Boolean = bool |
| JSON boolean type. | |
| template<template< typename > typename Allocator> | |
| using | StringBase = grem::StringBase<char, std::char_traits<char>, Allocator<char>> |
| JSON string type. | |
| using | String = StringBase<std::allocator> |
| JSON string type using the default allocator. | |
| using | Number = double |
| JSON number type. | |
| using | Object = json::ObjectBase<std::allocator> |
| JSON object type using the default allocator. | |
| using | Array = json::ArrayBase<std::allocator> |
| JSON array type using the default allocator. | |
| using | Variant = json::VariantBase<std::allocator> |
| JSON value type using the default allocator. | |
| using | Value = json::ValueBase<std::allocator> |
| JSON value type with an associated SourceLocation using the default allocator. | |
| template<template< typename > typename Allocator> | |
| using | StringParserBase = Parser<const char8_t*, Allocator> |
| Parser for reading contiguous UTF-8-encoded JSON strings. | |
| using | StringParser = StringParserBase<std::allocator> |
| Parser for reading contiguous UTF-8-encoded JSON strings using the default allocator. | |
| template<template< typename > typename Allocator> | |
| using | StreamParserBase = Parser<std::istreambuf_iterator<char>, Allocator> |
| Parser for reading UTF-8-encoded JSON input stream buffers. | |
| using | StreamParser = StreamParserBase<std::allocator> |
| Parser for reading UTF-8-encoded JSON input stream buffers using the default allocator. | |
Enumerations | |
| enum class | TokenType : uint8_t { END_OF_FILE , IDENTIFIER_NULL , IDENTIFIER_FALSE , IDENTIFIER_TRUE , IDENTIFIER_NAME , PUNCTUATOR_COMMA , PUNCTUATOR_COLON , PUNCTUATOR_OPEN_SQUARE_BRACKET , PUNCTUATOR_CLOSE_SQUARE_BRACKET , PUNCTUATOR_OPEN_CURLY_BRACE , PUNCTUATOR_CLOSE_CURLY_BRACE , STRING , NUMBER_BINARY , NUMBER_OCTAL , NUMBER_DECIMAL , NUMBER_HEXADECIMAL , NUMBER_POSITIVE_INFINITY , NUMBER_NEGATIVE_INFINITY , NUMBER_POSITIVE_NAN , NUMBER_NEGATIVE_NAN } |
| Type of a scanned JSON5 token. More... | |
Functions | |
| template<template< typename > typename Allocator, typename Predicate> | |
| ObjectBase< Allocator >::size_type | erase_if (ObjectBase< Allocator > &container, Predicate predicate) |
| template<template< typename > typename Allocator, typename U> | |
| ArrayBase< Allocator >::size_type | erase (ArrayBase< Allocator > &container, const U &value) |
| template<template< typename > typename Allocator, typename Predicate> | |
| ArrayBase< Allocator >::size_type | erase_if (ArrayBase< Allocator > &container, Predicate predicate) |
| constexpr bool | isWhitespace (char32_t codePoint) noexcept |
| Check if a Unicode code point is considered to be whitespace in JSON5. | |
| constexpr bool | isPunctuationCharacter (char32_t codePoint) noexcept |
| Check if a Unicode code point is considered to be punctuation in JSON5. | |
| constexpr bool | isLineTerminatorCharacter (char32_t codePoint) noexcept |
| Check if a Unicode code point marks the beginning of a line terminator sequence in JSON5. | |
| template<typename T, typename SerializerOverride = detail::NoSerializerOverride> | |
| void | serialize (std::ostream &stream, const T &value, const SerializationOptions &options={}, SerializerOverride serializerOverride={}) |
| Serialize a value of any JSON-serializable type to an output stream. | |
| template<typename T, typename DeserializerOverride = detail::NoDeserializerOverride> | |
| void | deserialize (std::istream &stream, T &value, const DeserializationOptions &options={}, DeserializerOverride deserializerOverride={}, const SourceLocation &source={}) |
| Deserialize a value of any JSON-serializable type from an input stream. | |
| template<template< typename > typename Allocator> | |
| std::ostream & | operator<< (std::ostream &stream, const ObjectBase< Allocator > &value) |
| Write a JSON object to an output stream using the default serialization options. | |
| template<template< typename > typename Allocator> | |
| std::istream & | operator>> (std::istream &stream, ObjectBase< Allocator > &value) |
| Read a JSON object from an input stream using the default deserialization options. | |
| template<template< typename > typename Allocator> | |
| std::ostream & | operator<< (std::ostream &stream, const ArrayBase< Allocator > &value) |
| Write a JSON array to an output stream using the default serialization options. | |
| template<template< typename > typename Allocator> | |
| std::istream & | operator>> (std::istream &stream, ArrayBase< Allocator > &value) |
| Read a JSON array from an input stream using the default deserialization options. | |
| template<template< typename > typename Allocator> | |
| std::ostream & | operator<< (std::ostream &stream, const VariantBase< Allocator > &value) |
| Write a JSON value to an output stream using the default serialization options. | |
| template<template< typename > typename Allocator> | |
| std::istream & | operator>> (std::istream &stream, VariantBase< Allocator > &value) |
| Read a JSON value from an input stream using the default deserialization options. | |
| template<template< typename > typename Allocator> | |
| std::ostream & | operator<< (std::ostream &stream, const ValueBase< Allocator > &value) |
| Write a JSON value to an output stream using the default serialization options. | |
| template<template< typename > typename Allocator> | |
| std::istream & | operator>> (std::istream &stream, ValueBase< Allocator > &value) |
| Read a JSON value from an input stream using the default deserialization options. | |
| template<typename T, typename SerializerOverride = detail::NoSerializerOverride, typename Allocator = std::allocator<char>> | |
| grem::StringBase< char, std::char_traits< char >, Allocator > | serializeToString (const T &value, const SerializationOptions &options={}, SerializerOverride serializerOverride={}, const Allocator &allocator=Allocator()) |
| Serialize a value of any JSON-serializable type to a string. | |
| template<typename T, typename DeserializerOverride = detail::NoDeserializerOverride, typename Allocator = std::allocator<char>> | |
| void | deserializeFromString (grem::StringBase< char, std::char_traits< char >, Allocator > string, T &value, const DeserializationOptions &options={}, DeserializerOverride deserializerOverride={}, const SourceLocation &source={}) |
| Deserialize a value of any JSON-serializable type from a string. | |
| template<typename T, typename DeserializerOverride = detail::NoDeserializerOverride, typename Allocator = std::allocator<char>> | |
| T | deserializeFromString (grem::StringBase< char, std::char_traits< char >, Allocator > string, const DeserializationOptions &options={}, DeserializerOverride deserializerOverride={}, const SourceLocation &source={}) |
| Deserialize a value of any JSON-serializable type from a string. | |
| template<typename Callback> | |
| auto | onNull (Callback callback) |
| Build a Parser::ValueVisitor that handles Null values with a given callback function. | |
| template<typename Callback> | |
| auto | onBoolean (Callback callback) |
| Build a Parser::ValueVisitor that handles Boolean values with a given callback function. | |
| template<typename Callback> | |
| auto | onString (Callback callback) |
| Build a Parser::ValueVisitor that handles String values with a given callback function. | |
| template<typename Callback> | |
| auto | onNumber (Callback callback) |
| Build a Parser::ValueVisitor that handles Number values with a given callback function. | |
| template<typename Callback> | |
| auto | onObject (Callback callback) |
| Build a Parser::ValueVisitor that handles objects with a given callback function. | |
| template<typename Callback> | |
| auto | onArray (Callback callback) |
| Build a Parser::ValueVisitor that handles arrays with a given callback function. | |
| template<typename Callback> | |
| auto | onProperty (Callback callback) |
| Build a Parser::PropertyVisitor that handles object properties with a given callback function. | |
| template<template< typename > typename Allocator> | |
| void | swap (ObjectBase< Allocator > &a, ObjectBase< Allocator > &b) noexcept |
| template<template< typename > typename Allocator> | |
| void | swap (ArrayBase< Allocator > &a, ArrayBase< Allocator > &b) noexcept |
| using grem::json::Null = Monostate |
JSON null type.
| using grem::json::Boolean = bool |
JSON boolean type.
| using grem::json::StringBase = grem::StringBase<char, std::char_traits<char>, Allocator<char>> |
JSON string type.
| Allocator | allocator type template to use. |
| using grem::json::String = StringBase<std::allocator> |
JSON string type using the default allocator.
| using grem::json::Number = double |
JSON number type.
| using grem::json::Object = json::ObjectBase<std::allocator> |
JSON object type using the default allocator.
| using grem::json::Array = json::ArrayBase<std::allocator> |
JSON array type using the default allocator.
| typedef json::VariantBase< std::allocator > grem::json::Variant = json::VariantBase<std::allocator> |
JSON value type using the default allocator.
| using grem::json::Value = json::ValueBase<std::allocator> |
JSON value type with an associated SourceLocation using the default allocator.
| using grem::json::StringParserBase = Parser<const char8_t*, Allocator> |
Parser for reading contiguous UTF-8-encoded JSON strings.
| using grem::json::StringParser = StringParserBase<std::allocator> |
Parser for reading contiguous UTF-8-encoded JSON strings using the default allocator.
| using grem::json::StreamParserBase = Parser<std::istreambuf_iterator<char>, Allocator> |
Parser for reading UTF-8-encoded JSON input stream buffers.
| using grem::json::StreamParser = StreamParserBase<std::allocator> |
Parser for reading UTF-8-encoded JSON input stream buffers using the default allocator.
|
strong |
Type of a scanned JSON5 token.
|
inline |
|
inline |
|
inline |
|
nodiscardconstexprnoexcept |
Check if a Unicode code point is considered to be whitespace in JSON5.
| codePoint | code point value to check. |
|
nodiscardconstexprnoexcept |
Check if a Unicode code point is considered to be punctuation in JSON5.
| codePoint | code point value to check. |
|
nodiscardconstexprnoexcept |
Check if a Unicode code point marks the beginning of a line terminator sequence in JSON5.
| codePoint | code point value to check. |
|
inline |
Serialize a value of any JSON-serializable type to an output stream.
| stream | stream to write the output to. |
| value | value to serialize. |
| options | serialization options, see SerializationOptions. |
| serializerOverride | overloaded function object that overrides the default serialization behavior for the value or its nested elements/fields whenever a call to serializerOverride(writer, value) yields a valid matching overload. |
| json::Error | on failure to serialize the value. |
| std::ios_base::failure | if thrown by the output stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by a user-defined implementation of Serializer or SerializerOverride, if one is used in the serialization of the given value type. |
|
inline |
Deserialize a value of any JSON-serializable type from an input stream.
| stream | stream to read the input from. |
| value | value to deserialize to. |
| options | deserialization options, see DeserializationOptions. |
| deserializerOverride | overloaded function object that overrides the default deserialization behavior for the value or its nested elements/fields whenever a call to deserializerOverride(reader, value) yields a valid matching overload. |
| source | source location corresponding to the start of the given stream. |
| json::Error | on failure to parse the value from the stream. |
| std::ios_base::failure | if thrown by the input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by a user-defined implementation of Deserializer or DeserializerOverride, if one is used in the deserialization of the given value type. |
|
inline |
Write a JSON object to an output stream using the default serialization options.
| stream | stream to write the output to. |
| value | the JSON value to serialize. |
| json::Error | on failure to serialize the value. |
| std::ios_base::failure | if thrown by the output stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Read a JSON object from an input stream using the default deserialization options.
If the function fails to parse a JSON value from the stream, std::ios_base::failbit is set on the stream, which may or may not cause an exception to be thrown.
| stream | stream to read the input from. |
| value | the JSON value to deserialize to. |
| std::ios_base::failure | if thrown by the input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Write a JSON array to an output stream using the default serialization options.
| stream | stream to write the output to. |
| value | the JSON value to serialize. |
| json::Error | on failure to serialize the value. |
| std::ios_base::failure | if thrown by the output stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Read a JSON array from an input stream using the default deserialization options.
If the function fails to parse a JSON value from the stream, std::ios_base::failbit is set on the stream, which may or may not cause an exception to be thrown.
| stream | stream to read the input from. |
| value | the JSON value to deserialize to. |
| std::ios_base::failure | if thrown by the input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Write a JSON value to an output stream using the default serialization options.
| stream | stream to write the output to. |
| value | the JSON value to serialize. |
| json::Error | on failure to serialize the value. |
| std::ios_base::failure | if thrown by the output stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Read a JSON value from an input stream using the default deserialization options.
If the function fails to parse a JSON value from the stream, std::ios_base::failbit is set on the stream, which may or may not cause an exception to be thrown.
| stream | stream to read the input from. |
| value | the JSON value to deserialize to. |
| std::ios_base::failure | if thrown by the input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Write a JSON value to an output stream using the default serialization options.
| stream | stream to write the output to. |
| value | the JSON value to serialize. |
| json::Error | on failure to serialize the value. |
| std::ios_base::failure | if thrown by the output stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Read a JSON value from an input stream using the default deserialization options.
If the function fails to parse a JSON value from the stream, std::ios_base::failbit is set on the stream, which may or may not cause an exception to be thrown.
| stream | stream to read the input from. |
| value | the JSON value to deserialize to. |
| std::ios_base::failure | if thrown by the input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Serialize a value of any JSON-serializable type to a string.
| value | value to serialize. |
| options | serialization options, see SerializationOptions. |
| serializerOverride | overloaded function object that overrides the default serialization behavior for the value or its nested elements/fields whenever a call to serializerOverride(writer, value) yields a valid matching overload. |
| allocator | allocator to use for the string. |
| json::Error | on failure to serialize the value. |
| std::ios_base::failure | if thrown by the internal output stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by a user-defined implementation of Serializer or SerializerOverride, if one is used in the serialization of the given value type. |
|
inline |
Deserialize a value of any JSON-serializable type from a string.
| string | string to read from. |
| value | value to deserialize to. |
| options | deserialization options, see DeserializationOptions. |
| deserializerOverride | overloaded function object that overrides the default deserialization behavior for the value or its nested elements/fields whenever a call to deserializerOverride(reader, value) yields a valid matching overload. |
| source | source location corresponding to the start of the given JSON string. |
| json::Error | on failure to deserialize the value. |
| std::ios_base::failure | if thrown by the internal input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by a user-defined implementation of Deserializer or DeserializerOverride, if one is used in the serialization of the given value type. |
|
inlinenodiscard |
Deserialize a value of any JSON-serializable type from a string.
| T | JSON-deserializable value type to deserialize. |
| string | string to read from. |
| options | deserialization options, see DeserializationOptions. |
| deserializerOverride | overloaded function object that overrides the default deserialization behavior for the value or its nested elements/fields whenever a call to deserializerOverride(reader, value) yields a valid matching overload. |
| source | source location corresponding to the start of the given JSON string. |
| json::Error | on failure to deserialize the value. |
| std::ios_base::failure | if thrown by the internal input stream. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by a user-defined implementation of Deserializer or DeserializerOverride, if one is used in the serialization of the given value type. |
|
inlinenodiscard |
Build a Parser::ValueVisitor that handles Null values with a given callback function.
| callback | function object that is callable with the same signature as ValueVisitor::visitNull() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenodiscard |
Build a Parser::ValueVisitor that handles Boolean values with a given callback function.
| callback | function object that is callable with the same signature as ValueVisitor::visitBoolean() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenodiscard |
Build a Parser::ValueVisitor that handles String values with a given callback function.
| callback | function object that is callable with the same signature as ValueVisitor::visitString() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenodiscard |
Build a Parser::ValueVisitor that handles Number values with a given callback function.
| callback | function object that is callable with the same signature as ValueVisitor::visitNumber() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenodiscard |
Build a Parser::ValueVisitor that handles objects with a given callback function.
| callback | function object that is callable with the same signature as ValueVisitor::visitObject() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenodiscard |
Build a Parser::ValueVisitor that handles arrays with a given callback function.
| callback | function object that is callable with the same signature as ValueVisitor::visitArray() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenodiscard |
Build a Parser::PropertyVisitor that handles object properties with a given callback function.
| callback | function object that is callable with the same signature as PropertyVisitor::visitProperty() and has the same semantics. |
| any | exception thrown by the move constructor of the callback type. |
|
inlinenoexcept |