30template <
typename list_t,
template <
typename...>
typename output_t>
35template <
template <
typename...>
typename output_t,
typename... ts>
48template <std::output_iterator<
char> it_t>
49constexpr void write_eol(it_t & it,
bool const add_cr)
67template <
typename format_variant_type>
72 bool format_found =
false;
74 if (extension.
size() > 1)
76 extension = extension.
substr(1);
77 detail::for_each<valid_formats>(
80 using fm_type =
typename decltype(fmt)::type;
82 for (
auto const & ext : fm_type::file_extensions)
84 if (std::ranges::equal(ext, extension))
86 format.template emplace<fm_type>();
103template <
typename list_t>
107template <
template <
typename...>
typename list_t,
typename... ts>
109 requires { ts::file_extensions; },
120template <
typename query_t>
124template <
typename query_t>
125 requires requires {
typename query_t::valid_formats; }
126inline constexpr bool has_type_valid_formats<query_t> =
true;
149template <
typename formats_t>
152 static_assert(has_member_file_extensions<formats_t>,
153 "Expects that all formats have a static member file_extensions storing the extensions in a range");
156 detail::for_each<formats_t>(
157 [&extensions](
auto t_identity)
159 using format_t =
typename decltype(t_identity)::type;
T back_inserter(T... args)
typename transfer_template_args_onto< source_type, target_template >::type transfer_template_args_onto_t
Shortcut for seqan3::detail::transfer_template_args_onto (transformation_trait shortcut).
Definition: template_inspection.hpp:73
std::vector< std::string > valid_file_extensions()
Returns a list of valid file extensions.
Definition: misc.hpp:150
void set_format(format_variant_type &format, std::filesystem::path const &file_name)
Sets the file format according to the file name extension.
Definition: misc.hpp:68
constexpr bool has_type_valid_formats
Helper function to determine if a type has a static member valid_formats.
Definition: misc.hpp:121
constexpr void write_eol(it_t &it, bool const add_cr)
Write "\n" or "\r\n" to the stream iterator, depending on arguments.
Definition: misc.hpp:49
constexpr bool has_member_file_extensions
Helper function to determine if all types in a format type list have a static member file_extensions.
Definition: misc.hpp:104
Provides exceptions used in the I/O module.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Type that contains multiple types.
Definition: type_list.hpp:29
Thrown if there is no format that accepts a given file extension.
Definition: exception.hpp:30
Provides type traits for working with templates.
Provides algorithms for meta programming, parameter packs and seqan3::type_list.