A constraint class to ensure the provided value is one of the specified values in an array.
More...
#include <ConfigConstraints.hpp>
|
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.
|
|
std::optional< Error > | checkConstraint (Value const &val) const |
| Check if the value meets the specific 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.
|
|
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
-
arrSize | The size of the array containing the valid values for the constraint |
◆ 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
-
key | The key of the ConfigValue that has this constraint |
arr | The value that has this constraint must be of the values in arr |
The documentation for this class was generated from the following file: