19namespace hi {
inline namespace v1 {
26 using char_type = char;
28 [[nodiscard]]
constexpr std::endian guess_endian(
void const *ptr,
size_t size, std::endian endian)
const noexcept
30 return std::endian::native;
33 template<
typename It,
typename EndIt>
38 hilet c = char_cast<char32_t>(*it++);
42 return {0xfffd,
false};
49 hi_axiom(not(code_point >= 0xd800 and code_point < 0xe000));
51 if (code_point < 0x80) {
52 return {uint8_t{1},
true};
55 return {uint8_t{1},
false};
60 constexpr void write(
char32_t code_point, It& dst)
const noexcept
63 hi_axiom(not(code_point >= 0xd800 and code_point < 0xe000));
65 if (code_point < 0x80) {
66 *dst++ = char_cast<char>(code_point);
73#if defined(HI_HAS_SSE2)
75 hi_force_inline __m128i read_ascii_chunk16(It it)
const noexcept
77 return _mm_loadu_si128(
reinterpret_cast<__m128i
const *
>(
std::addressof(*it)));
81 hi_force_inline
void write_ascii_chunk16(__m128i chunk, It dst)
const noexcept
83 _mm_storeu_si128(
reinterpret_cast<__m128i *
>(
std::addressof(*dst)), chunk);
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
Utilities used by the HikoGUI library itself.
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
Functions and macros for handling architectural difference between compilers, CPUs and operating syst...
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:15
The HikoGUI namespace.
Definition ascii.hpp:19
Character encoder/decoder template.
Definition char_converter.hpp:85