SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
predicate.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, 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 
14 #pragma once
15 
17 
18 // ----------------------------------------------------------------------------
19 // General Purpose Char predicates
20 // ----------------------------------------------------------------------------
21 
22 namespace seqan3
23 {
24 
45 template <uint8_t interval_first, uint8_t interval_last>
47  requires (interval_first <= interval_last)
49 inline constexpr auto is_in_interval = detail::is_in_interval_type<interval_first, interval_last>{};
50 
51 #ifdef SEQAN3_DEPRECATED_310
65 template <alphabet alphabet_t>
66 SEQAN3_DEPRECATED_310 inline constexpr auto is_in_alphabet = detail::is_in_alphabet_type<alphabet_t>{};
67 #endif // SEQAN3_DEPRECATED_310
68 
82 template <int char_v>
83 inline constexpr auto is_char = detail::is_char_type<char_v>{};
84 
95 inline auto constexpr is_eof = is_char<EOF>;
96 
110 inline auto constexpr is_cntrl = is_in_interval<'\0', static_cast<char>(31)> ||
111  is_char<static_cast<char>(127)>;
112 
125 inline auto constexpr is_print = is_in_interval<' ', '~'> ;
126 
146 inline auto constexpr is_space = is_in_interval<'\t', '\r'> || is_char<' '>;
147 
163 inline auto constexpr is_blank = is_char<'\t'> || is_char<' '>;
164 
183 inline auto constexpr is_graph = is_in_interval<'!', '~'>;
184 
199 inline auto constexpr is_punct = is_in_interval<'!', '/'> ||
200  is_in_interval<':', '@'> ||
201  is_in_interval<'[', '`'> ||
202  is_in_interval<'{', '~'>;
203 
220 inline auto constexpr is_alnum = is_in_interval<'0','9'> ||
221  is_in_interval<'A','Z'> ||
222  is_in_interval<'a','z'>;
223 
239 inline auto constexpr is_alpha = is_in_interval<'A', 'Z'> || is_in_interval<'a', 'z'>;
240 
255 inline auto constexpr is_upper = is_in_interval<'A', 'Z'>;
256 
271 inline auto constexpr is_lower = is_in_interval<'a', 'z'>;
272 
287 inline auto constexpr is_digit = is_in_interval<'0', '9'>;
288 
305 inline auto constexpr is_xdigit = is_in_interval<'0', '9'> ||
306  is_in_interval<'A', 'F'> ||
307  is_in_interval<'a', 'f'>;
309 
904 } // namespace seqan3
constexpr auto is_in_alphabet
Checks whether a given letter is valid for the specified seqan3::alphabet.
Definition: predicate.hpp:66
constexpr auto is_alnum
Checks whether c is a alphanumeric character.
Definition: predicate.hpp:220
constexpr auto is_graph
Checks whether c is a graphic character.
Definition: predicate.hpp:183
constexpr auto is_eof
Checks whether a given letter is equal to the EOF constant defined in <cstdio>.
Definition: predicate.hpp:95
constexpr auto is_blank
Checks whether c is a blank character.
Definition: predicate.hpp:163
constexpr auto is_punct
Checks whether c is a punctuation character.
Definition: predicate.hpp:199
constexpr auto is_digit
Checks whether c is a digital character.
Definition: predicate.hpp:287
constexpr auto is_alpha
Checks whether c is a alphabetical character.
Definition: predicate.hpp:239
constexpr auto is_char
Checks whether a given letter is the same as the template non-type argument.
Definition: predicate.hpp:83
constexpr auto is_print
Checks whether c is a printable character.
Definition: predicate.hpp:125
constexpr auto is_space
Checks whether c is a space character.
Definition: predicate.hpp:146
constexpr auto is_xdigit
Checks whether c is a hexadecimal character.
Definition: predicate.hpp:305
constexpr auto is_upper
Checks whether c is a upper case character.
Definition: predicate.hpp:255
constexpr auto is_cntrl
Checks whether c is a control character.
Definition: predicate.hpp:110
constexpr auto is_in_interval
Checks whether a given letter is in the specified interval.
Definition: predicate.hpp:49
constexpr auto is_lower
Checks whether c is a lower case character.
Definition: predicate.hpp:271
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
#define SEQAN3_DEPRECATED_310
Deprecation message for SeqAn 3.1.0 release.
Definition: platform.hpp:203
Provides parse conditions for tokenization.