SeqAn3 3.2.0-rc.1
The Modern C++ library for sequence analysis.
validators.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6// -----------------------------------------------------------------------------------------------------
7
13#pragma once
14
15#include <seqan3/std/algorithm>
16#include <seqan3/std/concepts>
17#include <filesystem>
18#include <fstream>
19#include <seqan3/std/ranges>
20#include <regex>
21#include <sstream>
22
33
34namespace seqan3
35{
36
96template <typename validator_type>
97concept validator = std::copyable<std::remove_cvref_t<validator_type>> &&
98 requires(validator_type validator,
100{
102
103 SEQAN3_RETURN_TYPE_CONSTRAINT(validator(value), std::same_as, void);
105};
107
123template <arithmetic option_value_t>
125{
126public:
128 using option_value_type = option_value_t;
129
135 min{min_}, max{max_}
136 {}
137
142 void operator()(option_value_type const & cmp) const
143 {
144 if (!((cmp <= max) && (cmp >= min)))
145 throw validation_error{detail::to_string("Value ", cmp, " is not in range [", min, ",", max, "].")};
146 }
147
154 template <std::ranges::forward_range range_type>
158 void operator()(range_type const & range) const
159 {
160 std::for_each(range.begin(), range.end(), [&] (auto cmp) { (*this)(cmp); });
161 }
162
165 {
166 return detail::to_string("Value must be in range [", min, ",", max, "].");
167 }
168
169private:
172
175};
176
196template <typename option_value_t>
198{
199public:
201 using option_value_type = option_value_t;
202
212
218 template <std::ranges::forward_range range_type>
220 requires std::constructible_from<option_value_type, std::ranges::range_rvalue_reference_t<range_type>>
222 value_list_validator(range_type rng)
223 {
224 values.clear();
225 std::ranges::move(std::move(rng), std::cpp20::back_inserter(values));
226 }
227
233 template <typename ...option_types>
235 requires ((std::constructible_from<option_value_type, option_types> && ...))
237 value_list_validator(option_types && ...opts)
238 {
239 (values.emplace_back(std::forward<option_types>(opts)), ...);
240 }
242
247 void operator()(option_value_type const & cmp) const
248 {
249 if (!(std::find(values.begin(), values.end(), cmp) != values.end()))
250 throw validation_error{detail::to_string("Value ", cmp, " is not one of ", std::views::all(values), ".")};
251 }
252
258 template <std::ranges::forward_range range_type>
260 requires std::convertible_to<std::ranges::range_value_t<range_type>, option_value_type>
262 void operator()(range_type const & range) const
263 {
264 std::for_each(std::ranges::begin(range), std::ranges::end(range), [&] (auto cmp) { (*this)(cmp); });
265 }
266
269 {
270 return detail::to_string("Value must be one of ", std::views::all(values), ".");
271 }
272
273private:
274
277};
278
284template <typename option_type, typename ...option_types>
286 requires (std::constructible_from<std::string, std::decay_t<option_types>> && ... &&
287 std::constructible_from<std::string, std::decay_t<option_type>>)
290
292template <typename range_type>
294 requires (std::ranges::forward_range<std::decay_t<range_type>> &&
295 std::constructible_from<std::string, std::ranges::range_value_t<range_type>>)
298
300template <typename option_type, typename ...option_types>
302
304template <typename range_type>
306 requires (std::ranges::forward_range<std::decay_t<range_type>>)
310
326{
327public:
328
331
340 virtual ~file_validator_base() = default;
342
350 virtual void operator()(std::filesystem::path const & path) const = 0;
351
359 template <std::ranges::forward_range range_type>
361 requires (std::convertible_to<std::ranges::range_value_t<range_type>, std::filesystem::path const &>
362 && !std::convertible_to<range_type, std::filesystem::path const &>)
364 void operator()(range_type const & v) const
365 {
366 std::for_each(v.begin(), v.end(), [&] (auto cmp) { this->operator()(cmp); });
367 }
368
369protected:
376 {
377 // If no valid extensions are given we can safely return here.
378 if (extensions.empty())
379 return;
380
381 // Check if extension is available.
382 if (!path.has_extension())
383 throw validation_error{detail::to_string("The given filename ", path.string(), " has no extension. Expected"
384 " one of the following valid extensions:", extensions, "!")};
385
386 std::string file_path{path.filename().string()};
387
388 // Leading dot indicates a hidden file is not part of the extension.
389 if (file_path.front() == '.')
390 file_path.erase(0, 1);
391
392 // Store a string_view containing all extensions for a better error message.
393 std::string const all_extensions{file_path.substr(file_path.find(".") + 1)};
394
395 // Compares the extensions in lower case.
396 auto case_insensitive_ends_with = [&] (std::string const & ext)
397 {
398 return case_insensitive_string_ends_with(file_path, ext);
399 };
400
401 // Check if requested extension is present.
402 if (std::ranges::find_if(extensions, case_insensitive_ends_with) == extensions.end())
403 {
404 throw validation_error{detail::to_string("Expected one of the following valid extensions: ", extensions,
405 "! Got ", all_extensions, " instead!")};
406 }
407 }
408
416 {
417 // Check if input directory is readable.
419 {
420 std::error_code ec{};
421 std::filesystem::directory_iterator{path, ec}; // if directory iterator cannot be created, ec will be set.
422 if (static_cast<bool>(ec))
423 throw validation_error{detail::to_string("Cannot read the directory ", path ,"!")};
424 }
425 else
426 {
427 // Must be a regular file.
429 throw validation_error{detail::to_string("Expected a regular file ", path, "!")};
430
431 std::ifstream file{path};
432 if (!file.is_open() || !file.good())
433 throw validation_error{detail::to_string("Cannot read the file ", path, "!")};
434 }
435 }
436
444 {
445 std::ofstream file{path};
446 detail::safe_filesystem_entry file_guard{path};
447
448 bool is_open = file.is_open();
449 bool is_good = file.good();
450 file.close();
451
452 if (!is_good || !is_open)
453 throw validation_error{detail::to_string("Cannot write ", path, "!")};
454
455 file_guard.remove();
456 }
457
460 {
461 if (extensions.empty())
462 return "";
463 else
464 return detail::to_string(" Valid file extensions are: [", extensions | views::join_with(std::string{", "}), "].");
465 }
466
473 {
474 size_t const suffix_length{suffix.size()};
475 size_t const str_length{str.size()};
476 return suffix_length > str_length ?
477 false :
478 std::ranges::equal(str.substr(str_length - suffix_length), suffix, [] (char const chr1, char const chr2)
479 {
480 return std::tolower(chr1) == std::tolower(chr2);
481 });
482 }
483
486};
487
512template <typename file_t = void>
514{
515public:
516
517 static_assert(std::same_as<file_t, void> || detail::has_type_valid_formats<file_t>,
518 "Expected either a template type with a static member called valid_formats (a file type) or void.");
519
520 // Import from base class.
522
536 {
537 if constexpr (!std::same_as<file_t, void>)
538 file_validator_base::extensions = detail::valid_file_extensions<typename file_t::valid_formats>();
539 }
540
545 virtual ~input_file_validator() = default;
546
557 requires std::same_as<file_t, void>
560 {
562 }
563
564 // Import base class constructor.
567
568 // Import the base::operator()
569 using file_validator_base::operator();
570
576 virtual void operator()(std::filesystem::path const & file) const override
577 {
578 try
579 {
580 if (!std::filesystem::exists(file))
581 throw validation_error{detail::to_string("The file ", file, " does not exist!")};
582
583 // Check if file is regular and can be opened for reading.
585
586 // Check extension.
587 validate_filename(file);
588 }
589 // LCOV_EXCL_START
591 {
592 std::throw_with_nested(validation_error{"Unhandled filesystem error!"});
593 }
594 // LCOV_EXCL_STOP
595 catch (...)
596 {
598 }
599 }
600
603 {
604 return "The input file must exist and read permissions must be granted." +
606 }
607};
608
611{
616};
617
646template <typename file_t = void>
648{
649public:
650 static_assert(std::same_as<file_t, void> || detail::has_type_valid_formats<file_t>,
651 "Expected either a template type with a static member called valid_formats (a file type) or void.");
652
653 // Import from base class.
655
662 {}
663
668 virtual ~output_file_validator() = default;
669
679 {
681 }
682
683 // Import base constructor.
686
696 {
697 if constexpr (!std::same_as<file_t, void>)
698 return detail::valid_file_extensions<typename file_t::valid_formats>();
699 return {};
700 }
701
702 // Import the base::operator()
703 using file_validator_base::operator();
704
710 virtual void operator()(std::filesystem::path const & file) const override
711 {
712 try
713 {
715 throw validation_error{detail::to_string("The file ", file, " already exists!")};
716
717 // Check if file has any write permissions.
719
720 validate_filename(file);
721 }
722 // LCOV_EXCL_START
724 {
725 std::throw_with_nested(validation_error{"Unhandled filesystem error!"});
726 }
727 // LCOV_EXCL_STOP
728 catch (...)
729 {
731 }
732 }
733
736 {
738 return "Write permissions must be granted." + valid_extensions_help_page_message();
739 else // mode == create_new
740 return "The output file must not exist already and write permissions must be granted." +
742 }
743
744private:
747};
748
766{
767public:
768 // Import from base class.
770
779 virtual ~input_directory_validator() = default;
780
781 // Import base constructor.
784
785 // Import the base::operator()
786 using file_validator_base::operator();
787
793 virtual void operator()(std::filesystem::path const & dir) const override
794 {
795 try
796 {
797 if (!std::filesystem::exists(dir))
798 throw validation_error{detail::to_string("The directory ", dir, " does not exists!")};
799
801 throw validation_error{detail::to_string("The path ", dir, " is not a directory!")};
802
803 // Check if directory has any read permissions.
805 }
806 // LCOV_EXCL_START
808 {
809 std::throw_with_nested(validation_error{"Unhandled filesystem error!"});
810 }
811 // LCOV_EXCL_STOP
812 catch (...)
813 {
815 }
816 }
817
820 {
821 return detail::to_string("An existing, readable path for the input directory.");
822 }
823};
824
842{
843public:
844 // Imported from base class.
846
855 virtual ~output_directory_validator() = default;
856
857 // Import base constructor.
860
861 // Import the base::operator().
862 using file_validator_base::operator();
863
869 virtual void operator()(std::filesystem::path const & dir) const override
870 {
871 bool dir_exists = std::filesystem::exists(dir);
872 // Make sure the created dir is deleted after we are done.
874 std::filesystem::create_directory(dir, ec); // does nothing and is not treated as error if path already exists.
875 // if error code was set or if dummy.txt could not be created within the output dir, throw an error.
876 if (static_cast<bool>(ec))
877 throw validation_error{detail::to_string("Cannot create directory: ", dir, "!")};
878
879 try
880 {
881 if (!dir_exists)
882 {
883 detail::safe_filesystem_entry dir_guard{dir};
884 validate_writeability(dir / "dummy.txt");
885 dir_guard.remove_all();
886 }
887 else
888 {
889 validate_writeability(dir / "dummy.txt");
890 }
891 }
892 // LCOV_EXCL_START
894 {
895 std::throw_with_nested(validation_error{"Unhandled filesystem error!"});
896 }
897 // LCOV_EXCL_STOP
898 catch (...)
899 {
901 }
902 }
903
906 {
907 return detail::to_string("A valid path for the output directory.");
908 }
909};
910
931{
932public:
935
939 regex_validator(std::string const & pattern_) :
940 pattern{pattern_}
941 {}
942
947 void operator()(option_value_type const & cmp) const
948 {
949 std::regex rgx(pattern);
950 if (!std::regex_match(cmp, rgx))
951 throw validation_error{detail::to_string("Value ", cmp, " did not match the pattern ", pattern, ".")};
952 }
953
960 template <std::ranges::forward_range range_type>
962 requires std::convertible_to<std::ranges::range_reference_t<range_type>, option_value_type const &>
964 void operator()(range_type const & v) const
965 {
966 for (auto && file_name : v)
967 {
968 // note: we explicitly copy/construct any reference type other than `std::string &`
969 (*this)(static_cast<option_value_type const &>(file_name));
970 }
971 }
972
975 {
976 return detail::to_string("Value must match the pattern '", pattern, "'.");
977 }
978
979private:
982};
983
984namespace detail
985{
986
999template <typename option_value_t>
1001{
1003 using option_value_type = option_value_t;
1004
1006 void operator()(option_value_t const & /*cmp*/) const noexcept
1007 {}
1008
1011 {
1012 return "";
1013 }
1014};
1015
1029template <validator validator1_type, validator validator2_type>
1031 requires std::common_with<typename validator1_type::option_value_type, typename validator2_type::option_value_type>
1034{
1035public:
1037 using option_value_type = std::common_type_t<typename validator1_type::option_value_type,
1038 typename validator2_type::option_value_type>;
1039
1048
1053 validator_chain_adaptor(validator1_type vali1_, validator2_type vali2_) :
1054 vali1{std::move(vali1_)}, vali2{std::move(vali2_)}
1055 {}
1056
1060
1069 template <typename cmp_type>
1071 requires std::invocable<validator1_type, cmp_type const> && std::invocable<validator2_type, cmp_type const>
1073 void operator()(cmp_type const & cmp) const
1074 {
1075 vali1(cmp);
1076 vali2(cmp);
1077 }
1078
1081 {
1082 return detail::to_string(vali1.get_help_page_message(), " ", vali2.get_help_page_message());
1083 }
1084
1085private:
1087 validator1_type vali1;
1089 validator2_type vali2;
1090};
1091
1092} // namespace detail
1093
1123template <validator validator1_type, validator validator2_type>
1125 requires std::common_with<typename std::remove_reference_t<validator1_type>::option_value_type,
1128auto operator|(validator1_type && vali1, validator2_type && vali2)
1129{
1130 return detail::validator_chain_adaptor{std::forward<validator1_type>(vali1),
1131 std::forward<validator2_type>(vali2)};
1132}
1133
1134} // namespace seqan3
The <algorithm> header from C++20's standard library.
Provides various type traits on generic types.
A validator that checks whether a number is inside a given range.
Definition: validators.hpp:125
void operator()(option_value_type const &cmp) const
Tests whether cmp lies inside [min, max].
Definition: validators.hpp:142
option_value_type max
Maximum of the range to test.
Definition: validators.hpp:174
option_value_t option_value_type
The type of value that this validator invoked upon.
Definition: validators.hpp:128
void operator()(range_type const &range) const
Tests whether every element in range lies inside [min, max].
Definition: validators.hpp:158
option_value_type min
Minimum of the range to test.
Definition: validators.hpp:171
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:164
arithmetic_range_validator(option_value_type const min_, option_value_type const max_)
The constructor.
Definition: validators.hpp:134
A safe guard to manage a filesystem entry, e.g. a file or a directory.
Definition: safe_filesystem_entry.hpp:38
A helper struct to chain validators recursively via the pipe operator.
Definition: validators.hpp:1034
validator_chain_adaptor(validator_chain_adaptor &&)=default
Defaulted.
void operator()(cmp_type const &cmp) const
Calls the operator() of each validator on the value cmp.
Definition: validators.hpp:1073
validator_chain_adaptor & operator=(validator_chain_adaptor &&)=default
Defaulted.
validator_chain_adaptor(validator1_type vali1_, validator2_type vali2_)
Constructing from two validators.
Definition: validators.hpp:1053
validator2_type vali2
The second validator in the chain.
Definition: validators.hpp:1089
~validator_chain_adaptor()=default
The destructor.
validator_chain_adaptor & operator=(validator_chain_adaptor const &pf)=default
Defaulted.
validator_chain_adaptor(validator_chain_adaptor const &pf)=default
Defaulted.
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:1080
validator1_type vali1
The first validator in the chain.
Definition: validators.hpp:1087
An abstract base class for the file and directory validators.
Definition: validators.hpp:326
bool case_insensitive_string_ends_with(std::string_view str, std::string_view suffix) const
Helper function that checks if a string is a suffix of another string. Case insensitive.
Definition: validators.hpp:472
void validate_filename(std::filesystem::path const &path) const
Validates the given filename path based on the specified extensions.
Definition: validators.hpp:375
std::string valid_extensions_help_page_message() const
Returns the information of valid file extensions.
Definition: validators.hpp:459
virtual void operator()(std::filesystem::path const &path) const =0
Tests if the given path is a valid input, respectively output, file or directory.
std::string option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:330
file_validator_base(file_validator_base &&)=default
Defaulted.
file_validator_base & operator=(file_validator_base &&)=default
Defaulted.
void validate_readability(std::filesystem::path const &path) const
Checks if the given path is readable.
Definition: validators.hpp:415
file_validator_base()=default
Defaulted.
file_validator_base(file_validator_base const &)=default
Defaulted.
std::vector< std::string > extensions
Stores the extensions.
Definition: validators.hpp:485
virtual ~file_validator_base()=default
file_validator_base & operator=(file_validator_base const &)=default
Defaulted.
void validate_writeability(std::filesystem::path const &path) const
Checks if the given path is writable.
Definition: validators.hpp:443
A validator that checks if a given path is a valid input directory.
Definition: validators.hpp:766
input_directory_validator(input_directory_validator &&)=default
Defaulted.
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:819
input_directory_validator()=default
Defaulted.
input_directory_validator(input_directory_validator const &)=default
Defaulted.
input_directory_validator & operator=(input_directory_validator &&)=default
Defaulted.
virtual void operator()(std::filesystem::path const &dir) const override
Tests whether path is an existing directory and is readable.
Definition: validators.hpp:793
input_directory_validator & operator=(input_directory_validator const &)=default
Defaulted.
virtual ~input_directory_validator()=default
Virtual Destructor.
A validator that checks if a given path is a valid input file.
Definition: validators.hpp:514
input_file_validator(input_file_validator const &)=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.
Definition: validators.hpp:555
input_file_validator & operator=(input_file_validator &&)=default
Defaulted.
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:602
input_file_validator(input_file_validator &&)=default
Defaulted.
virtual void operator()(std::filesystem::path const &file) const override
Tests whether path is an existing regular file and is readable.
Definition: validators.hpp:576
input_file_validator()
Default constructor.
Definition: validators.hpp:535
input_file_validator & operator=(input_file_validator const &)=default
Defaulted.
A validator that checks if a given path is a valid output directory.
Definition: validators.hpp:842
output_directory_validator()=default
Defaulted.
output_directory_validator & operator=(output_directory_validator const &)=default
Defaulted.
virtual ~output_directory_validator()=default
Virtual Destructor.
output_directory_validator(output_directory_validator &&)=default
Defaulted.
output_directory_validator(output_directory_validator const &)=default
Defaulted.
virtual void operator()(std::filesystem::path const &dir) const override
Tests whether path is writable.
Definition: validators.hpp:869
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:905
output_directory_validator & operator=(output_directory_validator &&)=default
Defaulted.
A validator that checks if a given path is a valid output file.
Definition: validators.hpp:648
static std::vector< std::string > default_extensions()
The default extensions of file_t.
Definition: validators.hpp:695
output_file_validator(output_file_validator &&)=default
Defaulted.
output_file_validator(output_file_validator const &)=default
Defaulted.
virtual void operator()(std::filesystem::path const &file) const override
Tests whether path is does not already exists and is writable.
Definition: validators.hpp:710
output_file_validator()
Default constructor.
Definition: validators.hpp:661
output_file_validator & operator=(output_file_validator const &)=default
Defaulted.
output_file_validator & operator=(output_file_validator &&)=default
Defaulted.
output_file_open_options mode
Stores the current mode of whether it is valid to overwrite the output file.
Definition: validators.hpp:746
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
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.
Definition: validators.hpp:676
A validator that checks if a matches a regular expression pattern.
Definition: validators.hpp:931
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:974
std::string pattern
The pattern to match.
Definition: validators.hpp:981
void operator()(option_value_type const &cmp) const
Tests whether cmp lies inside values.
Definition: validators.hpp:947
void operator()(range_type const &v) const
Tests whether every filename in list v matches the pattern.
Definition: validators.hpp:964
std::string option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:934
regex_validator(std::string const &pattern_)
Constructing from a vector.
Definition: validators.hpp:939
Argument parser exception thrown when an argument could not be casted to the according type.
Definition: exceptions.hpp:124
A validator that checks whether a value is inside a list of valid values.
Definition: validators.hpp:198
value_list_validator()=default
Defaulted.
void operator()(option_value_type const &cmp) const
Tests whether cmp lies inside values.
Definition: validators.hpp:247
value_list_validator(value_list_validator const &)=default
Defaulted.
value_list_validator & operator=(value_list_validator const &)=default
Defaulted.
option_value_t option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:201
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:268
value_list_validator(option_type, option_types ...) -> value_list_validator< option_type >
Deduction guide for a parameter pack.
std::vector< option_value_type > values
Minimum of the range to test.
Definition: validators.hpp:276
void operator()(range_type const &range) const
Tests whether every element in range lies inside values.
Definition: validators.hpp:262
value_list_validator(value_list_validator &&)=default
Defaulted.
~value_list_validator()=default
Defaulted.
value_list_validator(option_types &&...opts)
Constructing from a parameter pack.
Definition: validators.hpp:237
value_list_validator(range_type &&rng) -> value_list_validator< std::string >
Deduction guide for ranges over a value type convertible to std::string.
value_list_validator(option_type, option_types...) -> value_list_validator< std::string >
Type deduction guides.
value_list_validator & operator=(value_list_validator &&)=default
Defaulted.
value_list_validator(range_type &&rng) -> value_list_validator< std::ranges::range_value_t< range_type > >
Deduction guide for ranges.
value_list_validator(range_type rng)
Constructing from a range.
Definition: validators.hpp:222
The <concepts> header from C++20's standard library.
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
T create_directory(T... args)
T current_exception(T... args)
Provides parser related exceptions.
T exists(T... args)
T filename(T... args)
T find(T... args)
T for_each(T... args)
auto operator|(validator1_type &&vali1, validator2_type &&vali2)
Enables the chaining of validators.
Definition: validators.hpp:1128
constexpr ptrdiff_t find_if
Get the index of the first type in a pack that satisfies the given predicate.
Definition: traits.hpp:210
constexpr auto join_with
A join view, please use std::views::join if you don't need a separator.
Definition: join_with.hpp:29
T has_extension(T... args)
A type that satisfies std::is_arithmetic_v<t>.
The concept for option validators passed to add_option/positional_option.
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Provides various utility functions.
T is_directory(T... args)
T is_regular_file(T... args)
Provides seqan3::views::join_with.
std::string to_string(value_type &&...values)
Streams all parameters via the seqan3::debug_stream and returns a concatenated string.
Definition: to_string.hpp:29
The main SeqAn3 namespace.
Definition: cleanup.hpp:4
output_file_open_options
Mode of an output file: Determines whether an existing file can be (silently) overwritten.
Definition: validators.hpp:611
@ create_new
Forbid overwriting the output file.
@ open_or_create
Allow to overwrite the output file.
SeqAn specific customisations in the standard namespace.
#define SEQAN3_RETURN_TYPE_CONSTRAINT(expression, concept_name,...)
Same as writing {expression} -> concept_name<type1[, ...]> in a concept definition.
Definition: platform.hpp:58
Provides seqan3::debug_stream and related types.
The <ranges> header from C++20's standard library.
T regex_match(T... args)
T rethrow_exception(T... args)
Provides seqan3::detail::safe_filesystem_entry.
T size(T... args)
Validator that always returns true.
Definition: validators.hpp:1001
void operator()(option_value_t const &) const noexcept
Value cmp always passes validation because the operator never throws.
Definition: validators.hpp:1006
option_value_t option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:1003
std::string get_help_page_message() const
Since no validation is happening the help message is empty.
Definition: validators.hpp:1010
T substr(T... args)
T throw_with_nested(T... args)
Auxiliary for pretty printing of exception messages.
Provides traits for seqan3::type_list.
Provides various traits for template packs.