|
| std::string | get_help_page_message () const |
| | Returns a message that can be appended to the (positional) options help page info.
|
template<std::ranges::forward_range range_type>
requires (std::convertible_to<std::ranges::range_value_t<range_type>, std::filesystem::path const &> && !std::convertible_to<range_type, std::filesystem::path const &>) |
| void | operator() (range_type const &v) const |
| | Tests whether every path in list v passes validation. See operator()(option_value_type const & value) for further information.
|
| virtual void | operator() (std::filesystem::path const &file) const override |
| | Tests whether path is an existing regular file and is readable.
|
| | input_file_validator () |
| | Default constructor.
|
|
| input_file_validator (input_file_validator const &)=default |
| | Defaulted.
|
|
| input_file_validator (input_file_validator &&)=default |
| | Defaulted.
|
|
input_file_validator & | operator= (input_file_validator const &)=default |
| | Defaulted.
|
|
input_file_validator & | operator= (input_file_validator &&)=default |
| | Defaulted.
|
|
virtual | ~input_file_validator ()=default |
| | Virtual destructor.
|
| | input_file_validator (std::vector< std::string > extensions) |
| | Constructs from a given collection of valid extensions.
|
|
| file_validator_base ()=default |
| | Defaulted.
|
|
| file_validator_base (file_validator_base const &)=default |
| | Defaulted.
|
|
| file_validator_base (file_validator_base &&)=default |
| | Defaulted.
|
template<std::ranges::forward_range range_type>
requires (std::convertible_to<std::ranges::range_value_t<range_type>, std::filesystem::path const &> && !std::convertible_to<range_type, std::filesystem::path const &>) |
| void | operator() (range_type const &v) const |
| | Tests whether every path in list v passes validation. See operator()(option_value_type const & value) for further information.
|
|
| file_validator_base ()=default |
| | Defaulted.
|
|
| file_validator_base (file_validator_base const &)=default |
| | Defaulted.
|
|
| file_validator_base (file_validator_base &&)=default |
| | Defaulted.
|
|
file_validator_base & | operator= (file_validator_base const &)=default |
| | Defaulted.
|
|
file_validator_base & | operator= (file_validator_base &&)=default |
| | Defaulted.
|
|
virtual | ~file_validator_base ()=default |
| | Virtual destructor.
|
template<typename file_t = void>
class seqan3::input_file_validator< file_t >
A validator that checks if a given path is a valid input file.
- Template Parameters
-
| file_t | The type of the file to get the valid extensions for; void on default. |
On construction, the validator can receive a list (std::vector over std::string) of valid file extensions. The class acts as a functor that throws a seqan3::validation_error exception whenever a given filename's extension (std::filesystem::path) is not in the given list of valid file extensions, if the file does not exist, or if the file does not have the proper read permissions.
int main(int argc, char const ** argv)
{
'f',
"file",
"The input file containing the sequences.",
try
{
}
{
return -1;
}
return 0;
}
Meta-header for the Argument Parser module .
Argument parser exception that is thrown whenever there is an error while parsing the command line ar...
Definition exceptions.hpp:39
The SeqAn command line parser.
Definition argument_parser.hpp:147
void add_option(option_type &value, char const short_id, std::string const &long_id, std::string const &desc, option_spec const spec=option_spec::standard, validator_type option_validator=validator_type{})
Adds an option to the seqan3::argument_parser.
Definition argument_parser.hpp:238
void parse()
Initiates the actual command line parsing.
Definition argument_parser.hpp:404
Provides seqan3::debug_stream and related types.
@ standard
The default were no checking or special displaying is happening.
Definition auxiliary.hpp:250
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:38
The valid extensions can also be obtained from a seqan3 formatted file type, e.g. seqan3::sequence_input_file, if it is given as template argument to this class. The following snippet demonstrates the different ways to instantiate the seqan3::input_file_validator.
int main()
{
return 0;
}
Provides some standard validators for (positional) options.
- Note
- The validator works on every type that can be implicitly converted to std::filesystem::path.