A validator that checks whether a number is inside a given range. More...
#include <seqan3/argument_parser/validators.hpp>
Public Types | |
using | value_type = option_value_type |
The type of value that this validator invoked upon. | |
Public Member Functions | |
std::string | get_help_page_message () const |
Returns a message that can be appended to the (positional) options help page info. | |
integral_range_validator (value_type const min_, value_type const max_) | |
The constructor. More... | |
void | operator() (value_type const &cmp) const |
Tests whether cmp lies inside [min,max]. More... | |
Related Functions | |
(Note that these are not member functions.) | |
Requirements for seqan3::validator_concept | |
You can expect these (meta-)functions on all types that implement seqan3::validator_concept. | |
void | operator() (value_type const &cmp) const |
Validates the value 'cmp' and throws a seqan3::validation_error on failure. More... | |
A validator that checks whether a number is inside a given range.
option_value_type | Must be a (container of) integral type(s). |
On construction, the validator must receive a maximum and a minimum number. The struct than acts as a functor, that throws a seqan3::parser_invalid_argument exception whenever a given value does not lie inside the given min/max range.
|
inline |
The constructor.
[in] | min_ | Minimum set for the range to test. |
[in] | max_ | Maximum set for the range to test. |
|
inline |
Tests whether cmp lies inside [min,max].
cmp | The input value to check. |
parser_invalid_argument |
|
related |
Validates the value 'cmp' and throws a seqan3::validation_error on failure.
value_type | The type of the value to be validated. |
[in,out] | cmp | The value to be validated. |
seqan3::validation_error | if value 'cmp' does not pass validation. |