value.h¶
| File Path | engine/include/conjure/core/json/value.h |
| API ↗ | JSON |
JSON values.
Structs¶
| File | Description |
|---|---|
json::detail::value_access |
Lets the document and the iterators build views; not for general use. |
json::json_converter<bool> |
|
json::json_converter<f32> |
|
json::json_converter<f64> |
|
json::json_converter<i16> |
|
json::json_converter<i32> |
|
json::json_converter<i64> |
|
json::json_converter<i8> |
|
json::json_converter<std::string> |
|
json::json_converter<std::vector<T>> |
Converts a JSON array element by element. The first failing element stops the conversion and its error is returned with the element index prepended to the message. |
json::json_converter<u16> |
|
json::json_converter<u32> |
|
json::json_converter<u64> |
|
json::json_converter<u8> |
|
json::json_converter<uuid> |
|
json::member |
One key/value pair produced by iterating an object. |
std::formatter<conjure::core::json::json_type> |
Classes¶
| File | Description |
|---|---|
json::value |
A non-owning view of one JSON value inside a document. |
json::value::array_iterator |
Forward iterator over the elements of an array. Dereferencing yields a value view. |
json::value::object_iterator |
Forward iterator over the members of an object. Dereferencing yields a member (key view plus value view). |
json::value::object_range |
Range returned by members(): for (auto [key, item] : object.members()). |
Enumerations¶
json::json_type¶
The six JSON value kinds. Invalid values report NULL_VALUE.
Type Aliases¶
json::value::array_iterator::difference_type¶
json::value::array_iterator::iterator_category¶
json::value::array_iterator::pointer¶
json::value::array_iterator::reference¶
json::value::array_iterator::value_type¶
json::value::object_iterator::difference_type¶
json::value::object_iterator::iterator_category¶
json::value::object_iterator::pointer¶
json::value::object_iterator::reference¶
json::value::object_iterator::value_type¶
Concepts¶
json::json_convertible¶
template <typename T> concept json_convertible = requires(const value &source) { { json_converter<T>::from_json(source) } -> std::same_as<result<T>>; };
True when json_converter is specialised for T.
Forward Declarations¶
json::document¶
json::json_converter¶
Customisation point for value::to<T>(). Specialise it for a type and provide static result<T> from_json(const value &source). Conversion errors use the generic core codes: NOT_FOUND for an invalid (missing) value, INVALID_ARGUMENT for a type mismatch, OUT_OF_RANGE for a number outside the target range and PARSE_FAILURE for a string that does not parse as the target.