SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
The concept for option validators passed to add_option/positional_option. More...
#include <seqan3/argument_parser/validators.hpp>
Related Symbols | |
(Note that these are not member symbols.) | |
Requirements for seqan3::validator | |
You can expect these (meta-)functions on all types that implement seqan3::validator. | |
using | option_value_type |
The type of value on which the validator is called on. | |
void | operator() (option_value_type const &cmp) const |
Validates the value 'cmp' and throws a seqan3::validation_error on failure. | |
std::string | get_help_page_message () const |
Returns a message that can be appended to the (positional) options help page info. | |
The concept for option validators passed to add_option/positional_option.
When adding (positional) options to the seqan3::argument_parser you may pass a function object that models seqan3::validator which checks the option value provided by the user for some constraint.
SeqAn provides several common-use-case validators, e.g. the seqan3::arithmetic_range_validator.
You can learn more about SeqAn validators in our tutorial.
To implement your own validator please refer to the detailed concept description below.
The requirements for this concept are given as related functions and type traits. Types that satisfy this concept are shown as "implementing this interface".
|
related |
Returns a message that can be appended to the (positional) options help page info.
Implemented in seqan3::arithmetic_range_validator< option_value_t >, seqan3::value_list_validator< option_value_t >, seqan3::input_file_validator< file_t >, seqan3::output_file_validator< file_t >, seqan3::input_directory_validator, seqan3::output_directory_validator, and seqan3::regex_validator.
|
related |
Validates the value 'cmp' and throws a seqan3::validation_error on failure.
option_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. |
|
related |
The type of value on which the validator is called on.