23namespace seqan3::detail
31 static inline std::vector<std::string> file_extensions{{
"gz"}};
34 static constexpr std::array<char, 3> magic_header{
'\x1f',
'\x8b',
'\x08'};
42 static inline std::vector<std::string> file_extensions{{
"bz2"}};
45 static constexpr std::array<char, 3> magic_header{
'\x42',
'\x5a',
'\x68'};
50struct zstd_compression
53 static inline std::vector<std::string> file_extensions{{
"zst"}};
56 static constexpr std::array<char, 4> magic_header{
'\x28',
'\xb5',
'\x2f',
'\xfd'};
61struct bgzf_compression
64 static inline std::vector<std::string> file_extensions{{
"bgzf"}};
67 static constexpr std::array<char, 18> magic_header{
69 gz_compression::magic_header[0],
70 gz_compression::magic_header[1],
71 gz_compression::magic_header[2],
94 template <
typename char_t,
size_t extend>
95 static bool validate_header(std::span<char_t, extend> header)
97 static_assert(std::equality_comparable_with<char_t, char>,
98 "The given char type of the span must be comparable with char.");
100 static constexpr auto id1_pos = std::endian::native == std::endian::little ? 10 : 11;
102 return (header[0] == magic_header[0] &&
103 header[1] == magic_header[1] &&
104 header[2] == magic_header[2] &&
105 (header[3] & magic_header[3]) != 0 &&
106 header[id1_pos] == magic_header[10] &&
107 header[12] == magic_header[12] &&
108 header[13] == magic_header[13] &&
109 header[id1_pos + 4] == magic_header[14]);
typename decltype(detail::drop_front< pack_t... >())::type drop_front
Return a seqan3::type_list of all the types in the type pack, except the first.
Definition type_pack/traits.hpp:305
Provides type traits for working with templates.
Provides various traits for template packs.
Provides concepts that do not have equivalents in C++20.