12#include "../utility/utility.hpp"
13#include "../macros.hpp"
20namespace hi {
inline namespace v1 {
27 using char_type =
char;
29 [[
nodiscard]]
constexpr std::endian guess_endian(
void const *ptr,
size_t size, std::endian endian)
const noexcept
31 return std::endian::native;
34 template<
typename It,
typename EndIt>
43 return {0xfffd,
false};
49 hi_axiom(code_point < 0x11'0000);
50 hi_axiom(
not(code_point >= 0xd800
and code_point < 0xe000));
52 if (code_point < 0x80) {
53 return {uint8_t{1},
true};
56 return {uint8_t{1},
false};
61 constexpr void write(
char32_t code_point,
It&
dst)
const noexcept
63 hi_axiom(code_point < 0x11'0000);
64 hi_axiom(
not(code_point >= 0xd800
and code_point < 0xe000));
66 if (code_point < 0x80) {
74#if defined(HI_HAS_SSE2)
Definition of the char_converter<From,To> functor.
@ read
Allow read access to a file.
@ write
Allow write access to a file.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Character encoder/decoder template.
Definition char_converter.hpp:86