12#include "../utility/utility.hpp"
13#include "../macros.hpp"
19namespace 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 hi_axiom(code_point < 0x11'0000);
44 hi_axiom(not(code_point >= 0xd800 and code_point < 0xe000));
46 if (code_point < 0x0100) {
47 return {uint8_t{1},
true};
50 return {uint8_t{1},
false};
55 constexpr void write(
char32_t code_point, It& dst)
const noexcept
57 hi_axiom(code_point < 0x11'0000);
58 hi_axiom(not(code_point >= 0xd800 and code_point < 0xe000));
60 if (code_point < 0x0100) {
67#if defined(HI_HAS_SSE2)
69 hi_force_inline __m128i read_ascii_chunk16(It it)
const noexcept
71 return _mm_loadu_si128(
reinterpret_cast<__m128i
const *
>(
std::addressof(*it)));
75 hi_force_inline
void write_ascii_chunk16(__m128i chunk, It dst)
const noexcept
77 _mm_storeu_si128(
reinterpret_cast<__m128i *
>(
std::addressof(*dst)), chunk);
Definition of the char_converter<From,To> functor.
@ read
Allow read access to a file.
Definition access_mode.hpp:18
@ write
Allow write access to a file.
Definition access_mode.hpp:19
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
The HikoGUI API version 1.
Definition lookahead_iterator.hpp:6
constexpr Out char_cast(In rhs) noexcept
Cast a character.
Definition cast.hpp:550
Character encoder/decoder template.
Definition char_converter.hpp:86