Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::config::OneOf< ArrSize > Class Template Referencefinal

A constraint class to ensure the provided value is one of the specified values in an array. More...

#include <ConfigConstraints.hpp>

Inheritance diagram for util::config::OneOf< ArrSize >:
Collaboration diagram for util::config::OneOf< ArrSize >:

Public Member Functions

constexpr OneOf (std::string_view key, std::array< char const *, ArrSize > arr)
 Constructs a constraint where the value must be one of the values in the provided array.
 
- Public Member Functions inherited from util::config::Constraint
std::optional< ErrorcheckConstraint (Value const &val) const
 Check if the value meets the specific constraint.
 

Additional Inherited Members

- Protected Member Functions inherited from util::config::Constraint
template<std::size_t ArrSize>
constexpr std::string makeErrorMsg (std::string_view key, Value const &value, std::array< char const *, ArrSize > arr) const
 Creates an error message for all constraints that must satisfy certain hard-coded values.
 

Detailed Description

template<std::size_t ArrSize>
class util::config::OneOf< ArrSize >

A constraint class to ensure the provided value is one of the specified values in an array.

Template Parameters
arrSizeThe size of the array containing the valid values for the constraint

Constructor & Destructor Documentation

◆ OneOf()

template<std::size_t ArrSize>
util::config::OneOf< ArrSize >::OneOf ( std::string_view key,
std::array< char const *, ArrSize > arr )
inlineconstexpr

Constructs a constraint where the value must be one of the values in the provided array.

Parameters
keyThe key of the ConfigValue that has this constraint
arrThe value that has this constraint must be of the values in arr

The documentation for this class was generated from the following file: