SeqAn3
The Modern C++ library for sequence analysis.
magic_header.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2019, 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 <array>
16 
17 #include <seqan3/core/platform.hpp>
18 
19 namespace seqan3::detail
20 {
21 
24 template <typename header_tag_t>
25 inline constexpr std::array<int8_t, 0> magic_header{};
26 
29 struct gz_compression
30 {};
31 
39 template <>
40 inline constexpr std::array<int8_t, 3> magic_header<gz_compression>{'\x1f', '\x8b', '\x08'};
41 
44 struct bz2_compression
45 {};
46 
54 template <>
55 inline constexpr std::array<int8_t, 3> magic_header<bz2_compression>{'\x42', '\x5a', '\x68'};
56 
59 struct zstd_compression
60 {};
61 
69 template <>
70 inline constexpr std::array<int8_t, 4> magic_header<zstd_compression>{'\x28', '\xb5', '\x2f', '\xfd'};
71 
74 struct bgzf_compression
75 {};
76 
84 template <>
85 inline constexpr std::array<int8_t, 18> magic_header<bgzf_compression>
86 {
87 // ID1 ID2 CM
88  magic_header<gz_compression>[0], magic_header<gz_compression>[1], magic_header<gz_compression>[2],
89 // FLG [MTIME ] XFL OS [XLEN ]
90  '\x04', '\x00', '\x00', '\x00', '\x00', '\x00', '\xff', '\x06', '\x00',
91 // B C [SLEN ] [BSIZE ]
92  '\x42', '\x43', '\x02', '\x00', '\x00', '\x00'
93 };
94 
95 } // namespace seqan3::detail
Provides platform and dependency checks.
Definition: aligned_sequence_concept.hpp:35