CodePointRangeIteratorResult.d.hpp (1430B)
1 #ifndef icu4x_CodePointRangeIteratorResult_D_HPP 2 #define icu4x_CodePointRangeIteratorResult_D_HPP 3 4 #include <stdio.h> 5 #include <stdint.h> 6 #include <stddef.h> 7 #include <stdbool.h> 8 #include <memory> 9 #include <functional> 10 #include <optional> 11 #include <cstdlib> 12 #include "../diplomat_runtime.hpp" 13 14 15 namespace icu4x { 16 namespace capi { 17 struct CodePointRangeIteratorResult { 18 char32_t start; 19 char32_t end; 20 bool done; 21 }; 22 23 typedef struct CodePointRangeIteratorResult_option {union { CodePointRangeIteratorResult ok; }; bool is_ok; } CodePointRangeIteratorResult_option; 24 } // namespace capi 25 } // namespace 26 27 28 namespace icu4x { 29 /** 30 * Result of a single iteration of [`CodePointRangeIterator`]. 31 * Logically can be considered to be an `Option<RangeInclusive<DiplomatChar>>`, 32 * 33 * `start` and `end` represent an inclusive range of code points [start, end], 34 * and `done` will be true if the iterator has already finished. The last contentful 35 * iteration will NOT produce a range done=true, in other words `start` and `end` are useful 36 * values if and only if `done=false`. 37 */ 38 struct CodePointRangeIteratorResult { 39 char32_t start; 40 char32_t end; 41 bool done; 42 43 inline icu4x::capi::CodePointRangeIteratorResult AsFFI() const; 44 inline static icu4x::CodePointRangeIteratorResult FromFFI(icu4x::capi::CodePointRangeIteratorResult c_struct); 45 }; 46 47 } // namespace 48 #endif // icu4x_CodePointRangeIteratorResult_D_HPP