|
FE 0.9.0
Header-only C++ frontend library
|
Go to the source code of this file.
Classes | |
| struct | fe::utf8::Char32 |
| Wrapper for char32_t with an operator<< that writes UTF-8. More... | |
Namespaces | |
| namespace | fe |
| namespace | fe::utf8 |
| UTF-8 helpers for decoding byte streams, encoding char32_t values, and running ASCII-style character classification on char32_t. | |
Functions | |
| constexpr size_t | fe::utf8::num_bytes (char8_t c) noexcept |
| Returns the expected number of bytes for an UTF-8 char sequence by inspecting the first byte. | |
| constexpr char32_t | fe::utf8::append (char32_t c, char8_t b) noexcept |
Append b to c for converting UTF-8 to UTF-32. | |
| constexpr char32_t | fe::utf8::first (char32_t c, char32_t num) noexcept |
Get relevant bits of first UTF-8 byte c of a multi-byte sequence consisting of num bytes. | |
| constexpr char32_t | fe::utf8::min_code_point (size_t num) noexcept |
Minimum Unicode scalar value representable in an UTF-8 sequence of num bytes. | |
| constexpr bool | fe::utf8::is_scalar_value (char32_t c) noexcept |
Is c a valid Unicode scalar value? | |
| constexpr char8_t | fe::utf8::is_valid234 (char8_t c) noexcept |
| Is the 2nd, 3rd, or 4th byte of an UTF-8 byte sequence valid? | |
| char32_t | fe::utf8::decode (std::istream &is) |
Decodes the next UTF-8 sequence from is into a single char32_t. | |
| bool | fe::utf8::encode (std::ostream &os, char32_t c32) |
Encodes c32 as UTF-8 and writes the resulting bytes to os. | |
Wrappers | |
Safe char32_t-style wrappers for <ctype> functions:
| |
| bool | fe::utf8::isalnum (char32_t c) noexcept |
| bool | fe::utf8::isalpha (char32_t c) noexcept |
| bool | fe::utf8::isblank (char32_t c) noexcept |
| bool | fe::utf8::iscntrl (char32_t c) noexcept |
| bool | fe::utf8::isdigit (char32_t c) noexcept |
| bool | fe::utf8::isgraph (char32_t c) noexcept |
| bool | fe::utf8::islower (char32_t c) noexcept |
| bool | fe::utf8::isprint (char32_t c) noexcept |
| bool | fe::utf8::ispunct (char32_t c) noexcept |
| bool | fe::utf8::isspace (char32_t c) noexcept |
| bool | fe::utf8::isupper (char32_t c) noexcept |
| bool | fe::utf8::isxdigit (char32_t c) noexcept |
| bool | fe::utf8::isascii (char32_t c) noexcept |
| char32_t | fe::utf8::tolower (char32_t c) noexcept |
| char32_t | fe::utf8::toupper (char32_t c) noexcept |
| constexpr bool | fe::utf8::isrange (char32_t c, char32_t begin, char32_t finis) noexcept |
Is c within [begin, finis]? | |
| constexpr auto | fe::utf8::isrange (char32_t begin, char32_t finis) noexcept |
| constexpr bool | fe::utf8::isodigit (char32_t c) noexcept |
| Is octal digit? | |
| constexpr bool | fe::utf8::isbdigit (char32_t c) noexcept |
| Is binary digit? | |
any | |
Build a predicate that checks whether a code point matches any of the given values. | |
| bool | fe::utf8::_any (char32_t c, char32_t d) |
| template<class... T> | |
| bool | fe::utf8::_any (char32_t c, char32_t d, T... args) |
| template<class... T> | |
| auto | fe::utf8::any (T... args) |
Variables | |
| static constexpr size_t | fe::utf8::Max = 4 |
| Maximal number of char8_ts of an UTF-8 byte sequence. | |
| static constexpr char32_t | fe::utf8::BOM = 0xfeff |
| Byte Order Mark. | |
| static constexpr char32_t | fe::utf8::EoF = (char32_t)std::istream::traits_type::eof() |
| End of stream sentinel returned by decode. | |
| static constexpr char32_t | fe::utf8::Null = 0 |
| U+0000 NULL returned unchanged by decode. | |
| static constexpr char32_t | fe::utf8::Invalid = 0x110000 |
| Sentinel returned by decode for malformed UTF-8. | |