|
| 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 does not already exists and is writable.
|
| | output_file_validator () |
| | Default constructor.
|
|
| output_file_validator (output_file_validator const &)=default |
| | Defaulted.
|
|
| output_file_validator (output_file_validator &&)=default |
| | Defaulted.
|
|
output_file_validator & | operator= (output_file_validator const &)=default |
| | Defaulted.
|
|
output_file_validator & | operator= (output_file_validator &&)=default |
| | Defaulted.
|
|
virtual | ~output_file_validator ()=default |
| | Virtual Destructor.
|
| | output_file_validator (output_file_open_options const mode, std::vector< std::string > extensions=default_extensions()) |
| | Constructs from a given overwrite mode and a list 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::output_file_validator< file_t >
A validator that checks if a given path is a valid output 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::string) is not in the given list of valid file extensions, or if the parent path does not have the proper writer permissions. In addition, the validator receives a seqan3::output_file_open_options which allows you to specify what to do if your output file already exists. seqan3::output_file_open_options::create_new will throw a seqan3::validation_error exception if it already exists and seqan3::output_file_open_options::open_or_create will skip this check (that means you are allowed to overwrite the existing file).
int main(int argc, char const ** argv)
{
myfile,
'f',
"file",
"Output file containing the processed sequences.",
'g',
"file2",
"Output file containing the processed 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
A validator that checks if a given path is a valid output file.
Definition validators.hpp:647
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
@ create_new
Forbid overwriting the output file.
Definition validators.hpp:614
@ open_or_create
Allow to overwrite the output file.
Definition validators.hpp:612
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::output_file_validator.
int main()
{
return 0;
}
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition validators.hpp:735
Provides seqan3::sequence_file_output and corresponding traits classes.
Provides some standard validators for (positional) options.
- Note
- The validator works on every type that can be implicitly converted to std::filesystem::path.