82 simdutf_really_inline simdutf_constexpr23 result() noexcept
83 : error{error_code::SUCCESS}, count{0} {}
85 simdutf_really_inline simdutf_constexpr23 result(error_code err,
87 : error{err}, count{pos} {}
89 simdutf_really_inline simdutf_constexpr23
bool is_ok()
const noexcept {
90 return error == error_code::SUCCESS;
93 simdutf_really_inline simdutf_constexpr23
bool is_err()
const noexcept {
94 return error != error_code::SUCCESS;
102 bool padding_error =
false;
105 simdutf_really_inline simdutf_constexpr23 full_result() noexcept
106 : error{error_code::SUCCESS}, input_count{0}, output_count{0} {}
108 simdutf_really_inline simdutf_constexpr23 full_result(error_code err,
110 size_t pos_out) noexcept
111 : error{err}, input_count{pos_in}, output_count{pos_out} {}
112 simdutf_really_inline simdutf_constexpr23 full_result(
113 error_code err,
size_t pos_in,
size_t pos_out,
bool padding_err) noexcept
114 : error{err}, input_count{pos_in}, output_count{pos_out},
115 padding_error{padding_err} {}
117 simdutf_really_inline simdutf_constexpr23
operator result()
const noexcept {
118 if (error == error_code::SUCCESS) {
119 return result{error, output_count};
121 return result{error, input_count};
129 size_t continuation_count;
130 size_t four_byte_count;
132 simdutf_really_inline simdutf_constexpr23 utf8_result() noexcept
133 : error{error_code::SUCCESS}, input_count{0}, continuation_count{0},
134 four_byte_count{0} {}
136 simdutf_really_inline simdutf_constexpr23
137 utf8_result(error_code err,
size_t pos_in,
size_t continuation_count_,
138 size_t four_byte_count_) noexcept
139 : error{err}, input_count{pos_in},
140 continuation_count{continuation_count_},
141 four_byte_count{four_byte_count_} {}
143 simdutf_really_inline simdutf_constexpr23
size_t
144 utf16_length()
const noexcept {
145 return input_count - continuation_count + four_byte_count;
150 simdutf_really_inline simdutf_constexpr23
size_t
151 utf32_length()
const noexcept {
152 return input_count - continuation_count;
161struct utf8_to_utf16_result {
162 static constexpr size_t max_errors = 16;
167 size_t error_offset[max_errors];
169 simdutf_really_inline simdutf_constexpr23 utf8_to_utf16_result() noexcept
170 : error{error_code::SUCCESS}, count{0}, error_count{0},
171 more_errors{
false}, error_offset{} {}