A generic JSON object.
More...
#include <xentara/workbench/json/Object_stage1.hpp>
|
| class | XentaraElementFilter |
| | A decoding filter class that throws an exception if a member name is reserved in the configuration of Xentara elements. More...
|
| |
|
| | 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.
|
| |
| 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.
|
| |
◆ Object() [1/3]
| xentara::workbench::json::Object::Object |
( |
| ) |
|
|
default |
◆ Object() [2/3]
| xentara::workbench::json::Object::Object |
( |
const Object & |
| ) |
|
|
default |
◆ Object() [3/3]
| xentara::workbench::json::Object::Object |
( |
Object && |
| ) |
|
|
defaultnoexcept |
◆ ~Object()
| xentara::workbench::json::Object::~Object |
( |
| ) |
|
|
default |
◆ decode() [1/4]
Reads the object from a JSON object.
- Parameters
-
| encodedObject | The encoded JSON object |
| options | Decoding opotions. |
- Exceptions
-
◆ decode() [2/4]
Reads the object from a JSON object, applying a filter to the top-level JSON object.
- Parameters
-
| encodedObject | The encoded JSON object |
| filter | A filter object that can be used to filter out object members |
| options | Additional decoding opotions. |
- Exceptions
-
◆ decode() [3/4]
Reads the object from a JSON value.
- Parameters
-
| encodedValue | The encoded JSON value |
| options | Decoding opotions. |
- Exceptions
-
◆ decode() [4/4]
Reads the object from a JSON value, applying a filter to the top-level JSON object.
- Parameters
-
| encodedValue | The encoded JSON value |
| filter | A filter object that can be used to filter out object members |
| options | Additional decoding opotions. |
- Exceptions
-
◆ empty()
| constexpr auto xentara::workbench::json::Object::empty |
( |
| ) |
const -> bool |
|
constexprnoexcept |
Checks if the object is empty.
- Returns
- Returns true if the object is empty, *false if it has any members.
◆ encode() [1/2]
Write the object to a JSON object.
- Parameters
-
| encodedObject | The JSON object to encode to |
- Exceptions
-
◆ encode() [2/2]
Write the object to a generic JSON value.
- Parameters
-
| encodedValue | The JSON value to encode to |
- Exceptions
-
◆ fromString() [1/2]
Creates a JSON object from a string.
- Parameters
-
| string | The string to decode |
| options | Decoding opotions. |
- Returns
- The object, or an error message on error.
◆ fromString() [2/2]
Creates a JSON object from a string, applying a filter to the top-level JSON object.
- Parameters
-
| string | The string to decode |
| filter | A filter object that can be used to filter out object members |
| options | Additional decoding opotions. |
- Returns
- The object, or an error message on error.
- See also
- utils::json::decoder::Object::filter()
◆ operator=() [1/2]
| auto xentara::workbench::json::Object::operator= |
( |
const Object & |
| ) |
-> Object & |
|
default |
Copy-assignment operator.
◆ operator=() [2/2]
| auto xentara::workbench::json::Object::operator= |
( |
Object && |
| ) |
-> Object & |
|
defaultnoexcept |
Move-assignment operator.
◆ operator==()
| auto xentara::workbench::json::Object::operator== |
( |
const Object & |
| ) |
const -> bool |
|
default |
Equality comparison operator.
◆ toString()
Converts the JSON object to a string.
- Parameters
-
| format | The format to use for the document |
- Returns
- The JSON text.
◆ kXentaraElementFilter
A decoding filter that throws an exception if a member name is reserved in the configuration of Xentara elements.