SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
validators.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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 <regex>
16 #include <fstream>
17 #include <sstream>
18 
31 #include <seqan3/std/algorithm>
32 #include <seqan3/std/concepts>
33 #include <seqan3/std/filesystem>
34 #include <seqan3/std/ranges>
35 
36 namespace seqan3
37 {
38 
82 template <typename validator_type>
86  requires(validator_type validator,
88 {
90 
91  { validator(value) } -> void;
93 };
95 
109 {
110 public:
112  using option_value_type = double;
113 
119  min{min_}, max{max_}
120  {}
121 
126  void operator()(option_value_type const & cmp) const
127  {
128  if (!((cmp <= max) && (cmp >= min)))
129  throw parser_invalid_argument(detail::to_string("Value ", cmp, " is not in range [", min, ",", max, "]."));
130  }
131 
138  template <std::ranges::forward_range range_type>
142  void operator()(range_type const & range) const
143  {
144  std::for_each(range.begin(), range.end(), [&] (auto cmp) { (*this)(cmp); });
145  }
146 
149  {
150  return detail::to_string("Value must be in range [", min, ",", max, "].");
151  }
152 
153 private:
155  option_value_type min{};
156 
158  option_value_type max{};
159 };
160 
178 template <typename option_value_t>
180 {
181 public:
183  using option_value_type = option_value_t;
184 
188  value_list_validator() = default;
189  value_list_validator(value_list_validator const &) = default;
193  ~value_list_validator() = default;
194 
200  template <std::ranges::forward_range range_type>
204  value_list_validator(range_type rng)
205  {
206  values.clear();
207  std::ranges::move(std::move(rng), std::ranges::back_inserter(values));
208  }
209 
215  template <typename ...option_types>
219  value_list_validator(option_types && ...opts)
220  {
221  (values.emplace_back(std::forward<option_types>(opts)), ...);
222  }
224 
229  void operator()(option_value_type const & cmp) const
230  {
231  if (!(std::find(values.begin(), values.end(), cmp) != values.end()))
232  throw parser_invalid_argument(detail::to_string("Value ", cmp, " is not one of ", std::views::all(values), "."));
233  }
234 
240  template <std::ranges::forward_range range_type>
244  void operator()(range_type const & range) const
245  {
246  std::for_each(std::ranges::begin(range), std::ranges::end(range), [&] (auto cmp) { (*this)(cmp); });
247  }
248 
251  {
252  return detail::to_string("Value must be one of ", std::views::all(values), ".");
253  }
254 
255 private:
256 
259 };
260 
265 template <arithmetic ...option_types>
267 value_list_validator(option_types...) -> value_list_validator<double>;
268 
270 template <std::ranges::forward_range range_type>
274 value_list_validator(range_type && rng) -> value_list_validator<double>;
275 
277 template <typename ...option_types>
281 value_list_validator(option_types...) -> value_list_validator<std::string>;
282 
284 template <std::ranges::forward_range range_type>
286  requires std::constructible_from<std::string, std::ranges::range_value_t<range_type>>
288 value_list_validator(range_type && rng) -> value_list_validator<std::string>;
289 
291 template <typename ...option_types>
292 value_list_validator(option_types...) -> value_list_validator<seqan3::pack_traits::front<option_types...>>;
293 
295 template <std::ranges::forward_range range_type>
296 value_list_validator(range_type && rng) -> value_list_validator<std::ranges::range_value_t<range_type>>;
298 
312 {
313 public:
314 
317 
321  file_validator_base() = default;
322  file_validator_base(file_validator_base const &) = default;
324  file_validator_base & operator=(file_validator_base const &) = default;
325  file_validator_base & operator=(file_validator_base &&) = default;
326  virtual ~file_validator_base() = default;
327 
336  virtual void operator()(std::filesystem::path const & path) const = 0;
337 
345  template <std::ranges::forward_range range_type>
349  void operator()(range_type const & v) const
350  {
351  std::for_each(v.begin(), v.end(), [&] (auto cmp) { this->operator()(cmp); });
352  }
353 
354 protected:
355 
361  void validate_filename(std::filesystem::path const & path) const
362  {
363  // If no valid extensions are given we can safely return here.
364  if (extensions.empty())
365  return;
366 
367  // Check if extension is available.
368  if (!path.has_extension())
369  throw parser_invalid_argument{detail::to_string("The given filename ", path.string(),
370  " has no extension. Expected one of the following valid"
371  " extensions:", extensions, "!")};
372 
373  // Drop the dot.
374  std::string tmp_str = path.extension().string();
375  auto drop_less_ext = tmp_str | views::drop(1);
376 
377  // Compares the extensions in lower case.
378  auto cmp_lambda = [&] (std::string const & cmp)
379  {
380  return std::ranges::equal(cmp | views::to_lower, drop_less_ext | views::to_lower);
381  };
382 
383  // Check if requested extension is present.
384  if (std::ranges::find_if(extensions, cmp_lambda) == extensions.end())
385  {
386  throw parser_invalid_argument{detail::to_string("Expected one of the following valid extensions: ",
387  extensions, "! Got ", drop_less_ext, " instead!")};
388  }
389  }
390 
398  {
399  // Check if input directory is readable.
401  {
402  std::error_code ec{};
403  std::filesystem::directory_iterator{path, ec}; // if directory iterator cannot be created, ec will be set.
404  if (static_cast<bool>(ec))
405  throw parser_invalid_argument{detail::to_string("Cannot read the directory ", path ,"!")};
406  }
407  else
408  {
409  // Must be a regular file.
411  throw parser_invalid_argument{detail::to_string("Expected a regular file ", path, "!")};
412 
413  std::ifstream file{path};
414  if (!file.is_open() || !file.good())
415  throw parser_invalid_argument{detail::to_string("Cannot read the file ", path, "!")};
416  }
417  }
418 
426  {
427  std::ofstream file{path};
428  detail::safe_filesystem_entry file_guard{path};
429 
430  bool is_open = file.is_open();
431  bool is_good = file.good();
432  file.close();
433 
434  if (!is_good || !is_open)
435  throw parser_invalid_argument(detail::to_string("Cannot write ", path, "!"));
436 
437  file_guard.remove();
438  }
439 
442 };
443 
466 template <typename file_t = void>
468 {
469 public:
470 
471  static_assert(std::same_as<file_t, void> || detail::has_type_valid_formats<file_t>,
472  "Expected either a template type with a static member called valid_formats (a file type) or void.");
473 
474  // Import from base class.
476 
490  {
491  if constexpr (!std::same_as<file_t, void>)
492  file_validator_base::extensions = detail::valid_file_extensions<typename file_t::valid_formats>();
493  }
494 
495  input_file_validator(input_file_validator const &) = default;
499  virtual ~input_file_validator() = default;
500 
514  {
516  }
517 
518  // Import base class constructor.
521 
522  // Import the base::operator()
523  using file_validator_base::operator();
524 
530  virtual void operator()(std::filesystem::path const & file) const override
531  {
532  try
533  {
534  if (!std::filesystem::exists(file))
535  throw parser_invalid_argument(detail::to_string("The file ", file, " does not exist!"));
536 
537  // Check if file is regular and can be opened for reading.
538  validate_readability(file);
539 
540  // Check extension.
541  validate_filename(file);
542  }
544  {
545  std::throw_with_nested(parser_invalid_argument("Unhandled filesystem error!"));
546  }
547  catch (...)
548  {
550  }
551  }
552 
555  {
556  return detail::to_string("Valid input file formats: [",
557  extensions | views::join(std::string{", "}),
558  "]");
559  }
560 };
561 
584 template <typename file_t = void>
586 {
587 public:
588 
589  static_assert(std::same_as<file_t, void> || detail::has_type_valid_formats<file_t>,
590  "Expected either a template type with a static member called valid_formats (a file type) or void.");
591 
592  // Import from base class.
594 
601  {
602  if constexpr (!std::same_as<file_t, void>)
603  file_validator_base::extensions = detail::valid_file_extensions<typename file_t::valid_formats>();
604  }
605 
606  output_file_validator(output_file_validator const &) = default;
610  virtual ~output_file_validator() = default;
611 
618  {
620  }
621 
622  // Import base constructor.
625 
626  // Import the base::operator()
627  using file_validator_base::operator();
628 
634  virtual void operator()(std::filesystem::path const & file) const override
635  {
636  try
637  {
638  if (std::filesystem::exists(file))
639  throw parser_invalid_argument(detail::to_string("The file ", file, " already exists!"));
640 
641  // Check if file has any write permissions.
642  validate_writeability(file);
643 
644  validate_filename(file);
645  }
647  {
648  std::throw_with_nested(parser_invalid_argument("Unhandled filesystem error!"));
649  }
650  catch (...)
651  {
653  }
654  }
655 
658  {
659  return detail::to_string("Valid output file formats: [",
660  extensions | views::join(std::string{", "}),
661  "]");
662  }
663 };
664 
680 {
681 public:
682  // Import from base class.
684 
688  input_directory_validator() = default;
693  virtual ~input_directory_validator() = default;
694 
695  // Import base constructor.
698 
699  // Import the base::operator()
700  using file_validator_base::operator();
701 
707  virtual void operator()(std::filesystem::path const & dir) const override
708  {
709  try
710  {
711  if (!std::filesystem::exists(dir))
712  throw parser_invalid_argument(detail::to_string("The directory ", dir, " does not exists!"));
713 
715  throw parser_invalid_argument(detail::to_string("The path ", dir, " is not a directory!"));
716 
717  // Check if directory has any read permissions.
719  }
721  {
722  std::throw_with_nested(parser_invalid_argument("Unhandled filesystem error!"));
723  }
724  catch (...)
725  {
727  }
728  }
729 
732  {
733  return detail::to_string("An existing, readable path for the input directory.");
734  }
735 };
736 
752 {
753 public:
754  // Imported from base class.
756 
760  output_directory_validator() = default;
765  virtual ~output_directory_validator() = default;
766 
767  // Import base constructor.
770 
771  // Import the base::operator().
772  using file_validator_base::operator();
773 
779  virtual void operator()(std::filesystem::path const & dir) const override
780  {
781  bool dir_exists = std::filesystem::exists(dir);
782  // Make sure the created dir is deleted after we are done.
783  std::error_code ec;
784  std::filesystem::create_directory(dir, ec); // does nothing and is not treated as error if path already exists.
785  // if error code was set or if dummy.txt could not be created within the output dir, throw an error.
786  if (static_cast<bool>(ec))
787  throw parser_invalid_argument(detail::to_string("Cannot create directory: ", dir, "!"));
788 
789  try
790  {
791  if (!dir_exists)
792  {
793  detail::safe_filesystem_entry dir_guard{dir};
794  validate_writeability(dir / "dummy.txt");
795  dir_guard.remove_all();
796  }
797  else
798  {
799  validate_writeability(dir / "dummy.txt");
800  }
801  }
803  {
804  std::throw_with_nested(parser_invalid_argument("Unhandled filesystem error!"));
805  }
806  catch (...)
807  {
809  }
810  }
811 
814  {
815  return detail::to_string("A valid path for the output directory.");
816  }
817 };
818 
837 {
838 public:
841 
845  regex_validator(std::string const & pattern_) :
846  pattern{pattern_}
847  {}
848 
853  void operator()(option_value_type const & cmp) const
854  {
855  std::regex rgx(pattern);
856  if (!std::regex_match(cmp, rgx))
857  throw parser_invalid_argument(detail::to_string("Value ", cmp, " did not match the pattern ", pattern, "."));
858  }
859 
866  template <std::ranges::forward_range range_type>
870  void operator()(range_type const & v) const
871  {
872  std::for_each(v.begin(), v.end(), [&] (auto cmp) { (*this)(cmp); });
873  }
874 
877  {
878  return detail::to_string("Value must match the pattern '", pattern, "'.");
879  }
880 
881 private:
883  std::string pattern;
884 };
885 
886 namespace detail
887 {
888 
899 template <typename option_value_t>
900 struct default_validator
901 {
903  using option_value_type = option_value_t;
904 
906  void operator()(option_value_t const & /*cmp*/) const noexcept
907  {}
908 
911  {
912  return "";
913  }
914 };
915 
927 template <validator validator1_type, validator validator2_type>
931 class validator_chain_adaptor
932 {
933 public:
935  using option_value_type = typename validator1_type::option_value_type;
936 
940  validator_chain_adaptor() = delete;
941  validator_chain_adaptor(validator_chain_adaptor const & pf) = default;
942  validator_chain_adaptor & operator=(validator_chain_adaptor const & pf) = default;
943  validator_chain_adaptor(validator_chain_adaptor &&) = default;
944  validator_chain_adaptor & operator=(validator_chain_adaptor &&) = default;
945 
950  validator_chain_adaptor(validator1_type vali1_, validator2_type vali2_) :
951  vali1{std::move(vali1_)}, vali2{std::move(vali2_)}
952  {}
953 
955  ~validator_chain_adaptor() = default;
957 
966  template <typename cmp_type>
970  void operator()(cmp_type const & cmp) const
971  {
972  vali1(cmp);
973  vali2(cmp);
974  }
975 
978  {
979  return detail::to_string(vali1.get_help_page_message(), " ", vali2.get_help_page_message());
980  }
981 
982 private:
984  validator1_type vali1;
986  validator2_type vali2;
987 };
988 
989 } // namespace detail
990 
1018 template <validator validator1_type, validator validator2_type>
1023 auto operator|(validator1_type && vali1, validator2_type && vali2)
1024 {
1025  return detail::validator_chain_adaptor{std::forward<validator1_type>(vali1),
1026  std::forward<validator2_type>(vali2)};
1027 }
1028 
1029 } // namespace seqan3
seqan3::value_list_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:250
seqan3::output_file_validator::operator()
virtual void operator()(std::filesystem::path const &file) const override
Tests whether path is does not already exists and is writable.
Definition: validators.hpp:634
sstream
std::for_each
T for_each(T... args)
exceptions.hpp
Provides parser related exceptions.
seqan3::regex_validator::option_value_type
std::string option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:840
regex
safe_filesystem_entry.hpp
Provides seqan3::detail::safe_filesystem_entry.
fstream
pre.hpp
Provides various transformation trait base templates and shortcuts.
drop.hpp
Provides seqan3::views::drop.
std::string
seqan3::value_list_validator::operator()
void operator()(range_type const &range) const
Tests whether every element in range lies inside values.
Definition: validators.hpp:244
seqan3::regex_validator
A validator that checks if a matches a regular expression pattern.
Definition: validators.hpp:836
constructible_from
The std::constructible_from concept specifies that a variable of type T can be initialized with the g...
std::vector< option_value_type >
seqan3::input_file_validator::operator()
virtual void operator()(std::filesystem::path const &file) const override
Tests whether path is an existing regular file and is readable.
Definition: validators.hpp:530
std::find
T find(T... args)
seqan3::input_directory_validator::operator()
virtual void operator()(std::filesystem::path const &dir) const override
Tests whether path is an existing directory and is readable.
Definition: validators.hpp:707
basic.hpp
Provides various type traits on generic types.
seqan3::views::move
const auto move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
concept.hpp
Adaptations of concepts from the standard library.
std::regex_match
T regex_match(T... args)
seqan3::input_file_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:554
filesystem
This header includes C++17 filesystem support and imports it into namespace seqan3::filesystem (indep...
std::filesystem::is_regular_file
T is_regular_file(T... args)
seqan3::arithmetic_range_validator
A validator that checks whether a number is inside a given range.
Definition: validators.hpp:108
seqan3::regex_validator::regex_validator
regex_validator(std::string const &pattern_)
Constructing from a vector.
Definition: validators.hpp:845
seqan3::output_directory_validator
A validator that checks if a given path is a valid output directory.
Definition: validators.hpp:751
std::filesystem::path
algorithm
Adaptations of algorithms from the Ranges TS.
seqan3::operator|
auto operator|(validator1_type &&vali1, validator2_type &&vali2)
Enables the chaining of validators.
Definition: validators.hpp:1023
seqan3::value_list_validator::~value_list_validator
~value_list_validator()=default
Defaulted.
std::current_exception
T current_exception(T... args)
std::vector::clear
T clear(T... args)
concepts
The Concepts library.
std::error_code
seqan3::regex_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:876
seqan3::file_validator_base::extensions
std::vector< std::string > extensions
Stores the extensions.
Definition: validators.hpp:441
seqan3::input_file_validator
A validator that checks if a given path is a valid input file.
Definition: validators.hpp:467
same_as
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type.
seqan3::input_file_validator::input_file_validator
input_file_validator(std::vector< std::string > extensions)
Constructs from a given collection of valid extensions.
Definition: validators.hpp:509
validator::option_value_type
using option_value_type
The type of value on which the validator is called on.
seqan3::value_list_validator
A validator that checks whether a value is inside a list of valid values.
Definition: validators.hpp:179
seqan3::value_list_validator::value_list_validator
value_list_validator()=default
Defaulted.
seqan3::input_directory_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:731
seqan3::input_directory_validator::operator=
input_directory_validator & operator=(input_directory_validator const &)=default
Defaulted.
seqan3::file_validator_base
An abstract base class for the file and directory validators.
Definition: validators.hpp:311
std::filesystem::path::has_extension
T has_extension(T... args)
std::ofstream
seqan3::views::to_lower
const auto to_lower
A view that calls seqan3::to_lower() on each element in the input range.
Definition: to_lower.hpp:66
std::filesystem::is_directory
T is_directory(T... args)
core_language.hpp
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
std::throw_with_nested
T throw_with_nested(T... args)
seqan3::value_list_validator::operator()
void operator()(option_value_type const &cmp) const
Tests whether cmp lies inside values.
Definition: validators.hpp:229
seqan3::file_validator_base::file_validator_base
file_validator_base()=default
Defaulted.
seqan3::value_list_validator::operator=
value_list_validator & operator=(value_list_validator const &)=default
Defaulted.
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
seqan3::arithmetic_range_validator::arithmetic_range_validator
arithmetic_range_validator(option_value_type const min_, option_value_type const max_)
The constructor.
Definition: validators.hpp:118
validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
seqan3::pack_traits::find_if
constexpr ptrdiff_t find_if
Get the index of the first type in a pack that satisfies the given predicate.
Definition: traits.hpp:175
std::filesystem::filesystem_error
copyable
Subsumes std::movable, std::copy_constructible, and requires that the type be std::assignable_from bo...
seqan3::output_directory_validator::~output_directory_validator
virtual ~output_directory_validator()=default
Virtual Destructor.
convertible_to
The concept std::convertible_to<From, To> specifies that an expression of the type and value category...
to_lower.hpp
Provides seqan3::views::to_lower.
std::regex
seqan3::pack_traits::front
typename decltype(detail::front< pack_t... >())::type front
Return the first type from the type pack.
Definition: traits.hpp:240
seqan3::input_file_validator::input_file_validator
input_file_validator()
Default constructor.
Definition: validators.hpp:489
seqan3::output_directory_validator::operator()
virtual void operator()(std::filesystem::path const &dir) const override
Tests whether path is writable.
Definition: validators.hpp:779
seqan3::search_cfg::all
constexpr detail::search_mode_all all
Configuration element to receive all hits within the error bounds.
Definition: mode.hpp:43
seqan3::output_file_validator::output_file_validator
output_file_validator()
Default constructor.
Definition: validators.hpp:600
seqan3::value_list_validator::option_value_type
option_value_t option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:183
join.hpp
Provides seqan3::views::join.
seqan3::output_directory_validator::output_directory_validator
output_directory_validator()=default
Defaulted.
ranges
Adaptations of concepts from the Ranges TS.
std::vector::emplace_back
T emplace_back(T... args)
std::remove_reference_t
seqan3::views::drop
constexpr auto drop
A view adaptor that returns all elements after n from the underlying range (or an empty range if the ...
Definition: drop.hpp:168
std::filesystem::directory_iterator
seqan3::regex_validator::operator()
void operator()(range_type const &v) const
Tests whether every filename in list v matches the pattern.
Definition: validators.hpp:870
seqan3::output_file_validator::~output_file_validator
virtual ~output_file_validator()=default
Virtual Destructor.
std::vector::begin
T begin(T... args)
std
SeqAn specific customisations in the standard namespace.
seqan3::parser_invalid_argument
Argument parser exception that is thrown whenever there is an error while parsing the command line ar...
Definition: exceptions.hpp:37
seqan3::input_directory_validator::~input_directory_validator
virtual ~input_directory_validator()=default
Virtual Destructor.
seqan3::input_directory_validator::input_directory_validator
input_directory_validator()=default
Defaulted.
seqan3::arithmetic_range_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:148
seqan3::output_directory_validator::operator=
output_directory_validator & operator=(output_directory_validator const &)=default
Defaulted.
seqan3::input_file_validator::~input_file_validator
virtual ~input_file_validator()=default
Virtual destructor.
validator
The concept for option validators passed to add_option/positional_option.
std::filesystem::create_directory
T create_directory(T... args)
seqan3::arithmetic_range_validator::operator()
void operator()(option_value_type const &cmp) const
Tests whether cmp lies inside [min, max].
Definition: validators.hpp:126
to_string.hpp
Auxiliary for pretty printing of exception messages.
seqan3::output_file_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:657
arithmetic
A type that satisfies std::is_arithmetic_v<t>.
seqan3::regex_validator::operator()
void operator()(option_value_type const &cmp) const
Tests whether cmp lies inside values.
Definition: validators.hpp:853
seqan3::file_validator_base::validate_readability
void validate_readability(std::filesystem::path const &path) const
Checks if the given path is readable.
Definition: validators.hpp:397
seqan3::output_file_validator::operator=
output_file_validator & operator=(output_file_validator const &)=default
Defaulted.
std::vector::end
T end(T... args)
seqan3::input_directory_validator
A validator that checks if a given path is a valid input directory.
Definition: validators.hpp:679
std::filesystem::path::extension
T extension(T... args)
seqan3::file_validator_base::validate_filename
void validate_filename(std::filesystem::path const &path) const
Validates the given filename path based on the specified extensions.
Definition: validators.hpp:361
validator::operator()
void operator()(option_value_type const &cmp) const
Validates the value 'cmp' and throws a seqan3::validation_failed on failure.
std::rethrow_exception
T rethrow_exception(T... args)
misc.hpp
Provides various utility functions.
seqan3::input_file_validator::operator=
input_file_validator & operator=(input_file_validator const &)=default
Defaulted.
traits.hpp
Provides traits for seqan3::type_list.
seqan3::arithmetic_range_validator::operator()
void operator()(range_type const &range) const
Tests whether every element in range lies inside [min, max].
Definition: validators.hpp:142
std::filesystem::exists
T exists(T... args)
invocable
Specifies whether the given callable is invocable with the given arguments.
seqan3::output_file_validator
A validator that checks if a given path is a valid output file.
Definition: validators.hpp:585
seqan3::output_file_validator::output_file_validator
output_file_validator(std::vector< std::string > extensions)
Constructs from a given collection of valid extensions.
Definition: validators.hpp:613
seqan3::arithmetic_range_validator::option_value_type
double option_value_type
The type of value that this validator invoked upon.
Definition: validators.hpp:112
seqan3::output_directory_validator::get_help_page_message
std::string get_help_page_message() const
Returns a message that can be appended to the (positional) options help page info.
Definition: validators.hpp:813
seqan3::file_validator_base::validate_writeability
void validate_writeability(std::filesystem::path const &path) const
Checks if the given path is writable.
Definition: validators.hpp:425
seqan3::value_list_validator::value_list_validator
value_list_validator(range_type rng)
Constructing from a range.
Definition: validators.hpp:204
seqan3::file_validator_base::option_value_type
std::string option_value_type
Type of values that are tested by validator.
Definition: validators.hpp:316
seqan3::file_validator_base::operator()
void operator()(range_type const &v) const
Tests whether every path in list v passes validation. See operator()(option_value_type const & value)...
Definition: validators.hpp:349
std::ifstream
std::filesystem::path::string
T string(T... args)