27template <
typename list_t,
template <
typename...>
typename output_t>
32template <
template <
typename...>
typename output_t,
typename... ts>
45template <std::output_iterator<
char> it_t>
46constexpr void write_eol(it_t & it,
bool const add_cr)
64template <
typename format_variant_type>
69 bool format_found =
false;
71 if (extension.
size() > 1)
73 extension = extension.
substr(1);
74 detail::for_each<valid_formats>(
77 using fm_type =
typename decltype(fmt)::type;
79 for (
auto const & ext : fm_type::file_extensions)
83 format.template emplace<fm_type>();
100template <
typename list_t>
104template <
template <
typename...>
typename list_t,
typename... ts>
106 requires { ts::file_extensions; },
117template <
typename query_t>
121template <
typename query_t>
122 requires requires {
typename query_t::valid_formats; }
123inline constexpr bool has_type_valid_formats<query_t> =
true;
146template <
typename formats_t>
149 static_assert(has_member_file_extensions<formats_t>,
150 "Expects that all formats have a static member file_extensions storing the extensions in a range");
153 detail::for_each<formats_t>(
154 [&extensions](
auto t_identity)
156 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:70
std::vector< std::string > valid_file_extensions()
Returns a list of valid file extensions.
Definition io/detail/misc.hpp:147
void set_format(format_variant_type &format, std::filesystem::path const &file_name)
Sets the file format according to the file name extension.
Definition io/detail/misc.hpp:65
constexpr bool has_type_valid_formats
Helper function to determine if a type has a static member valid_formats.
Definition io/detail/misc.hpp:118
constexpr void write_eol(it_t &it, bool const add_cr)
Write "\n" or "\r\n" to the stream iterator, depending on arguments.
Definition io/detail/misc.hpp:46
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 io/detail/misc.hpp:101
Provides exceptions used in the I/O module.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Type that contains multiple types.
Definition type_list.hpp:26
Thrown if there is no format that accepts a given file extension.
Definition io/exception.hpp:27
Provides type traits for working with templates.
Provides algorithms for meta programming, parameter packs and seqan3::type_list.