|
FE 0.6.1
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, char8_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. | |
| char32_t | min_code_point (size_t num) |
Minimum Unicode scalar value representable in an UTF-8 sequence of num bytes. | |
| bool | is_scalar_value (char32_t c) |
Is c a valid Unicode scalar value? | |
| 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 char32_t-style wrappers for <ctype> functions:
| |
| 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_ts 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 |
| U+0000 NULL. | |
| static constexpr char32_t | Invalid = 0x110000 |
| Invalid UTF-8 sequence. | |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Decodes the next sequence of bytes from is as UTF-32.
Definition at line 56 of file utf8.h.
References append(), EoF, first(), Invalid, is_scalar_value(), is_valid234(), min_code_point(), and num_bytes().
Referenced by fe::Lexer< K, S >::next().
|
inline |
Encodes the UTF-32 char c32 as UTF-8 and writes the sequence of bytes to os.
Definition at line 87 of file utf8.h.
Referenced by fe::utf8::Char32::operator<<.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Is c within [begin, finis]?
Definition at line 133 of file utf8.h.
Referenced by isbdigit(), isodigit(), and isrange().
|
inline |
|
inline |
|
inline |
Definition at line 129 of file utf8.h.
Referenced by fe::Lexer< K, S >::accept().
|
inline |
Definition at line 130 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 |
|
staticconstexpr |