33 if (arguments.use_filesize_dependent_cutoff)
35 cutoff_kind = cutoff_kinds::filesize_dependent;
39 cutoff_kind = cutoff_kinds::fixed;
47 case cutoff_kinds::filesize_dependent:
48 return impl(filename);
49 case cutoff_kinds::fixed:
52 seqan::hibf::unreachable();
59 return extension ==
".gz" || extension ==
".bgzf" || extension ==
".bz2";
63 enum class cutoff_kinds : uint8_t
69 cutoff_kinds cutoff_kind{cutoff_kinds::fixed};
71 uint8_t fixed_cutoff{};
86 bool const is_compressed = file_is_compressed(filename);
87 bool const is_fasta = check_for_fasta_format(filename);
95 for (
size_t i = 0; i < cutoff_bounds.
size(); ++i)
97 if (filesize <= cutoff_bounds[i])
108 static inline bool check_for_fasta_format(
116 size_t const suffix_length{suffix.size()};
117 size_t const str_length{str.
size()};
118 return suffix_length > str_length ? false
121 [](
char const chr1,
char const chr2)
123 return std::tolower(chr1) == std::tolower(chr2);
127 auto case_insensitive_ends_with = [&](
std::string const & ext)
129 return case_insensitive_string_ends_with(extension, ext);
132 return std::ranges::find_if(valid_extensions, case_insensitive_ends_with) != valid_extensions.end();