Mantid
|
StringContainsValidator : A validator designed to ensure that a string input contain a given sub string or a set of sub strings. More...
#include <StringContainsValidator.h>
Public Member Functions | |
IValidator_sptr | clone () const override |
Clone the current state. More... | |
void | setRequiredStrings (const std::vector< std::string > &) |
Allows a for a vector of required strings to be passed to the validator. More... | |
StringContainsValidator () | |
Constructor. More... | |
StringContainsValidator (const std::vector< std::string > &) | |
Constructor with required sub strings. More... | |
Private Member Functions | |
std::string | checkValidity (const std::string &value) const override |
Checks the value is valid. More... | |
Private Attributes | |
std::vector< std::string > | m_requiredStrings |
A vector of the sub strings the string must contain in order to pass validation. More... | |
StringContainsValidator : A validator designed to ensure that a string input contain a given sub string or a set of sub strings.
The sub strings should be case sensitive
Definition at line 22 of file StringContainsValidator.h.
Mantid::Kernel::StringContainsValidator::StringContainsValidator | ( | ) |
Constructor.
Definition at line 14 of file StringContainsValidator.cpp.
Mantid::Kernel::StringContainsValidator::StringContainsValidator | ( | const std::vector< std::string > & | strings | ) |
Constructor with required sub strings.
Definition at line 18 of file StringContainsValidator.cpp.
|
overrideprivate |
Checks the value is valid.
value | A string to check if it contains required sub strings |
Definition at line 39 of file StringContainsValidator.cpp.
References error, m_requiredStrings, position, and value.
|
override |
Clone the current state.
Definition at line 24 of file StringContainsValidator.cpp.
void Mantid::Kernel::StringContainsValidator::setRequiredStrings | ( | const std::vector< std::string > & | strings | ) |
Allows a for a vector of required strings to be passed to the validator.
strings | The vector of sub strings that need to be included to pass validation |
Definition at line 30 of file StringContainsValidator.cpp.
References m_requiredStrings.
|
private |
A vector of the sub strings the string must contain in order to pass validation.
Definition at line 39 of file StringContainsValidator.h.
Referenced by checkValidity(), and setRequiredStrings().