18 if (m_allowedValues.end() != std::find(m_allowedValues.begin(), m_allowedValues.end(),
value)) {
22 return "Select a value";
25 std::ostringstream os;
26 os <<
"The value \"" <<
value <<
"\" is not in the list of allowed values";
33template class MANTID_KERNEL_DLL TypedValidator<
std::
string>;
59 [&
value](
const auto &val) { return value.substr(0, val.size()) == val; })) {
63 return "Select a value";
64 std::ostringstream os;
65 os <<
"The value \"" <<
value <<
"\" does not start with any of the allowed values";
double value
The value of the point.
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
ListValidator is a validator that requires the value of a property to be one of a defined list of pos...
bool isEmpty(const T &value) const
Is the value considered empty.
std::string checkValidity(const TYPE &value) const override
Checks if the string passed is in the list.
std::vector< TYPE > m_allowedValues
The set of valid values.
StartsWithValidator is a validator that requires the value of a property to start with one of the str...
std::string checkValidity(const std::string &value) const override
Checks if the string passed starts with one from the list.
StartsWithValidator()=default
IValidator_sptr clone() const override
Clone the validator.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.