JeVois
1.22
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Component/ValidValuesSpec.H>
Regex-based valid values spec, everything that is a match to the regex is considered valid.
Uses boost::regex internally (because std::regex does not alow one to get the original string specification back from the regex, but we need that to display help messages). This allows for highly flexible valid values definitions. For example, say you want an int parameter to be in range [0..59] but it could also have value 72, your regex would be:
^(([0-5]?[0-9])|72)$
You can find on the web regex examples to match things like a valid filename, a valid URL, a valid credit card number, etc. Just make sure your regex is in the syntax expected by boost::regex since several syntaxes are floating around for regular expressions.
Definition at line 175 of file ValidValuesSpec.H.
Public Member Functions | |
ValidValuesSpecRegex ()=delete | |
No default constructor, always need to provide a regex. | |
ValidValuesSpecRegex (boost::regex const &valid_regex) | |
Construct from a given regex that specifies valid values. | |
virtual | ~ValidValuesSpecRegex () |
Destructor. | |
virtual bool | checkValueValidity (T const &val) const |
Check whether a proposed value is valid, returns true iff value is a match against our regex. | |
virtual std::string const | str () const |
Convert to a readable string. | |
Public Member Functions inherited from jevois::ValidValuesSpecBase< T > | |
ValidValuesSpecBase () | |
Construct, for the base class this is a no-op. | |
virtual | ~ValidValuesSpecBase () |
Destructor. | |
Protected Attributes | |
boost::regex const | itsValidRegex |
The regex that defines our valid values. | |
|
delete |
No default constructor, always need to provide a regex.
|
explicit |
Construct from a given regex that specifies valid values.
|
virtual |
Destructor.
|
virtual |
Check whether a proposed value is valid, returns true iff value is a match against our regex.
Implements jevois::ValidValuesSpecBase< T >.
|
virtual |
Convert to a readable string.
Returns Regex:[expression] where expression is replaced by the actual regex.
Implements jevois::ValidValuesSpecBase< T >.
|
protected |
The regex that defines our valid values.
Definition at line 195 of file ValidValuesSpec.H.