FE 0.6.0
A header-only C++ library for writing frontends
|
Classes | |
struct | Char32 |
Wrapper for char32_t which has a friend ostream operator. More... | |
Functions | |
size_t | num_bytes (char8_t c) |
Returns the expected number of bytes for an UTF-8 char sequence by inspecting the first byte. | |
char32_t | append (char32_t c, char32_t b) |
Append b to c for converting UTF-8 to UTF-32. | |
char32_t | first (char32_t c, char32_t num) |
Get relevant bits of first UTF-8 byte c of a multi-byte sequence consisting of num bytes. | |
char8_t | is_valid234 (char8_t c) |
Is the 2nd, 3rd, or 4th byte of an UTF-8 byte sequence valid? | |
char32_t | decode (std::istream &is) |
Decodes the next sequence of bytes from is as UTF-32. | |
bool | encode (std::ostream &os, char32_t c32) |
Encodes the UTF-32 char c32 as UTF-8 and writes the sequence of bytes to os . | |
Wrappers | |
Safe
| |
bool | isalnum (char32_t c) |
bool | isalpha (char32_t c) |
bool | isblank (char32_t c) |
bool | iscntrl (char32_t c) |
bool | isdigit (char32_t c) |
bool | isgraph (char32_t c) |
bool | islower (char32_t c) |
bool | isprint (char32_t c) |
bool | ispunct (char32_t c) |
bool | isspace (char32_t c) |
bool | isupper (char32_t c) |
bool | isxdigit (char32_t c) |
bool | isascii (char32_t c) |
char32_t | tolower (char32_t c) |
char32_t | toupper (char32_t c) |
bool | isrange (char32_t c, char32_t begin, char32_t finis) |
Is c within [begin, finis]? | |
auto | isrange (char32_t begin, char32_t finis) |
bool | isodigit (char32_t c) |
Is octal digit? | |
bool | isbdigit (char32_t c) |
Is binary digit? | |
any | |
Is | |
bool | _any (char32_t c, char32_t d) |
template<class... T> | |
bool | _any (char32_t c, char32_t d, T... args) |
template<class... T> | |
auto | any (T... args) |
Variables | |
static constexpr size_t | Max = 4 |
Maximal number of char8_t s of an UTF-8 byte sequence. | |
static constexpr char32_t | BOM = 0xfeff |
Byte Order Mark. | |
static constexpr char32_t | EoF = (char32_t)std::istream::traits_type::eof() |
End of File. | |
static constexpr char32_t | Null = 0 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Decodes the next sequence of bytes from is
as UTF-32.
Definition at line 41 of file utf8.h.
References append(), EoF, first(), is_valid234(), Null, and num_bytes().
Referenced by fe::Lexer< K, S >::next().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Is c
within [begin, finis]?
Definition at line 116 of file utf8.h.
Referenced by isbdigit(), isodigit(), and isrange().
|
inline |
|
inline |
Definition at line 112 of file utf8.h.
Referenced by fe::Lexer< K, S >::accept().
|
inline |
Definition at line 113 of file utf8.h.
Referenced by fe::Lexer< K, S >::accept().
|
staticconstexpr |
|
staticconstexpr |
End of File.
Definition at line 14 of file utf8.h.
Referenced by decode(), and fe::Lexer< K, S >::next().
|
staticconstexpr |