-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Adapt input/output file validator to read extensions from a…
… file.
- Loading branch information
Showing
6 changed files
with
207 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/snippet/argument_parser/validators_input_file_ext_from_file.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <seqan3/argument_parser/validators.hpp> | ||
#include <seqan3/io/sequence_file/input.hpp> | ||
#include <seqan3/core/debug_stream.hpp> | ||
|
||
int main(int argc, const char ** argv) | ||
{ | ||
|
||
// Default constructed validator has an empty extension list. | ||
seqan3::input_file_validator validator1{}; | ||
seqan3::debug_stream << validator1.get_help_page_message() << "\n"; | ||
|
||
// Specify your own extensions for the input file. | ||
seqan3::input_file_validator validator2{std::vector{std::string{"exe"}, std::string{"fasta"}}}; | ||
seqan3::debug_stream << validator2.get_help_page_message() << "\n"; | ||
|
||
// Give as a template argument the seqan3 file type to get all valid extensions for this file. | ||
seqan3::input_file_validator<seqan3::sequence_file_input<>> validator3{}; | ||
seqan3::debug_stream << validator3.get_help_page_message() << "\n"; | ||
|
||
return 0; | ||
} |
21 changes: 21 additions & 0 deletions
21
test/snippet/argument_parser/validators_output_file_ext_from_file.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <seqan3/argument_parser/validators.hpp> | ||
#include <seqan3/io/sequence_file/output.hpp> | ||
#include <seqan3/core/debug_stream.hpp> | ||
|
||
int main(int argc, const char ** argv) | ||
{ | ||
|
||
// Default constructed validator has an empty extension list. | ||
seqan3::output_file_validator validator1{}; | ||
seqan3::debug_stream << validator1.get_help_page_message() << "\n"; | ||
|
||
// Specify your own extensions for the output file. | ||
seqan3::output_file_validator validator2{std::vector{std::string{"exe"}, std::string{"fasta"}}}; | ||
seqan3::debug_stream << validator2.get_help_page_message() << "\n"; | ||
|
||
// Give as a template argument the seqan3 file type to get all valid extensions for this file. | ||
seqan3::output_file_validator<seqan3::sequence_file_output<>> validator3{}; | ||
seqan3::debug_stream << validator3.get_help_page_message() << "\n"; | ||
|
||
return 0; | ||
} |
Oops, something went wrong.