A validator that checks if a given path is a valid output directory.
More...
#include <seqan3/argument_parser/validators.hpp>
|
|
using | option_value_type |
| | Type of values that are tested by validator.
|
|
using | option_value_type = std::string |
| | Type of values that are tested by validator.
|
|
| 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 &dir) const override |
| | Tests whether path is writable.
|
|
| output_directory_validator ()=default |
| | Defaulted.
|
|
| output_directory_validator (output_directory_validator const &)=default |
| | Defaulted.
|
|
| output_directory_validator (output_directory_validator &&)=default |
| | Defaulted.
|
|
output_directory_validator & | operator= (output_directory_validator const &)=default |
| | Defaulted.
|
|
output_directory_validator & | operator= (output_directory_validator &&)=default |
| | Defaulted.
|
|
virtual | ~output_directory_validator ()=default |
| | Virtual Destructor.
|
|
| 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.
|
A validator that checks if a given path is a valid output directory.
The class acts as a functor that throws a seqan3::validation_error exception whenever a given path (std::filesystem::path) is not writable. This can happen if either the parent path does not exists, or the path doesn't have the proper write permissions.
int main(int argc, char const ** argv)
{
'd',
"dir",
"The output directory for storing the files.",
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
A validator that checks if a given path is a valid output directory.
Definition validators.hpp:842
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
- Note
- The validator works on every type that can be implicitly converted to std::filesystem::path.
◆ get_help_page_message()
| std::string seqan3::output_directory_validator::get_help_page_message |
( |
| ) |
const |
|
inline |
Returns a message that can be appended to the (positional) options help page info.
Implements validator.
◆ operator()() [1/2]
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 seqan3::file_validator_base::operator() |
( |
range_type const & | v | ) |
const |
|
inline |
Tests whether every path in list v passes validation. See operator()(option_value_type const & value) for further information.
- Template Parameters
-
| range_type | The type of range to check; must model std::ranges::forward_range and the value type must be convertible to std::filesystem::path. |
- Parameters
-
| v | The input range to iterate over and check every element. |
- Exceptions
-
◆ operator()() [2/2]
The documentation for this class was generated from the following file: