57 [[nodiscard]] constexpr
bool is_trail(uint8_t oc)
59 return (oc >> 6) == 0x2;
70 (cp !=
one_of(0xfffeu, 0xffffu));
77 }
else if ((lead >> 5) == 0x06) {
79 }
else if ((lead >> 4) == 0x0e) {
81 }
else if ((lead >> 3) == 0x1e) {
97 template<
typename octet_iterator>
128 cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
136 cp = ((cp << 12) & 0xffff) + ((*it << 6) & 0xfff);
150 cp = ((cp << 18) & 0x1fffff) + ((*it << 12) & 0x3ffff);
152 cp += (*it << 6) & 0xfff;
183 }
else if (cp < 0x800) {
188 }
else if (cp < 0x10000) {
199 template<
typename octet_iterator>
208 template<
typename octet_iterator>
209 [[nodiscard]] constexpr octet_iterator
find_invalid(octet_iterator start, octet_iterator
end)
212 while (result !=
end) {
221 template<
typename octet_iterator>
222 [[nodiscard]] constexpr
bool is_valid(octet_iterator start, octet_iterator
end)
227 template<
typename octet_iterator>
228 [[nodiscard]] constexpr
bool is_bom(octet_iterator it)
231 constexpr uint8_t bom[] = {0xef, 0xbb, 0xbf};
233 return ((*it++ == bom[0]) &&
238 template<
typename octet_iterator>
245 template<
typename octet_iterator>
254 [[nodiscard]] constexpr
bool is_pua(uint32_t cp)
256 return ((0x00E000 <= cp) && (cp <= 0x00F8FF)) ||
257 ((0x0F0000 <= cp) && (cp <= 0x0FFFFD)) ||
258 ((0x100000 <= cp) && (cp <= 0x10FFFD));
T length(const vecN< N, T > &x)
constexpr bool is_code_point_valid(uint32_t cp)
constexpr uint16_t LEAD_SURROGATE_MAX
constexpr uint32_t SURROGATE_OFFSET
constexpr uint16_t TRAIL_SURROGATE_MAX
constexpr uint16_t TRAIL_SURROGATE_MIN
constexpr bool is_trail(uint8_t oc)
constexpr uint16_t LEAD_OFFSET
constexpr uint32_t CODE_POINT_MAX
constexpr bool is_surrogate(uint16_t cp)
constexpr uint16_t LEAD_SURROGATE_MIN
constexpr utf_error validate_next(octet_iterator &it, octet_iterator end, uint32_t *code_point)
constexpr unsigned sequence_length(uint8_t lead)
void advance(octet_iterator &it, distance_type n, octet_iterator end)
constexpr octet_iterator find_invalid(octet_iterator start, octet_iterator end)
The library API - functions intended to be called by the users.
constexpr bool is_valid(octet_iterator start, octet_iterator end)
constexpr octet_iterator sync_backward(octet_iterator it)
auto distance(octet_iterator first, octet_iterator last)
constexpr bool is_bom(octet_iterator it)
constexpr octet_iterator sync_forward(octet_iterator it)
constexpr bool is_pua(uint32_t cp)
constexpr void repeat(T n, Op op)
Repeat the given operation 'op' 'n' times.
constexpr auto end(const zstring_view &x)