A toolkit for working with phylogenetic data.
v0.24.0
char.hpp File Reference
#include <cctype>
#include <climits>
#include <string>
#include <type_traits>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

constexpr bool char_match_ci (char c1, char c2) noexcept
 Return whether two chars are the same, case insensitive, and ASCII-only. More...
 
std::string char_to_hex (char c, bool full=true)
 Return the name and hex representation of a char. More...
 
std::string char_to_hex (unsigned char c, bool full=true)
 Return the name and hex representation of a char, given as an unsigned char. More...
 
constexpr bool is_alnum (char c) noexcept
 Return whether a char is a letter (a-z or A-Z) or a digit (0-9), ASCII-only. More...
 
constexpr bool is_alpha (char c) noexcept
 Return whether a char is a letter (a-z or A-Z), ASCII-only. More...
 
template<typename T >
constexpr bool is_ascii (std::true_type, T c) noexcept
 Implementation detail for is_ascii(char). More...
 
template<typename T >
constexpr bool is_ascii (std::false_type, T c) noexcept
 Implementation detail for is_ascii(char). More...
 
constexpr bool is_ascii (char c) noexcept
 Return whether a char is pure ASCII, that is, in the range [0, 127]. More...
 
constexpr bool is_blank (char c) noexcept
 Return whether a char is either a space or a tab character. More...
 
constexpr bool is_cntrl (char c) noexcept
 Return whether a char is a control character, according to iscntrl of the cctype> heade but ASCII-only. More...
 
constexpr bool is_control (char c) noexcept
 Return whether a char is a control character, excluding white spaces, ASCII-only. More...
 
constexpr bool is_digit (char c) noexcept
 Return whether a char is a digit (0-9), ASCII-only. More...
 
constexpr bool is_graph (char c) noexcept
 Return whether a char is a punctuation mark, according to isgraph of the cctype header, but ASCII-only. More...
 
constexpr bool is_lower (char c) noexcept
 Return whether a char is a lower case letter (a-z), ASCII-only. More...
 
constexpr bool is_newline (char c) noexcept
 Return whether a char is either a new line or a carriage return character. More...
 
constexpr bool is_other_space (char c) noexcept
 Return whether a char is some other white space charater that is neither space, tab, new line, or carriage return - that is, whether it is a form feed or a vertical tab. More...
 
constexpr bool is_print (char c) noexcept
 Return whether a char is a printable character, according to isprint of the cctype header, but ASCII-only. More...
 
constexpr bool is_punct (char c) noexcept
 Return whether a char is a punctuation mark, according to ispunct of the cctype header, but ASCII-only. More...
 
constexpr bool is_space (char c) noexcept
 Return whether a char is some form of white space charater, so either space, tab, new line, carriage return, form feed, or vertical tab. More...
 
constexpr bool is_upper (char c) noexcept
 Return whether a char is an upper case letter (A-Z), ASCII-only. More...
 
constexpr bool is_xdigit (char c) noexcept
 Return whether a char is a hexadecimal digit (0-9 or A-F or a-f), ASCII-only. More...
 
constexpr char to_lower (char c) noexcept
 Return the lower case version of a letter, ASCII-only. More...
 
constexpr char to_upper (char c) noexcept
 Return the upper case version of a letter, ASCII-only. More...