REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
utf8.hpp File Reference

Strict UTF-8 decoding and code-point position arithmetic. More...

#include "real/version.hpp"
#include <cstddef>
#include <cstdint>
#include <string_view>
Include dependency graph for utf8.hpp:

Classes

struct  real::detail::decoded_codepoint
 The result of a strict UTF-8 decode: the code point, its byte length, and validity. More...
 

Namespaces

namespace  real
 REAL's public API: real::regex, real::static_regex, real::flags and the match/iterator types built on them.
 
namespace  real::detail
 DFA construction internals: subset construction over a flattened NFA. Not a stable API.
 

Functions

constexpr decoded_codepoint real::detail::decode_codepoint_strict (std::string_view text, std::size_t pos)
 Strictly decodes and validates the UTF-8 sequence at text[pos].
 
constexpr std::size_t real::detail::codepoint_advance (std::string_view text, std::size_t pos)
 Number of bytes from pos to the next code-point boundary, for advancing past an empty match during iteration.
 
constexpr std::size_t real::detail::codepoint_retreat (std::string_view text, std::size_t end, std::size_t floor)
 Width of the last code point before end, the mirror of codepoint_advance.
 

Detailed Description

Strict UTF-8 decoding and code-point position arithmetic.