A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
utf8.h File Reference

UTF-8 byte-level primitives, as inline functions over a string_view. More...

#include <cstddef>
#include <cstdint>
#include <string_view>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  a11
 
namespace  a11::utf8
 

Functions

bool a11::utf8::IsContinuation (char byte)
 Whether byte is a continuation byte – the middle of a character.
 
size_t a11::utf8::SequenceWidth (char lead)
 Bytes in the sequence lead starts, from the lead byte alone.
 
size_t a11::utf8::Utf16Units (char lead)
 UTF-16 code units the character at lead occupies: 2 above the BMP, else.
 
bool a11::utf8::IsValid (std::string_view text)
 Whether text is well-formed UTF-8.
 

Detailed Description

UTF-8 byte-level primitives, as inline functions over a string_view.

Header-only and dependency-free on purpose: a11::flow_lang links nothing but Abseil and nlohmann, so the lexer, the diagnostic index and the offset table can only share these if sharing costs no link dependency.