xentara-plugin v2.0.4
The Xentara Plugin Framework
|
A key used to resolve a cross reference in the configuration. More...
#include <xentara/config/Context.hpp>
Public Member Functions | |
ReferenceKey (utils::json::decoder::Value &value) | |
Constructor for a key contained in a JSON value. | |
ReferenceKey (const utils::json::decoder::Name &name) | |
Constructor for a key contained in the name of a JSON object member. | |
template<std::convertible_to< std::string_view > Key> | |
ReferenceKey (const Key &key, const utils::json::decoder::Location &location) | |
Constructor for an arbitrary key. | |
ReferenceKey (std::string &&key, const utils::json::decoder::Location &location) | |
Constructor for an arbitrary key. | |
ReferenceKey (std::string_view key, WithoutLocationTag tag) | |
Constructor for an arbitrary key not associated with any location in a JSON document. | |
Related Symbols | |
(Note that these are not member symbols.) | |
constexpr WithoutLocationTag | kWithoutLocation |
A marker to specify that a resolver key is not associated with a location in any JSON document. | |
A key used to resolve a cross reference in the configuration.
xentara::config::Context::ReferenceKey::ReferenceKey | ( | utils::json::decoder::Value & | value | ) |
Constructor for a key contained in a JSON value.
This constructor is used to resolve a reference using a key contained in a JSON value. The key is read from the value using Value::asString().
value | The JSON value containing the primary key of the object to resolve |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
xentara::config::Context::ReferenceKey::ReferenceKey | ( | const utils::json::decoder::Name & | name | ) |
Constructor for a key contained in the name of a JSON object member.
This constructor is used to resolve a reference using a key contained in a JSON value. The key is read from the value using Value::asString().
name | The JSON object member name containing the primary key of the object to resolve |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
xentara::config::Context::ReferenceKey::ReferenceKey | ( | const Key & | key, |
const utils::json::decoder::Location & | location | ||
) |
Constructor for an arbitrary key.
This constructor is used to resolve a reference using an arbitrary key.
key | The primary key of the object to resolve, in UTF-8 encoding |
location | The location within the JSON document that the key is associated with. This is used to output the line number in error messages. The location can be a location of a value the key is derived from, or any location that helps the user find the error in the JSON document in case the reference cannot be resolved. |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
xentara::config::Context::ReferenceKey::ReferenceKey | ( | std::string && | key, |
const utils::json::decoder::Location & | location | ||
) |
Constructor for an arbitrary key.
This constructor is used to resolve a reference using an arbitrary key.
key | The primary key of the object to resolve, in UTF-8 encoding |
location | The location within the JSON document that the key is associated with. This is used to output the line number in error messages. The location can be a location of a value the key is derived from, or any location that helps the user find the error in the JSON document in case the reference cannot be resolved. |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
xentara::config::Context::ReferenceKey::ReferenceKey | ( | std::string_view | key, |
WithoutLocationTag | tag | ||
) |
Constructor for an arbitrary key not associated with any location in a JSON document.
This constructor is used to resolve a reference using an arbitrary key that is not related to any JSON document.
key | The primary key of the object to resolve, in UTF-8 encoding |
tag | Always pass kWithoutLocation as this parameter |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
|
related |
A marker to specify that a resolver key is not associated with a location in any JSON document.
This marker is used instead of a location object to specify that a resolver key is not associated with any JSON document location.