SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
predicate.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
11#pragma once
12
14
15// ----------------------------------------------------------------------------
16// General Purpose Char predicates
17// ----------------------------------------------------------------------------
18
19namespace seqan3
20{
21
42template <uint8_t interval_first, uint8_t interval_last>
43 requires (interval_first <= interval_last)
44inline constexpr auto is_in_interval = detail::is_in_interval_type<interval_first, interval_last>{};
45
59template <int char_v>
60inline constexpr auto is_char = detail::is_char_type<char_v>{};
61
72inline constexpr auto is_eof = is_char<EOF>;
73
87inline constexpr auto is_cntrl = is_in_interval<'\0', static_cast<char>(31)> || is_char<static_cast<char>(127)>;
88
101inline constexpr auto is_print = is_in_interval<' ', '~'>;
102
122inline constexpr auto is_space = is_in_interval<'\t', '\r'> || is_char<' '>;
123
139inline constexpr auto is_blank = is_char<'\t'> || is_char<' '>;
140
159inline constexpr auto is_graph = is_in_interval<'!', '~'>;
160
175inline constexpr auto is_punct =
176 is_in_interval<'!', '/'> || is_in_interval<':', '@'> || is_in_interval<'[', '`'> || is_in_interval<'{', '~'>;
177
194inline constexpr auto is_alnum = is_in_interval<'0', '9'> || is_in_interval<'A', 'Z'> || is_in_interval<'a', 'z'>;
195
211inline constexpr auto is_alpha = is_in_interval<'A', 'Z'> || is_in_interval<'a', 'z'>;
212
227inline constexpr auto is_upper = is_in_interval<'A', 'Z'>;
228
243inline constexpr auto is_lower = is_in_interval<'a', 'z'>;
244
259inline constexpr auto is_digit = is_in_interval<'0', '9'>;
260
277inline constexpr auto is_xdigit = is_in_interval<'0', '9'> || is_in_interval<'A', 'F'> || is_in_interval<'a', 'f'>;
279
874} // namespace seqan3
constexpr auto is_alnum
Checks whether c is a alphanumeric character.
Definition predicate.hpp:194
constexpr auto is_graph
Checks whether c is a graphic character.
Definition predicate.hpp:159
constexpr auto is_eof
Checks whether a given letter is equal to the EOF constant defined in <cstdio>.
Definition predicate.hpp:72
constexpr auto is_blank
Checks whether c is a blank character.
Definition predicate.hpp:139
constexpr auto is_punct
Checks whether c is a punctuation character.
Definition predicate.hpp:175
constexpr auto is_digit
Checks whether c is a digital character.
Definition predicate.hpp:259
constexpr auto is_alpha
Checks whether c is a alphabetical character.
Definition predicate.hpp:211
constexpr auto is_char
Checks whether a given letter is the same as the template non-type argument.
Definition predicate.hpp:60
constexpr auto is_print
Checks whether c is a printable character.
Definition predicate.hpp:101
constexpr auto is_space
Checks whether c is a space character.
Definition predicate.hpp:122
constexpr auto is_xdigit
Checks whether c is a hexadecimal character.
Definition predicate.hpp:277
constexpr auto is_upper
Checks whether c is a upper case character.
Definition predicate.hpp:227
constexpr auto is_cntrl
Checks whether c is a control character.
Definition predicate.hpp:87
constexpr auto is_in_interval
Checks whether a given letter is in the specified interval.
Definition predicate.hpp:44
constexpr auto is_lower
Checks whether c is a lower case character.
Definition predicate.hpp:243
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides parse conditions for tokenization.
Hide me