A validator that checks if a file exists.
More...
#include <seqan3/argument_parser/validators.hpp>
|
using | value_type = filesystem::path |
| 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.
|
|
void | operator() (filesystem::path const &path) const |
| Tests whether path exists. More...
|
|
void | operator() (std::vector< filesystem::path > const &v) const |
| Tests whether every filename in list v exists.
|
|
A validator that checks if a file exists.
The struct then acts as a functor that throws a seqan3::parser_invalid_argument exception whenever a given filename (string) does not exist.
int main(int argc, const char ** argv)
{
seqan3::filesystem::path myfile;
myparser.add_option(myfile,'f',"file","Give me a filename.",
try
{
myparser.parse();
}
{
std::cerr << "[PARSER ERROR] " << ext.what() << "\n";
return -1;
}
{
return 0;
}
return 0;
}
◆ operator()()
void seqan3::file_existance_validator::operator() |
( |
filesystem::path const & |
path | ) |
const |
|
inline |
Tests whether path exists.
- Parameters
-
path | The input value to check. |
- Exceptions
-
The documentation for this class was generated from the following file: