GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::json::ValueBase< Allocator > Class Template Reference

JSON value with an associated SourceLocation. More...

#include <GREM/core/formats/json.hpp>

Inheritance diagram for grem::json::ValueBase< Allocator >:

Public Member Functions

 ValueBase (VariantBase< Allocator > value, const allocator_type &allocator)
 Construct a JSON value.
 ValueBase (VariantBase< Allocator > value)
 Construct a JSON value.
 ValueBase (VariantBase< Allocator > value, const SourceLocation &source)
 Construct a JSON value with an associated source location.
 ValueBase (VariantBase< Allocator > value, const SourceLocation &source, const allocator_type &allocator)
 Construct a JSON value with an associated source location.
 ~ValueBase ()=default
 Destructor.
 ValueBase (const ValueBase &other, const allocator_type &allocator) noexcept
 Copy constructor.
 ValueBase (const ValueBase &other)=default
 Copy constructor.
 ValueBase (ValueBase &&other, const allocator_type &allocator) noexcept
 Move constructor.
 ValueBase (ValueBase &&other) noexcept=default
 Move constructor.
ValueBase & operator= (const ValueBase &other)=default
 Copy assignment.
ValueBase & operator= (ValueBase &&other) noexcept(std::allocator_traits< allocator_type >::propagate_on_container_move_assignment::value||//NOLINT(cppcoreguidelines-noexcept-move-operations, performance-noexcept-move-constructor) std::allocator_traits< allocator_type >::is_always_equal::value)=default
 Move assignment.
GREM_ALWAYS_INLINE bool isNull () const noexcept
 Check if this value is of type Null.
GREM_ALWAYS_INLINE Null & getNull () &
 Get this value as Null, throwing an exception if it is not actually null.
GREM_ALWAYS_INLINE const Null & getNull () const &
 Get this value as Null, throwing an exception if it is not actually null.
GREM_ALWAYS_INLINE Null && getNull () &&
 Get this value as Null, throwing an exception if it is not actually null.
GREM_ALWAYS_INLINE const Null & getNull () const &&
 Get this value as Null, throwing an exception if it is not actually null.
GREM_ALWAYS_INLINE bool isBoolean () const noexcept
 Check if this value is of type Boolean.
GREM_ALWAYS_INLINE Boolean & getBoolean () &
 Get this value as a Boolean, throwing an exception if it is not actually a boolean.
GREM_ALWAYS_INLINE const Boolean & getBoolean () const &
 Get this value as a Boolean, throwing an exception if it is not actually a boolean.
GREM_ALWAYS_INLINE Boolean && getBoolean () &&
 Get this value as a Boolean, throwing an exception if it is not actually a boolean.
GREM_ALWAYS_INLINE const Boolean && getBoolean () const &&
 Get this value as a Boolean, throwing an exception if it is not actually a boolean.
GREM_ALWAYS_INLINE bool isString () const noexcept
 Check if this value is of type String.
GREM_ALWAYS_INLINE const StringBase< Allocator > & getString () const &
 Get this value as a String, throwing an exception if it is not actually a string.
GREM_ALWAYS_INLINE StringBase< Allocator > & getString () &
 Get this value as a String, throwing an exception if it is not actually a string.
GREM_ALWAYS_INLINE StringBase< Allocator > && getString () &&
 Get this value as a String, throwing an exception if it is not actually a string.
GREM_ALWAYS_INLINE const StringBase< Allocator > && getString () const &&
 Get this value as a String, throwing an exception if it is not actually a string.
GREM_ALWAYS_INLINE bool isNumber () const noexcept
 Check if this value is of type Number.
GREM_ALWAYS_INLINE Number & getNumber () &
 Get this value as a Number, throwing an exception if it is not actually a number.
GREM_ALWAYS_INLINE const Number & getNumber () const &
 Get this value as a Number, throwing an exception if it is not actually a number.
GREM_ALWAYS_INLINE Number && getNumber () &&
 Get this value as a Number, throwing an exception if it is not actually a number.
GREM_ALWAYS_INLINE const Number && getNumber () const &&
 Get this value as a Number, throwing an exception if it is not actually a number.
template<typename T>
GREM_ALWAYS_INLINE T getNumber () const
 Get this value as a Number, throwing an exception if it is not actually a number, or not the correct kind of number.
GREM_ALWAYS_INLINE bool isObject () const noexcept
 Check if this value is of type Object.
GREM_ALWAYS_INLINE ObjectBase< Allocator > & getObject () &
 Get this value as an Object, throwing an exception if it is not actually an object.
GREM_ALWAYS_INLINE const ObjectBase< Allocator > & getObject () const &
 Get this value as an Object, throwing an exception if it is not actually an object.
GREM_ALWAYS_INLINE ObjectBase< Allocator > && getObject () &&
 Get this value as an Object, throwing an exception if it is not actually an object.
GREM_ALWAYS_INLINE const ObjectBase< Allocator > && getObject () const &&
 Get this value as an Object, throwing an exception if it is not actually an object.
GREM_ALWAYS_INLINE bool isArray () const noexcept
 Check if this value is of type Array.
GREM_ALWAYS_INLINE size_t getArraySize () const
 Get the size of the Array in this value, throwing an exception if it is not actually an array.
GREM_ALWAYS_INLINE ArrayBase< Allocator > & getArray () &
 Get this value as an Array, throwing an exception if it is not actually an array.
GREM_ALWAYS_INLINE const ArrayBase< Allocator > & getArray () const &
 Get this value as an Array, throwing an exception if it is not actually an array.
GREM_ALWAYS_INLINE ArrayBase< Allocator > && getArray () &&
 Get this value as an Array, throwing an exception if it is not actually an array.
GREM_ALWAYS_INLINE const ArrayBase< Allocator > && getArray () const &&
 Get this value as an Array, throwing an exception if it is not actually an array.
GREM_ALWAYS_INLINE bool hasProperty (StringView key) const noexcept
 Check if this value is of type Object and has a property with a given key.
GREM_ALWAYS_INLINE ValueBase< Allocator > * findProperty (StringView key) noexcept
 Get a property of the Object in this value, returning nullptr if it is not actually an object or if the property doesn't exist.
GREM_ALWAYS_INLINE const ValueBase< Allocator > * findProperty (StringView key) const noexcept
 Get a property of the Object in this value, returning nullptr if it is not actually an object or if the property doesn't exist.
GREM_ALWAYS_INLINE ValueBase< Allocator > & getProperty (StringView key) &
 Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.
GREM_ALWAYS_INLINE const ValueBase< Allocator > & getProperty (StringView key) const &
 Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.
GREM_ALWAYS_INLINE ValueBase< Allocator > && getProperty (StringView key) &&
 Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.
GREM_ALWAYS_INLINE const ValueBase< Allocator > && getProperty (StringView key) const &&
 Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.
GREM_ALWAYS_INLINE bool hasItem (size_t index) const noexcept
 Check if this value is of type Array and has an item at the given index.
GREM_ALWAYS_INLINE ValueBase< Allocator > * findItem (size_t index) noexcept
 Get an item of the Array in this value, returning nullptr if it is not actually an array or if the index is out of range.
GREM_ALWAYS_INLINE const ValueBase< Allocator > * findItem (size_t index) const noexcept
 Get an item of the Array in this value, returning nullptr if it is not actually an array or if the index is out of range.
GREM_ALWAYS_INLINE ValueBase< Allocator > & getItem (size_t index) &
 Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.
GREM_ALWAYS_INLINE const ValueBase< Allocator > & getItem (size_t index) const &
 Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.
GREM_ALWAYS_INLINE ValueBase< Allocator > && getItem (size_t index) &&
 Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.
GREM_ALWAYS_INLINE const ValueBase< Allocator > && getItem (size_t index) const &&
 Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.
GREM_ALWAYS_INLINE Null & getNullProperty (StringView key) &
 Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.
GREM_ALWAYS_INLINE const Null & getNullProperty (StringView key) const &
 Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.
GREM_ALWAYS_INLINE Null && getNullProperty (StringView key) &&
 Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.
GREM_ALWAYS_INLINE const Null & getNullProperty (StringView key) const &&
 Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.
GREM_ALWAYS_INLINE Null & getNullItem (size_t index) &
 Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.
GREM_ALWAYS_INLINE const Null & getNullItem (size_t index) const &
 Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.
GREM_ALWAYS_INLINE Null && getNullItem (size_t index) &&
 Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.
GREM_ALWAYS_INLINE const Null & getNullItem (size_t index) const &&
 Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.
GREM_ALWAYS_INLINE Boolean & getBooleanProperty (StringView key) &
 Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.
GREM_ALWAYS_INLINE const Boolean & getBooleanProperty (StringView key) const &
 Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.
GREM_ALWAYS_INLINE Boolean && getBooleanProperty (StringView key) &&
 Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.
GREM_ALWAYS_INLINE const Boolean & getBooleanProperty (StringView key) const &&
 Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.
GREM_ALWAYS_INLINE Boolean & getBooleanItem (size_t index) &
 Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.
GREM_ALWAYS_INLINE const Boolean & getBooleanItem (size_t index) const &
 Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.
GREM_ALWAYS_INLINE Boolean && getBooleanItem (size_t index) &&
 Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.
GREM_ALWAYS_INLINE const Boolean & getBooleanItem (size_t index) const &&
 Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.
GREM_ALWAYS_INLINE String & getStringProperty (StringView key) &
 Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.
GREM_ALWAYS_INLINE const String & getStringProperty (StringView key) const &
 Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.
GREM_ALWAYS_INLINE String && getStringProperty (StringView key) &&
 Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.
GREM_ALWAYS_INLINE const String & getStringProperty (StringView key) const &&
 Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.
GREM_ALWAYS_INLINE String & getStringItem (size_t index) &
 Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.
GREM_ALWAYS_INLINE const String & getStringItem (size_t index) const &
 Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.
GREM_ALWAYS_INLINE String && getStringItem (size_t index) &&
 Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.
GREM_ALWAYS_INLINE const String & getStringItem (size_t index) const &&
 Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.
GREM_ALWAYS_INLINE Number & getNumberProperty (StringView key) &
 Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.
GREM_ALWAYS_INLINE const Number & getNumberProperty (StringView key) const &
 Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.
GREM_ALWAYS_INLINE Number && getNumberProperty (StringView key) &&
 Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.
GREM_ALWAYS_INLINE const Number & getNumberProperty (StringView key) const &&
 Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.
template<typename T>
GREM_ALWAYS_INLINE T getNumberProperty (StringView key) const
 Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number, or not the correct kind of number.
GREM_ALWAYS_INLINE Number & getNumberItem (size_t index) &
 Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.
GREM_ALWAYS_INLINE const Number & getNumberItem (size_t index) const &
 Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.
GREM_ALWAYS_INLINE Number && getNumberItem (size_t index) &&
 Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.
GREM_ALWAYS_INLINE const Number & getNumberItem (size_t index) const &&
 Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.
template<typename T>
GREM_ALWAYS_INLINE T getNumberItem (size_t index) const
 Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number, or not the correct kind of number.
GREM_ALWAYS_INLINE Object & getObjectProperty (StringView key) &
 Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.
GREM_ALWAYS_INLINE const Object & getObjectProperty (StringView key) const &
 Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.
GREM_ALWAYS_INLINE Object && getObjectProperty (StringView key) &&
 Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.
GREM_ALWAYS_INLINE const Object & getObjectProperty (StringView key) const &&
 Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.
GREM_ALWAYS_INLINE Object & getObjectItem (size_t index) &
 Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.
GREM_ALWAYS_INLINE const Object & getObjectItem (size_t index) const &
 Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.
GREM_ALWAYS_INLINE Object && getObjectItem (size_t index) &&
 Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.
GREM_ALWAYS_INLINE const Object & getObjectItem (size_t index) const &&
 Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.
GREM_ALWAYS_INLINE Array & getArrayProperty (StringView key) &
 Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.
GREM_ALWAYS_INLINE const Array & getArrayProperty (StringView key) const &
 Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.
GREM_ALWAYS_INLINE Array && getArrayProperty (StringView key) &&
 Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.
GREM_ALWAYS_INLINE const Array & getArrayProperty (StringView key) const &&
 Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.
GREM_ALWAYS_INLINE Array & getArrayItem (size_t index) &
 Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.
GREM_ALWAYS_INLINE const Array & getArrayItem (size_t index) const &
 Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.
GREM_ALWAYS_INLINE Array && getArrayItem (size_t index) &&
 Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.
GREM_ALWAYS_INLINE const Array & getArrayItem (size_t index) const &&
 Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.
GREM_ALWAYS_INLINE SourceLocation getSource () const noexcept
 Get the source location of this value.
GREM_ALWAYS_INLINE bool operator== (const ValueBase &other) const
 Compare this value to another for equality.
Public Member Functions inherited from grem::json::VariantBase< Allocator >
 VariantBase () noexcept
 Construct a Null value.
 VariantBase (const allocator_type &allocator) noexcept
 Construct a Null value.
 VariantBase (Null, const allocator_type &allocator) noexcept
 Construct a Null value.
 VariantBase (Null) noexcept
 Construct a Null value.
 VariantBase (std::nullptr_t, const allocator_type &allocator) noexcept
 Construct a Null value.
 VariantBase (std::nullptr_t) noexcept
 Construct a Null value.
 VariantBase (Boolean value, const allocator_type &allocator) noexcept
 Construct a Boolean value with the given underlying value.
 VariantBase (Boolean value) noexcept
 Construct a Boolean value with the given underlying value.
 VariantBase (const StringBase< Allocator > &value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (const StringBase< Allocator > &value)
 Construct a String value with the given underlying value.
 VariantBase (StringBase< Allocator > &&value, const allocator_type &allocator) noexcept
 Construct a String value from the given underlying value.
 VariantBase (StringBase< Allocator > &&value) noexcept
 Construct a String value from the given underlying value.
 VariantBase (const char *value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (const char *value)
 Construct a String value with the given underlying value.
 VariantBase (StringView value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (StringView value)
 Construct a String value with the given underlying value.
 VariantBase (CStringView value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (CStringView value)
 Construct a String value with the given underlying value.
 VariantBase (const char8_t *value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (const char8_t *value)
 Construct a String value with the given underlying value.
 VariantBase (UTF8StringView value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (UTF8StringView value)
 Construct a String value with the given underlying value.
 VariantBase (UTF8CStringView value, const allocator_type &allocator)
 Construct a String value with the given underlying value.
 VariantBase (UTF8CStringView value)
 Construct a String value with the given underlying value.
 VariantBase (strict_arithmetic auto value, const allocator_type &allocator) noexcept
 Construct a Number value with the given underlying value.
 VariantBase (strict_arithmetic auto value) noexcept
 Construct a Number value with the given underlying value.
 VariantBase (const ObjectBase< Allocator > &value, const allocator_type &allocator)
 Construct an Object value with the given underlying value.
 VariantBase (const ObjectBase< Allocator > &value)
 Construct an Object value with the given underlying value.
 VariantBase (ObjectBase< Allocator > &&value, const allocator_type &allocator) noexcept
 Construct an Object value from the given underlying value.
 VariantBase (ObjectBase< Allocator > &&value) noexcept
 Construct an Object value from the given underlying value.
 VariantBase (const ArrayBase< Allocator > &value, const allocator_type &allocator)
 Construct an Array value with the given underlying value.
 VariantBase (const ArrayBase< Allocator > &value)
 Construct an Array value with the given underlying value.
 VariantBase (ArrayBase< Allocator > &&value, const allocator_type &allocator) noexcept
 Construct an Array value from the given underlying value.
 VariantBase (ArrayBase< Allocator > &&value) noexcept
 Construct an Array value from the given underlying value.
 ~VariantBase ()=default
 Destructor.
 VariantBase (const VariantBase &other, const allocator_type &allocator) noexcept
 Copy constructor.
 VariantBase (const VariantBase &other)
 Copy constructor.
 VariantBase (VariantBase &&other, const allocator_type &allocator) noexcept
 Move constructor.
 VariantBase (VariantBase &&other) noexcept
 Move constructor.
VariantBase & operator= (const VariantBase &other)
 Copy assignment.
VariantBase & operator= (VariantBase &&other) noexcept(std::allocator_traits< allocator_type >::propagate_on_container_move_assignment::value||//NOLINT(cppcoreguidelines-noexcept-move-operations, performance-noexcept-move-constructor) std::allocator_traits< allocator_type >::is_always_equal::value)
 Move assignment.
allocator_type get_allocator () const noexcept
 Get the allocator used by the value.
StringBase< Allocator > toString (const SerializationOptions &options={}, const allocator_type &stringAllocator=allocator_type()) const
 Get a JSON string representation of the value.
GREM_ALWAYS_INLINE bool operator== (const VariantBase &other) const
 Compare this value to another for equality.
GREM_ALWAYS_INLINE std::partial_ordering operator<=> (const VariantBase &other) const
 Compare this value to another.
Public Member Functions inherited from grem::Variant< Null, Boolean, StringBase< Allocator >, Number, ObjectBase< Allocator >, ArrayBase< Allocator > >
constexpr Variant () noexcept(std::is_nothrow_default_constructible_v< variant_alternative_t< 0, Variant > >)
 Default-construct a variant with the first variant alternative, if it is default-constructible.
constexpr Variant (U &&value) noexcept(std::is_nothrow_constructible_v< decltype(F(std::forward< U >(value))), U >)
 Converting constructor.
constexpr Variant (std::in_place_type_t< T > type, Args &&... args)
 Construct a variant alternative in-place given its type.
constexpr Variant (std::in_place_type_t< T > type, std::initializer_list< U > ilist, Args &&... args)
 Construct a variant alternative in-place given its type, with an initializer list as the first constructor argument.
constexpr Variant (std::in_place_index_t< Index > index, Args &&... args)
 Construct a variant alternative in-place given its index.
constexpr Variant (std::in_place_index_t< Index > index, std::initializer_list< U > ilist, Args &&... args)
 Construct a variant alternative in-place given its index, with an initializer list as the first constructor argument.
constexpr ~Variant ()
 Destructor.
constexpr ~Variant ()=default
 Trivial destructor.
constexpr Variant (const Variant &other)=delete
 Deleted copy constructor.
constexpr Variant (const Variant &other)=default
 Trivial copy constructor.
constexpr Variant (const Variant &other)
 Copy constructor.
constexpr Variant (Variant &&other) noexcept=default
 Trivial move constructor.
constexpr Variant (Variant &&other) noexcept((std::is_nothrow_move_constructible_v< Ts > &&...))
 Move constructor.
constexpr Variant & operator= (const Variant &other)=delete
 Deleted copy assignment.
constexpr Variant & operator= (const Variant &other)=default
 Trivial copy assignment.
constexpr Variant & operator= (const Variant &other)
 Copy assignment.
constexpr Variant & operator= (Variant &&other) noexcept=default
 Trivial move assignment.
constexpr Variant & operator= (Variant &&other) noexcept(((std::is_nothrow_move_constructible_v< Ts > &&//NOLINT(performance-noexcept-move-constructor, cppcoreguidelines-noexcept-move-operations) std::is_nothrow_move_assignable_v< Ts >) &&...))
 Move assignment.
constexpr Variant & operator= (U &&value) noexcept(std::is_nothrow_assignable_v< decltype(F(std::forward< U >(value)))&, U > &&std::is_nothrow_constructible_v< decltype(F(std::forward< U >(value))), U >)
 Converting assignment.
constexpr T & emplace (Args &&... args)
 Construct an alternative given its type, destroying the old value.
constexpr T & emplace (std::initializer_list< U > ilist, Args &&... args)
 Construct an alternative given its type, with an initializer list as the first constructor argument, destroying the old value.
constexpr auto & emplace (Args &&... args)
 Construct an alternative given its index, destroying the old value.
constexpr auto & emplace (std::initializer_list< U > ilist, Args &&... args)
 Construct an alternative given its index, with an initializer list as the first constructor argument, destroying the old value.
constexpr void swap (Variant &other) noexcept(((std::is_nothrow_move_constructible_v< Ts > &&std::is_nothrow_swappable_v< Ts >) &&...))
 Swap this variant's value with that of another.
constexpr index_type index () const noexcept
 Get the alternative index of the currently active value held by the variant.
constexpr bool valueless_by_exception () const noexcept
 Check if the variant is in the valueless by exception state.
constexpr bool is () const noexcept
 Check if the variant currently holds the alternative with the given type.
constexpr bool is () const noexcept
 Check if the variant currently holds the alternative with the given index.
constexpr T & as () &noexcept
 Access the underlying value with the given type without a safety check.
constexpr const T & as () const &noexcept
 Access the underlying value with the given type without a safety check.
constexpr T && as () &&noexcept
 Access the underlying value with the given type without a safety check.
constexpr const T && as () const &&noexcept
 Access the underlying value with the given type without a safety check.
constexpr auto & as () &noexcept
 Access the underlying value with the given index without a safety check.
constexpr const auto & as () const &noexcept
 Access the underlying value with the given index without a safety check.
constexpr auto && as () &&noexcept
 Access the underlying value with the given index without a safety check.
constexpr const auto && as () const &&noexcept
 Access the underlying value with the given index without a safety check.
constexpr T & get () &
 Access the underlying value with the given type.
constexpr const T & get () const &
 Access the underlying value with the given type.
constexpr T && get () &&
 Access the underlying value with the given type.
constexpr const T && get () const &&
 Access the underlying value with the given type.
constexpr auto & get () &
 Access the underlying value with the given index.
constexpr const auto & get () const &
 Access the underlying value with the given index.
constexpr auto && get () &&
 Access the underlying value with the given index.
constexpr const auto && get () const &&
 Access the underlying value with the given index.
constexpr T * get_if () noexcept
 Access the underlying value with the given type if it is the currently active alternative.
constexpr const T * get_if () const noexcept
 Access the underlying value with the given type if it is the currently active alternative.
constexpr auto * get_if () noexcept
 Access the underlying value with the given index if it is the currently active alternative.
constexpr const auto * get_if () const noexcept
 Access the underlying value with the given index if it is the currently active alternative.

Static Public Member Functions

static ValueBase parse (UTF8StringView jsonString, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Parse a value of any JSON type from a UTF-8 JSON string.
static ValueBase parse (StringView jsonString, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Parse a value of any JSON type from a JSON string interpreted as UTF-8.
Static Public Member Functions inherited from grem::json::VariantBase< Allocator >
static ValueBase< Allocator > parse (UTF8StringView jsonString, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Parse a value of any JSON type from a UTF-8 JSON string.
static ValueBase< Allocator > parse (StringView jsonString, const SourceLocation &source={}, const allocator_type &allocator=allocator_type())
 Parse a value of any JSON type from a JSON string interpreted as UTF-8.
Static Public Member Functions inherited from grem::Variant< Null, Boolean, StringBase< Allocator >, Number, ObjectBase< Allocator >, ArrayBase< Allocator > >
static constexpr decltype(auto) visit (Visitor &&visitor, V &&variant)
 Call a visitor functor with the currently active underlying value of a variant.
static constexpr decltype(auto) visitIndex (index_type index, Visitor &&visitor)
 Call a visitor functor with the type corresponding to a variant index.
static constexpr decltype(auto) apply (Function &&function)
 Call a functor with all alternative types.

Additional Inherited Members

Public Types inherited from grem::json::VariantBase< Allocator >
using allocator_type = Allocator<VariantBase>
 Allocator type used by the value.
Public Types inherited from grem::Variant< Null, Boolean, StringBase< Allocator >, Number, ObjectBase< Allocator >, ArrayBase< Allocator > >
using index_type
 Index type used to encode the active alternative type.
Static Public Attributes inherited from grem::Variant< Null, Boolean, StringBase< Allocator >, Number, ObjectBase< Allocator >, ArrayBase< Allocator > >
static constexpr index_type npos
 Invalid alternative index, representing the valueless by exception state.

Detailed Description

template<template< typename > typename Allocator>
class grem::json::ValueBase< Allocator >

JSON value with an associated SourceLocation.

Template Parameters
Allocatorallocator type template to use.

Constructor & Destructor Documentation

◆ ValueBase() [1/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( VariantBase< Allocator > value,
const allocator_type & allocator )
inline

Construct a JSON value.

Parameters
valuevalue to construct this value from.
allocatorallocator to use.

◆ ValueBase() [2/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( VariantBase< Allocator > value)
inline

Construct a JSON value.

Parameters
valuevalue to construct this value from.

◆ ValueBase() [3/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( VariantBase< Allocator > value,
const SourceLocation & source )
inline

Construct a JSON value with an associated source location.

Parameters
valuevalue to construct this value from.
sourcesource location of the value.

◆ ValueBase() [4/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( VariantBase< Allocator > value,
const SourceLocation & source,
const allocator_type & allocator )
inline

Construct a JSON value with an associated source location.

Parameters
valuevalue to construct this value from.
sourcesource location of the value.
allocatorallocator to use.

◆ ~ValueBase()

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::~ValueBase ( )
default

Destructor.

◆ ValueBase() [5/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( const ValueBase< Allocator > & other,
const allocator_type & allocator )
inlinenoexcept

Copy constructor.

◆ ValueBase() [6/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( const ValueBase< Allocator > & other)
default

Copy constructor.

◆ ValueBase() [7/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( ValueBase< Allocator > && other,
const allocator_type & allocator )
inlinenoexcept

Move constructor.

◆ ValueBase() [8/8]

template<template< typename > typename Allocator>
grem::json::ValueBase< Allocator >::ValueBase ( ValueBase< Allocator > && other)
defaultnoexcept

Move constructor.

Member Function Documentation

◆ parse() [1/2]

template<template< typename > typename Allocator>
ValueBase< Allocator > grem::json::ValueBase< Allocator >::parse ( UTF8StringView jsonString,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlinestaticnodiscard

Parse a value of any JSON type from a UTF-8 JSON string.

The parser supports JSON5 features such as comments, unquoted identifiers and trailing commas.

Parameters
jsonStringread-only view over the JSON string to parse a value from.
sourcesource location corresponding to the start of the given JSON string.
allocatorallocator to use.
Returns
the parsed value.
Exceptions
json::Erroron failure to parse a JSON value.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ parse() [2/2]

template<template< typename > typename Allocator>
ValueBase< Allocator > grem::json::ValueBase< Allocator >::parse ( StringView jsonString,
const SourceLocation & source = {},
const allocator_type & allocator = allocator_type() )
inlinestaticnodiscard

Parse a value of any JSON type from a JSON string interpreted as UTF-8.

The parser supports JSON5 features such as comments, unquoted identifiers and trailing commas.

Parameters
jsonStringread-only view over the JSON string to parse a value from.
sourcesource location corresponding to the start of the given JSON string.
allocatorallocator to use.
Returns
the parsed value.
Exceptions
json::Erroron failure to parse a JSON value.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ operator=() [1/2]

template<template< typename > typename Allocator>
ValueBase & grem::json::ValueBase< Allocator >::operator= ( const ValueBase< Allocator > & other)
default

Copy assignment.

◆ operator=() [2/2]

template<template< typename > typename Allocator>
ValueBase & grem::json::ValueBase< Allocator >::operator= ( ValueBase< Allocator > && other) const
defaultnoexcept

Move assignment.

◆ isNull()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::isNull ( ) const
inlinenodiscardnoexcept

Check if this value is of type Null.

Returns
true if this value is null, false otherwise.

◆ getNull() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Null & grem::json::ValueBase< Allocator >::getNull ( ) &
inlinenodiscard

Get this value as Null, throwing an exception if it is not actually null.

Returns
a reference to the null value.
Exceptions
json::Errorif this value is not null.

◆ getNull() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Null & grem::json::ValueBase< Allocator >::getNull ( ) const &
inlinenodiscard

Get this value as Null, throwing an exception if it is not actually null.

Returns
a read-only reference to the null value.
Exceptions
json::Errorif this value is not null.

◆ getNull() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Null && grem::json::ValueBase< Allocator >::getNull ( ) &&
inlinenodiscard

Get this value as Null, throwing an exception if it is not actually null.

Returns
an rvalue reference to the null value.
Exceptions
json::Errorif this value is not null.

◆ getNull() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Null & grem::json::ValueBase< Allocator >::getNull ( ) const &&
inlinenodiscard

Get this value as Null, throwing an exception if it is not actually null.

Returns
a read-only rvalue reference to the null value.
Exceptions
json::Errorif this value is not null.

◆ isBoolean()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::isBoolean ( ) const
inlinenodiscardnoexcept

Check if this value is of type Boolean.

Returns
true if this value is a boolean, false otherwise.

◆ getBoolean() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Boolean & grem::json::ValueBase< Allocator >::getBoolean ( ) &
inlinenodiscard

Get this value as a Boolean, throwing an exception if it is not actually a boolean.

Returns
a reference to the boolean value.
Exceptions
json::Errorif this value is not a boolean.

◆ getBoolean() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Boolean & grem::json::ValueBase< Allocator >::getBoolean ( ) const &
inlinenodiscard

Get this value as a Boolean, throwing an exception if it is not actually a boolean.

Returns
a read-only reference to the boolean value.
Exceptions
json::Errorif this value is not a boolean.

◆ getBoolean() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Boolean && grem::json::ValueBase< Allocator >::getBoolean ( ) &&
inlinenodiscard

Get this value as a Boolean, throwing an exception if it is not actually a boolean.

Returns
an rvalue reference to the boolean value.
Exceptions
json::Errorif this value is not a boolean.

◆ getBoolean() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Boolean && grem::json::ValueBase< Allocator >::getBoolean ( ) const &&
inlinenodiscard

Get this value as a Boolean, throwing an exception if it is not actually a boolean.

Returns
a read-only rvalue reference to the boolean value.
Exceptions
json::Errorif this value is not a boolean.

◆ isString()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::isString ( ) const
inlinenodiscardnoexcept

Check if this value is of type String.

Returns
true if this value is a string, false otherwise.

◆ getString() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const StringBase< Allocator > & grem::json::ValueBase< Allocator >::getString ( ) const &
inlinenodiscard

Get this value as a String, throwing an exception if it is not actually a string.

Returns
a read-only reference to the the string value.
Exceptions
json::Errorif this value is not a string.

◆ getString() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE StringBase< Allocator > & grem::json::ValueBase< Allocator >::getString ( ) &
inlinenodiscard

Get this value as a String, throwing an exception if it is not actually a string.

Returns
a reference to the string value.
Exceptions
json::Errorif this value is not a string.

◆ getString() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE StringBase< Allocator > && grem::json::ValueBase< Allocator >::getString ( ) &&
inlinenodiscard

Get this value as a String, throwing an exception if it is not actually a string.

Returns
a read-only rvalue reference to the string value.
Exceptions
json::Errorif this value is not a string.

◆ getString() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const StringBase< Allocator > && grem::json::ValueBase< Allocator >::getString ( ) const &&
inlinenodiscard

Get this value as a String, throwing an exception if it is not actually a string.

Returns
an rvalue reference to the string value.
Exceptions
json::Errorif this value is not a string.

◆ isNumber()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::isNumber ( ) const
inlinenodiscardnoexcept

Check if this value is of type Number.

Returns
true if this value is a number, false otherwise.

◆ getNumber() [1/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Number & grem::json::ValueBase< Allocator >::getNumber ( ) &
inlinenodiscard

Get this value as a Number, throwing an exception if it is not actually a number.

Returns
a reference to the number value.
Exceptions
json::Errorif this value is not a number.

◆ getNumber() [2/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Number & grem::json::ValueBase< Allocator >::getNumber ( ) const &
inlinenodiscard

Get this value as a Number, throwing an exception if it is not actually a number.

Returns
a read-only reference to the number value.
Exceptions
json::Errorif this value is not a number.

◆ getNumber() [3/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Number && grem::json::ValueBase< Allocator >::getNumber ( ) &&
inlinenodiscard

Get this value as a Number, throwing an exception if it is not actually a number.

Returns
an rvalue reference to the number value.
Exceptions
json::Errorif this value is not a number.

◆ getNumber() [4/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Number && grem::json::ValueBase< Allocator >::getNumber ( ) const &&
inlinenodiscard

Get this value as a Number, throwing an exception if it is not actually a number.

Returns
a read-only rvalue reference to the number value.
Exceptions
json::Errorif this value is not a number.

◆ getNumber() [5/5]

template<template< typename > typename Allocator>
template<typename T>
GREM_ALWAYS_INLINE T grem::json::ValueBase< Allocator >::getNumber ( ) const
inlinenodiscard

Get this value as a Number, throwing an exception if it is not actually a number, or not the correct kind of number.

Template Parameters
Tnumber type to get.
Returns
the number value, converted to the given type.
Exceptions
json::Errorif this value is not a valid number of the given type.

◆ isObject()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::isObject ( ) const
inlinenodiscardnoexcept

Check if this value is of type Object.

Returns
true if this value is an object, false otherwise.

◆ getObject() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ObjectBase< Allocator > & grem::json::ValueBase< Allocator >::getObject ( ) &
inlinenodiscard

Get this value as an Object, throwing an exception if it is not actually an object.

Returns
a reference to the object value.
Exceptions
json::Errorif this value is not an object.

◆ getObject() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ObjectBase< Allocator > & grem::json::ValueBase< Allocator >::getObject ( ) const &
inlinenodiscard

Get this value as an Object, throwing an exception if it is not actually an object.

Returns
a read-only reference to the object value.
Exceptions
json::Errorif this value is not an object.

◆ getObject() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ObjectBase< Allocator > && grem::json::ValueBase< Allocator >::getObject ( ) &&
inlinenodiscard

Get this value as an Object, throwing an exception if it is not actually an object.

Returns
an rvalue reference to the object value.
Exceptions
json::Errorif this value is not an object.

◆ getObject() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ObjectBase< Allocator > && grem::json::ValueBase< Allocator >::getObject ( ) const &&
inlinenodiscard

Get this value as an Object, throwing an exception if it is not actually an object.

Returns
a read-only rvalue reference to the object value.
Exceptions
json::Errorif this value is not an object.

◆ isArray()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::isArray ( ) const
inlinenodiscardnoexcept

Check if this value is of type Array.

Returns
true if this value is an array, false otherwise.

◆ getArraySize()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE size_t grem::json::ValueBase< Allocator >::getArraySize ( ) const
inlinenodiscard

Get the size of the Array in this value, throwing an exception if it is not actually an array.

Returns
the number of elements in the array.
Exceptions
json::Errorif this value is not an array.

◆ getArray() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ArrayBase< Allocator > & grem::json::ValueBase< Allocator >::getArray ( ) &
inlinenodiscard

Get this value as an Array, throwing an exception if it is not actually an array.

Returns
a reference to the array value.
Exceptions
json::Errorif this value is not an array.

◆ getArray() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ArrayBase< Allocator > & grem::json::ValueBase< Allocator >::getArray ( ) const &
inlinenodiscard

Get this value as an Array, throwing an exception if it is not actually an array.

Returns
a read-only reference to the array value.
Exceptions
json::Errorif this value is not an array.

◆ getArray() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ArrayBase< Allocator > && grem::json::ValueBase< Allocator >::getArray ( ) &&
inlinenodiscard

Get this value as an Array, throwing an exception if it is not actually an array.

Returns
an rvalue reference to the array value.
Exceptions
json::Errorif this value is not an array.

◆ getArray() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ArrayBase< Allocator > && grem::json::ValueBase< Allocator >::getArray ( ) const &&
inlinenodiscard

Get this value as an Array, throwing an exception if it is not actually an array.

Returns
a read-only rvalue reference to the array value.
Exceptions
json::Errorif this value is not an array.

◆ hasProperty()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::hasProperty ( StringView key) const
inlinenodiscardnoexcept

Check if this value is of type Object and has a property with a given key.

Parameters
keykey of the property to check for.
Returns
true if this value is an object that has the given property, false otherwise.

◆ findProperty() [1/2]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ValueBase< Allocator > * grem::json::ValueBase< Allocator >::findProperty ( StringView key)
inlinenodiscardnoexcept

Get a property of the Object in this value, returning nullptr if it is not actually an object or if the property doesn't exist.

Parameters
keykey of the property to get.
Returns
a non-owning pointer to the specified property value, or nullptr if this value is not an object, or if the specified property doesn't exist.

◆ findProperty() [2/2]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ValueBase< Allocator > * grem::json::ValueBase< Allocator >::findProperty ( StringView key) const
inlinenodiscardnoexcept

Get a property of the Object in this value, returning nullptr if it is not actually an object or if the property doesn't exist.

Parameters
keykey of the property to get.
Returns
a non-owning read-only pointer to the specified property value, or nullptr if this value is not an object, or if the specified property doesn't exist.

◆ getProperty() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ValueBase< Allocator > & grem::json::ValueBase< Allocator >::getProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.

Parameters
keykey of the property to get.
Returns
a reference to the specified property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist.

◆ getProperty() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ValueBase< Allocator > & grem::json::ValueBase< Allocator >::getProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist.

◆ getProperty() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ValueBase< Allocator > && grem::json::ValueBase< Allocator >::getProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist.

◆ getProperty() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ValueBase< Allocator > && grem::json::ValueBase< Allocator >::getProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value, throwing an exception if it is not actually an object or if the property doesn't exist.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist.

◆ hasItem()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::hasItem ( size_t index) const
inlinenodiscardnoexcept

Check if this value is of type Array and has an item at the given index.

Parameters
indexarray index of the item to check for.
Returns
true if this value is an array that has an item at the given index, false otherwise.

◆ findItem() [1/2]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ValueBase< Allocator > * grem::json::ValueBase< Allocator >::findItem ( size_t index)
inlinenodiscardnoexcept

Get an item of the Array in this value, returning nullptr if it is not actually an array or if the index is out of range.

Parameters
indexarray index of the item to get.
Returns
a non-owning pointer to the specified item value, or nullptr if this value is not an array, or if the specified index is out of range.

◆ findItem() [2/2]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ValueBase< Allocator > * grem::json::ValueBase< Allocator >::findItem ( size_t index) const
inlinenodiscardnoexcept

Get an item of the Array in this value, returning nullptr if it is not actually an array or if the index is out of range.

Parameters
indexarray index of the item to get.
Returns
a non-owning read-only pointer to the specified item value, or nullptr if this value is not an array, or if the specified index is out of range.

◆ getItem() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ValueBase< Allocator > & grem::json::ValueBase< Allocator >::getItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range.

◆ getItem() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ValueBase< Allocator > & grem::json::ValueBase< Allocator >::getItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range.

◆ getItem() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE ValueBase< Allocator > && grem::json::ValueBase< Allocator >::getItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range.

◆ getItem() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const ValueBase< Allocator > && grem::json::ValueBase< Allocator >::getItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value, throwing an exception if it is not actually an array or if the index is out of range.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range.

◆ getNullProperty() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Null & grem::json::ValueBase< Allocator >::getNullProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.

Parameters
keykey of the property to get.
Returns
a reference to the specified null property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not null.

◆ getNullProperty() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Null & grem::json::ValueBase< Allocator >::getNullProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified null property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not null.

◆ getNullProperty() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Null && grem::json::ValueBase< Allocator >::getNullProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified null property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not null.

◆ getNullProperty() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Null & grem::json::ValueBase< Allocator >::getNullProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value as Null, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually null.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified null property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not null.

◆ getNullItem() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Null & grem::json::ValueBase< Allocator >::getNullItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified null item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not null.

◆ getNullItem() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Null & grem::json::ValueBase< Allocator >::getNullItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified null item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not null.

◆ getNullItem() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Null && grem::json::ValueBase< Allocator >::getNullItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified null item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not null.

◆ getNullItem() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Null & grem::json::ValueBase< Allocator >::getNullItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value as Null, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually null.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified null item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not null.

◆ getBooleanProperty() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Boolean & grem::json::ValueBase< Allocator >::getBooleanProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.

Parameters
keykey of the property to get.
Returns
a reference to the specified boolean property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a boolean.

◆ getBooleanProperty() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Boolean & grem::json::ValueBase< Allocator >::getBooleanProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified boolean property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a boolean.

◆ getBooleanProperty() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Boolean && grem::json::ValueBase< Allocator >::getBooleanProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified boolean property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a boolean.

◆ getBooleanProperty() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Boolean & grem::json::ValueBase< Allocator >::getBooleanProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value as a Boolean, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a boolean.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified boolean property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a boolean.

◆ getBooleanItem() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Boolean & grem::json::ValueBase< Allocator >::getBooleanItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified boolean item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a boolean.

◆ getBooleanItem() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Boolean & grem::json::ValueBase< Allocator >::getBooleanItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified boolean item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a boolean.

◆ getBooleanItem() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Boolean && grem::json::ValueBase< Allocator >::getBooleanItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified boolean item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a boolean.

◆ getBooleanItem() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Boolean & grem::json::ValueBase< Allocator >::getBooleanItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value as a Boolean, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a boolean.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified boolean item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a boolean.

◆ getStringProperty() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE String & grem::json::ValueBase< Allocator >::getStringProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.

Parameters
keykey of the property to get.
Returns
a reference to the specified string property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a string.

◆ getStringProperty() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const String & grem::json::ValueBase< Allocator >::getStringProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified string property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a string.

◆ getStringProperty() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE String && grem::json::ValueBase< Allocator >::getStringProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified string property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a string.

◆ getStringProperty() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const String & grem::json::ValueBase< Allocator >::getStringProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value as a String, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a string.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified string property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a string.

◆ getStringItem() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE String & grem::json::ValueBase< Allocator >::getStringItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified string item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a string.

◆ getStringItem() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const String & grem::json::ValueBase< Allocator >::getStringItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified string item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a string.

◆ getStringItem() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE String && grem::json::ValueBase< Allocator >::getStringItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified string item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a string.

◆ getStringItem() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const String & grem::json::ValueBase< Allocator >::getStringItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value as a String, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a string.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified string item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a string.

◆ getNumberProperty() [1/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Number & grem::json::ValueBase< Allocator >::getNumberProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.

Parameters
keykey of the property to get.
Returns
a reference to the specified number property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a number.

◆ getNumberProperty() [2/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Number & grem::json::ValueBase< Allocator >::getNumberProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified number property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a number.

◆ getNumberProperty() [3/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Number && grem::json::ValueBase< Allocator >::getNumberProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified number property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a number.

◆ getNumberProperty() [4/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Number & grem::json::ValueBase< Allocator >::getNumberProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified number property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a number.

◆ getNumberProperty() [5/5]

template<template< typename > typename Allocator>
template<typename T>
GREM_ALWAYS_INLINE T grem::json::ValueBase< Allocator >::getNumberProperty ( StringView key) const
inlinenodiscard

Get a property of the Object in this value as a Number, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually a number, or not the correct kind of number.

Template Parameters
Tnumber type to get.
Parameters
keykey of the property to get.
Returns
the number value of the specified property, converted to the given type.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not a number of the given type.

◆ getNumberItem() [1/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Number & grem::json::ValueBase< Allocator >::getNumberItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified number item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a number.

◆ getNumberItem() [2/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Number & grem::json::ValueBase< Allocator >::getNumberItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified number item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a number.

◆ getNumberItem() [3/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Number && grem::json::ValueBase< Allocator >::getNumberItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified number item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a number.

◆ getNumberItem() [4/5]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Number & grem::json::ValueBase< Allocator >::getNumberItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified number item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a number.

◆ getNumberItem() [5/5]

template<template< typename > typename Allocator>
template<typename T>
GREM_ALWAYS_INLINE T grem::json::ValueBase< Allocator >::getNumberItem ( size_t index) const
inlinenodiscard

Get an item of the Array in this value as a Number, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually a number, or not the correct kind of number.

Template Parameters
Tnumber type to get.
Parameters
indexarray index of the item to get.
Returns
the number value of the specified item, converted to the given type.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not a number of the given type.

◆ getObjectProperty() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Object & grem::json::ValueBase< Allocator >::getObjectProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.

Parameters
keykey of the property to get.
Returns
a reference to the specified object property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an object.

◆ getObjectProperty() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Object & grem::json::ValueBase< Allocator >::getObjectProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified object property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an object.

◆ getObjectProperty() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Object && grem::json::ValueBase< Allocator >::getObjectProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified object property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an object.

◆ getObjectProperty() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Object & grem::json::ValueBase< Allocator >::getObjectProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value as an Object, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an object.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified object property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an object.

◆ getObjectItem() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Object & grem::json::ValueBase< Allocator >::getObjectItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified object item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an object.

◆ getObjectItem() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Object & grem::json::ValueBase< Allocator >::getObjectItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified object item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an object.

◆ getObjectItem() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Object && grem::json::ValueBase< Allocator >::getObjectItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified object item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an object.

◆ getObjectItem() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Object & grem::json::ValueBase< Allocator >::getObjectItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value as an Object, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an object.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified object item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an object.

◆ getArrayProperty() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Array & grem::json::ValueBase< Allocator >::getArrayProperty ( StringView key) &
inlinenodiscard

Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.

Parameters
keykey of the property to get.
Returns
a reference to the specified array property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an array.

◆ getArrayProperty() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Array & grem::json::ValueBase< Allocator >::getArrayProperty ( StringView key) const &
inlinenodiscard

Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.

Parameters
keykey of the property to get.
Returns
a read-only reference to the specified array property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an array.

◆ getArrayProperty() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Array && grem::json::ValueBase< Allocator >::getArrayProperty ( StringView key) &&
inlinenodiscard

Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.

Parameters
keykey of the property to get.
Returns
an rvalue reference to the specified array property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an array.

◆ getArrayProperty() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Array & grem::json::ValueBase< Allocator >::getArrayProperty ( StringView key) const &&
inlinenodiscard

Get a property of the Object in this value as an Array, throwing an exception if this value is not actually an object, if the property doesn't exist, or if the property is not actually an array.

Parameters
keykey of the property to get.
Returns
a read-only rvalue reference to the specified array property value.
Exceptions
json::Errorif this value is not an object, or if the specified property doesn't exist, or if the specified property is not an array.

◆ getArrayItem() [1/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Array & grem::json::ValueBase< Allocator >::getArrayItem ( size_t index) &
inlinenodiscard

Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.

Parameters
indexarray index of the item to get.
Returns
a reference to the specified array item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an array.

◆ getArrayItem() [2/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Array & grem::json::ValueBase< Allocator >::getArrayItem ( size_t index) const &
inlinenodiscard

Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.

Parameters
indexarray index of the item to get.
Returns
a read-only reference to the specified array item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an array.

◆ getArrayItem() [3/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE Array && grem::json::ValueBase< Allocator >::getArrayItem ( size_t index) &&
inlinenodiscard

Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.

Parameters
indexarray index of the item to get.
Returns
an rvalue reference to the specified array item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an array.

◆ getArrayItem() [4/4]

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE const Array & grem::json::ValueBase< Allocator >::getArrayItem ( size_t index) const &&
inlinenodiscard

Get an item of the Array in this value as an Array, throwing an exception if this value is not actually an array, if the index is out of range, or if the item is not actually an array.

Parameters
indexarray index of the item to get.
Returns
a read-only rvalue reference to the specified array item value.
Exceptions
json::Errorif this value is not an array, or if the specified index is out of range, or if the specified item is not an array.

◆ getSource()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE SourceLocation grem::json::ValueBase< Allocator >::getSource ( ) const
inlinenodiscardnoexcept

Get the source location of this value.

Returns
the associated source location.

◆ operator==()

template<template< typename > typename Allocator>
GREM_ALWAYS_INLINE bool grem::json::ValueBase< Allocator >::operator== ( const ValueBase< Allocator > & other) const
inlinenodiscard

Compare this value to another for equality.

Parameters
otherthe value to compare this value to.
Returns
true if the values are equal (ignoring source location), false otherwise.

The documentation for this class was generated from the following file: