|
xentara-workbench-plugin v1.3
The Xentara Workbench Plugin Framework
|
A generic JSON object. More...
#include <xentara/workbench/json/Object_stage1.hpp>
Classes | |
| class | XentaraElementFilter |
| A decoding filter class that throws an exception if a member name is reserved in the configuration of Xentara elements. More... | |
Public Types | |
| using | iterator = __opaque_random_access_const_iterator__< std::pair< std::string, json::Value > > |
| An ietaror that can be used to iterate over the members. | |
Public Member Functions | |
| Object () | |
| Default constructor. | |
| Object (const Object &) | |
| Copy constructor. | |
| Object (Object &&) noexcept | |
| Move constructor. | |
| ~Object () | |
| Destructor. | |
| auto | operator= (const Object &) -> Object & |
| Copy-assignment operator. | |
| auto | operator= (Object &&) noexcept -> Object & |
| Move-assignment operator. | |
| constexpr auto | empty () const noexcept -> bool |
| Checks if the object is empty. | |
| constexpr auto | begin () const noexcept -> iterator |
| Gets an iterator to the beginning of the members. | |
| constexpr auto | end () const noexcept -> iterator |
| Gets an iterator to the end of the members. | |
| auto | decode (utils::json::decoder::Object &encodedObject, DecodingOptions options={}) -> void |
| Reads the object from a JSON object. | |
| auto | decode (utils::json::decoder::Value &encodedValue, DecodingOptions options={}) -> void |
| Reads the object from a JSON value. | |
| template<typename Filter > requires std::is_invocable_r_v<bool, std::decay_t<Filter>, const utils::json::decoder::Name &, utils::json::decoder::Value &> | |
| auto | decode (utils::json::decoder::Object &encodedObject, Filter &&filter, DecodingOptions options={}) -> void |
| Reads the object from a JSON object, applying a filter to the top-level JSON object. | |
| template<typename Filter > requires std::is_invocable_r_v<bool, std::decay_t<Filter>, const utils::json::decoder::Name &, utils::json::decoder::Value &> | |
| auto | decode (utils::json::decoder::Value &encodedValue, Filter &&filter, DecodingOptions options={}) -> void |
| Reads the object from a JSON value, applying a filter to the top-level JSON object. | |
| auto | encode (utils::json::encoder::Object &encodedObject) const -> void |
| Write the object to a JSON object. | |
| auto | encode (utils::json::encoder::Value &encodedValue) const -> void |
| Write the object to a generic JSON value. | |
| auto | toString (utils::json::encoder::Document::Format format=utils::json::encoder::Document::Format::Regular) const -> std::string |
| Converts the JSON object to a string. | |
| auto | operator== (const Object &) const -> bool |
| Equality comparison operator. | |
Static Public Member Functions | |
| static auto | fromString (std::string_view string, DecodingOptions options={}) -> utils::eh::expected< Object, ui::String > |
| Creates a JSON object from a string. | |
| template<typename Filter > requires std::is_invocable_r_v<bool, std::decay_t<Filter>, const utils::json::decoder::Name &, utils::json::decoder::Value &> | |
| static auto | fromString (std::string_view string, Filter &&filter, DecodingOptions options={}) -> utils::eh::expected< Object, ui::String > |
| Creates a JSON object from a string, applying a filter to the top-level JSON object. | |
Static Public Attributes | |
| static constexpr XentaraElementFilter | kXentaraElementFilter |
| A decoding filter that throws an exception if a member name is reserved in the configuration of Xentara elements. | |
A generic JSON object.
| using xentara::workbench::json::Object::iterator = __opaque_random_access_const_iterator__<std::pair<std::string, json::Value> > |
An ietaror that can be used to iterate over the members.
This is a random-access const iterator type that dereferences to an std::pair<std::string, json::Value>.
|
default |
Default constructor.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Destructor.
|
constexprnoexcept |
Gets an iterator to the beginning of the members.
| auto xentara::workbench::json::Object::decode | ( | utils::json::decoder::Object & | encodedObject, |
| DecodingOptions | options = {} |
||
| ) | -> void |
Reads the object from a JSON object.
| encodedObject | The encoded JSON object |
| options | Decoding opotions. |
| std::runtime_error | An error occurred |
| auto xentara::workbench::json::Object::decode | ( | utils::json::decoder::Object & | encodedObject, |
| Filter && | filter, | ||
| DecodingOptions | options = {} |
||
| ) | -> void |
Reads the object from a JSON object, applying a filter to the top-level JSON object.
| encodedObject | The encoded JSON object |
| filter | A filter object that can be used to filter out object members |
| options | Additional decoding opotions. |
| std::runtime_error | An error occurred |
| auto xentara::workbench::json::Object::decode | ( | utils::json::decoder::Value & | encodedValue, |
| DecodingOptions | options = {} |
||
| ) | -> void |
Reads the object from a JSON value.
| encodedValue | The encoded JSON value |
| options | Decoding opotions. |
| std::runtime_error | An error occurred |
| auto xentara::workbench::json::Object::decode | ( | utils::json::decoder::Value & | encodedValue, |
| Filter && | filter, | ||
| DecodingOptions | options = {} |
||
| ) | -> void |
Reads the object from a JSON value, applying a filter to the top-level JSON object.
| encodedValue | The encoded JSON value |
| filter | A filter object that can be used to filter out object members |
| options | Additional decoding opotions. |
| std::runtime_error | An error occurred |
|
constexprnoexcept |
Checks if the object is empty.
| auto xentara::workbench::json::Object::encode | ( | utils::json::encoder::Object & | encodedObject | ) | const -> void |
Write the object to a JSON object.
| encodedObject | The JSON object to encode to |
| std::runtime_error | An error occurred |
| auto xentara::workbench::json::Object::encode | ( | utils::json::encoder::Value & | encodedValue | ) | const -> void |
Write the object to a generic JSON value.
| encodedValue | The JSON value to encode to |
| std::runtime_error | An error occurred |
|
constexprnoexcept |
Gets an iterator to the end of the members.
|
static |
Creates a JSON object from a string.
| string | The string to decode |
| options | Decoding opotions. |
|
static |
Creates a JSON object from a string, applying a filter to the top-level JSON object.
| string | The string to decode |
| filter | A filter object that can be used to filter out object members |
| options | Additional decoding opotions. |
Copy-assignment operator.
Move-assignment operator.
|
default |
Equality comparison operator.
| auto xentara::workbench::json::Object::toString | ( | utils::json::encoder::Document::Format | format = utils::json::encoder::Document::Format::Regular | ) | const -> std::string |
Converts the JSON object to a string.
| format | The format to use for the document |
|
staticconstexpr |
A decoding filter that throws an exception if a member name is reserved in the configuration of Xentara elements.