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

UTF-8 position arithmetic for match iteration. More...

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

Go to the source code of this file.

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
 
namespace  real::detail
 

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.
 

Detailed Description

UTF-8 position arithmetic for match iteration.

The matching engine never needs this — multi-byte constructs are compiled to byte-level alternatives. It is used only by match iteration to advance past an empty match by one whole codepoint, matching Python's behaviour.

Definition in file utf8.hpp.