Mantid
|
StartsWithValidator is a validator that requires the value of a property to start with one of the strings in a defined list of possibilities. More...
#include <StartsWithValidator.h>
Public Member Functions | |
IValidator_sptr | clone () const override |
Clone the validator. More... | |
StartsWithValidator ()=default | |
template<std::size_t SIZE> | |
StartsWithValidator (const std::array< std::string, SIZE > &values) | |
Constructor. More... | |
StartsWithValidator (const std::set< std::string > &values) | |
Constructor. More... | |
StartsWithValidator (const std::vector< std::string > &values) | |
Constructor. More... | |
Public Member Functions inherited from Mantid::Kernel::ListValidator< TYPE > | |
void | addAllowedValue (const TYPE &value) |
Add value to the list of allowable values if it's not already there. More... | |
std::vector< std::string > | allowedValues () const override |
Returns the set of allowed values currently defined. More... | |
IValidator_sptr | clone () const override |
Clone the validator. More... | |
std::string | getValueForAlias (const std::string &alias) const override |
Return an allowed value (as a string) given an alias. More... | |
bool | isMultipleSelectionAllowed () override |
ListValidator () | |
Default constructor. Sets up an empty list of valid values. More... | |
template<typename T > | |
ListValidator (const T &values, const std::map< std::string, std::string > &aliases=std::map< std::string, std::string >(), const bool allowMultiSelection=false) | |
Constructor. More... | |
void | setMultipleSelectionAllowed (const bool isMultiSelectionAllowed) |
Protected Member Functions | |
std::string | checkValidity (const std::string &value) const override |
Checks if the string passed starts with one from the list. More... | |
Protected Member Functions inherited from Mantid::Kernel::ListValidator< TYPE > | |
std::string | checkValidity (const TYPE &value) const override |
Checks if the string passed is in the list. More... | |
bool | isAlias (const std::string &value) const |
Test if a value is an alias of an alowed value. More... | |
template<typename T > | |
bool | isAlias (const T &value) const |
Test if a value is an alias of an alowed value. More... | |
bool | isEmpty (const std::string &value) const |
Is the value considered empty. More... | |
template<typename T > | |
bool | isEmpty (const T &value) const |
Is the value considered empty. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Mantid::Kernel::ListValidator< TYPE > | |
std::map< std::string, std::string > | m_aliases |
The optional aliases for the allowed values. More... | |
std::vector< TYPE > | m_allowedValues |
The set of valid values. More... | |
bool | m_allowMultiSelection |
if the validator should allow multiple selection More... | |
StartsWithValidator is a validator that requires the value of a property to start with one of the strings in a defined list of possibilities.
Definition at line 22 of file StartsWithValidator.h.
|
default |
Mantid::Kernel::StartsWithValidator::StartsWithValidator | ( | const std::vector< std::string > & | values | ) |
Constructor.
values | :: A vector with the allowed values. |
Definition at line 17 of file StartsWithValidator.cpp.
Mantid::Kernel::StartsWithValidator::StartsWithValidator | ( | const std::set< std::string > & | values | ) |
Constructor.
values | :: A set with the allowed values. |
Definition at line 23 of file StartsWithValidator.cpp.
|
inline |
Constructor.
values | :: An array with the allowed values |
Definition at line 34 of file StartsWithValidator.h.
|
overrideprotected |
Checks if the string passed starts with one from the list.
value | :: The value to test |
Definition at line 33 of file StartsWithValidator.cpp.
References Mantid::Kernel::ListValidator< TYPE >::isEmpty(), Mantid::Kernel::ListValidator< TYPE >::m_allowedValues, and value.
|
override |
Clone the validator.
Definition at line 26 of file StartsWithValidator.cpp.