1#ifndef icu4x_GraphemeClusterSegmenter_HPP
2#define icu4x_GraphemeClusterSegmenter_HPP
26 icu4x::capi::GraphemeClusterSegmenter* icu4x_GraphemeClusterSegmenter_create_mv1(
void);
28 typedef struct icu4x_GraphemeClusterSegmenter_create_with_provider_mv1_result {
union {icu4x::capi::GraphemeClusterSegmenter* ok; icu4x::capi::DataError err;};
bool is_ok;} icu4x_GraphemeClusterSegmenter_create_with_provider_mv1_result;
29 icu4x_GraphemeClusterSegmenter_create_with_provider_mv1_result icu4x_GraphemeClusterSegmenter_create_with_provider_mv1(
const icu4x::capi::DataProvider* provider);
31 icu4x::capi::GraphemeClusterBreakIteratorUtf8* icu4x_GraphemeClusterSegmenter_segment_utf8_mv1(
const icu4x::capi::GraphemeClusterSegmenter* self, diplomat::capi::DiplomatStringView input);
33 icu4x::capi::GraphemeClusterBreakIteratorUtf16* icu4x_GraphemeClusterSegmenter_segment_utf16_mv1(
const icu4x::capi::GraphemeClusterSegmenter* self, diplomat::capi::DiplomatString16View input);
35 icu4x::capi::GraphemeClusterBreakIteratorLatin1* icu4x_GraphemeClusterSegmenter_segment_latin1_mv1(
const icu4x::capi::GraphemeClusterSegmenter* self, diplomat::capi::DiplomatU8View input);
37 void icu4x_GraphemeClusterSegmenter_destroy_mv1(GraphemeClusterSegmenter* self);
44 auto result = icu4x::capi::icu4x_GraphemeClusterSegmenter_create_mv1();
45 return std::unique_ptr<icu4x::GraphemeClusterSegmenter>(icu4x::GraphemeClusterSegmenter::FromFFI(result));
49 auto result = icu4x::capi::icu4x_GraphemeClusterSegmenter_create_with_provider_mv1(provider.AsFFI());
54 auto result = icu4x::capi::icu4x_GraphemeClusterSegmenter_segment_utf8_mv1(this->AsFFI(),
55 {input.data(), input.size()});
56 return std::unique_ptr<icu4x::GraphemeClusterBreakIteratorUtf8>(icu4x::GraphemeClusterBreakIteratorUtf8::FromFFI(result));
60 auto result = icu4x::capi::icu4x_GraphemeClusterSegmenter_segment_utf16_mv1(this->AsFFI(),
61 {input.data(), input.size()});
62 return std::unique_ptr<icu4x::GraphemeClusterBreakIteratorUtf16>(icu4x::GraphemeClusterBreakIteratorUtf16::FromFFI(result));
66 auto result = icu4x::capi::icu4x_GraphemeClusterSegmenter_segment_latin1_mv1(this->AsFFI(),
68 return std::unique_ptr<icu4x::GraphemeClusterBreakIteratorLatin1>(icu4x::GraphemeClusterBreakIteratorLatin1::FromFFI(result));
71inline const icu4x::capi::GraphemeClusterSegmenter* icu4x::GraphemeClusterSegmenter::AsFFI()
const {
72 return reinterpret_cast<const icu4x::capi::GraphemeClusterSegmenter*
>(
this);
75inline icu4x::capi::GraphemeClusterSegmenter* icu4x::GraphemeClusterSegmenter::AsFFI() {
76 return reinterpret_cast<icu4x::capi::GraphemeClusterSegmenter*
>(
this);
79inline const icu4x::GraphemeClusterSegmenter* icu4x::GraphemeClusterSegmenter::FromFFI(
const icu4x::capi::GraphemeClusterSegmenter* ptr) {
80 return reinterpret_cast<const icu4x::GraphemeClusterSegmenter*
>(ptr);
83inline icu4x::GraphemeClusterSegmenter* icu4x::GraphemeClusterSegmenter::FromFFI(icu4x::capi::GraphemeClusterSegmenter* ptr) {
84 return reinterpret_cast<icu4x::GraphemeClusterSegmenter*
>(ptr);
87inline void icu4x::GraphemeClusterSegmenter::operator
delete(
void* ptr) {
88 icu4x::capi::icu4x_GraphemeClusterSegmenter_destroy_mv1(
reinterpret_cast<icu4x::capi::GraphemeClusterSegmenter*
>(ptr));
Definition diplomat_runtime.hpp:140
Definition diplomat_runtime.hpp:223
constexpr T * data() const noexcept
Definition diplomat_runtime.hpp:234
constexpr size_t size() const noexcept
Definition diplomat_runtime.hpp:237
Definition DataError.d.hpp:37
Definition DataProvider.d.hpp:40
std::unique_ptr< icu4x::GraphemeClusterBreakIteratorLatin1 > segment_latin1(diplomat::span< const uint8_t > input) const
Definition GraphemeClusterSegmenter.hpp:65
static diplomat::result< std::unique_ptr< icu4x::GraphemeClusterSegmenter >, icu4x::DataError > create_with_provider(const icu4x::DataProvider &provider)
Definition GraphemeClusterSegmenter.hpp:48
std::unique_ptr< icu4x::GraphemeClusterBreakIteratorUtf16 > segment16(std::u16string_view input) const
Definition GraphemeClusterSegmenter.hpp:59
std::unique_ptr< icu4x::GraphemeClusterBreakIteratorUtf8 > segment(std::string_view input) const
Definition GraphemeClusterSegmenter.hpp:53
static std::unique_ptr< icu4x::GraphemeClusterSegmenter > create()
Definition GraphemeClusterSegmenter.hpp:43
Definition diplomat_runtime.hpp:125
Definition diplomat_runtime.hpp:111