Clio develop
The XRP Ledger API server.
|
Provides a view into a subset of configuration data defined by a prefix. More...
#include <ObjectView.hpp>
Public Member Functions | |
ObjectView (std::string_view prefix, ClioConfigDefinition const &clioConfig) | |
Constructs an ObjectView for the specified prefix. The view must be of type object. | |
ObjectView (std::string_view prefix, std::size_t arrayIndex, ClioConfigDefinition const &clioConfig) | |
Constructs an ObjectView for an indexed array within the specified prefix. | |
bool | containsKey (std::string_view key) const |
Checks if prefix_.key (fullkey) exists in ClioConfigDefinition. | |
ValueView | getValueView (std::string_view key) const |
Retrieves the value associated with the specified prefix._key in ClioConfigDefinition. | |
template<typename T > | |
T | get (std::string_view key) const |
Returns the specified value of given string if value exists. | |
template<typename T > | |
std::optional< T > | maybeValue (std::string_view key) const |
Returns the specified value of given string of type T if type and value exists. | |
ObjectView | getObject (std::string_view key) const |
Retrieves an ObjectView in ClioConfigDefinition with key that starts with prefix_.key. The view must be of type object. | |
ArrayView | getArray (std::string_view key) const |
Retrieves an ArrayView in ClioConfigDefinition with key that starts with prefix_.key. The view must be of type object. | |
Provides a view into a subset of configuration data defined by a prefix.
Allows querying and accessing configuration values based on the provided prefix
util::config::ObjectView::ObjectView | ( | std::string_view | prefix, |
ClioConfigDefinition const & | clioConfig ) |
Constructs an ObjectView for the specified prefix. The view must be of type object.
prefix | The prefix indicating the subset of configuration data to view |
clioConfig | Reference to the ClioConfigDefinition containing all the configuration data |
util::config::ObjectView::ObjectView | ( | std::string_view | prefix, |
std::size_t | arrayIndex, | ||
ClioConfigDefinition const & | clioConfig ) |
Constructs an ObjectView for an indexed array within the specified prefix.
prefix | The prefix indicating the subset of configuration data to view |
arrayIndex | The index of the array object element to view |
clioConfig | Reference to the ClioConfigDefinition containing all the configuration data |
|
nodiscard |
Checks if prefix_.key (fullkey) exists in ClioConfigDefinition.
key | The suffix of the key |
|
inline |
Returns the specified value of given string if value exists.
T | The type T to return |
key | The config key to add to prefix and then search for |
|
nodiscard |
Retrieves an ArrayView in ClioConfigDefinition with key that starts with prefix_.key. The view must be of type object.
key | The suffix of the key |
|
nodiscard |
Retrieves an ObjectView in ClioConfigDefinition with key that starts with prefix_.key. The view must be of type object.
key | The suffix of the key |
|
nodiscard |
Retrieves the value associated with the specified prefix._key in ClioConfigDefinition.
key | The suffix of the key |
|
inline |
Returns the specified value of given string of type T if type and value exists.
T | The type T to return |
key | The config key to add to prefix and then search for |