1#ifndef icu4x_LineSegmenter_HPP
2#define icu4x_LineSegmenter_HPP
28 icu4x::capi::LineSegmenter* icu4x_LineSegmenter_create_auto_mv1(
void);
30 icu4x::capi::LineSegmenter* icu4x_LineSegmenter_create_lstm_mv1(
void);
32 icu4x::capi::LineSegmenter* icu4x_LineSegmenter_create_dictionary_mv1(
void);
34 icu4x::capi::LineSegmenter* icu4x_LineSegmenter_create_auto_with_options_v2_mv1(
const icu4x::capi::Locale* content_locale, icu4x::capi::LineBreakOptionsV2 options);
36 typedef struct icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1_result {
union {icu4x::capi::LineSegmenter* ok; icu4x::capi::DataError err;};
bool is_ok;} icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1_result;
37 icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1_result icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1(
const icu4x::capi::DataProvider* provider,
const icu4x::capi::Locale* content_locale, icu4x::capi::LineBreakOptionsV2 options);
39 icu4x::capi::LineSegmenter* icu4x_LineSegmenter_create_lstm_with_options_v2_mv1(
const icu4x::capi::Locale* content_locale, icu4x::capi::LineBreakOptionsV2 options);
41 typedef struct icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1_result {
union {icu4x::capi::LineSegmenter* ok; icu4x::capi::DataError err;};
bool is_ok;} icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1_result;
42 icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1_result icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1(
const icu4x::capi::DataProvider* provider,
const icu4x::capi::Locale* content_locale, icu4x::capi::LineBreakOptionsV2 options);
44 icu4x::capi::LineSegmenter* icu4x_LineSegmenter_create_dictionary_with_options_v2_mv1(
const icu4x::capi::Locale* content_locale, icu4x::capi::LineBreakOptionsV2 options);
46 typedef struct icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1_result {
union {icu4x::capi::LineSegmenter* ok; icu4x::capi::DataError err;};
bool is_ok;} icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1_result;
47 icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1_result icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1(
const icu4x::capi::DataProvider* provider,
const icu4x::capi::Locale* content_locale, icu4x::capi::LineBreakOptionsV2 options);
49 icu4x::capi::LineBreakIteratorUtf8* icu4x_LineSegmenter_segment_utf8_mv1(
const icu4x::capi::LineSegmenter* self, diplomat::capi::DiplomatStringView input);
51 icu4x::capi::LineBreakIteratorUtf16* icu4x_LineSegmenter_segment_utf16_mv1(
const icu4x::capi::LineSegmenter* self, diplomat::capi::DiplomatString16View input);
53 icu4x::capi::LineBreakIteratorLatin1* icu4x_LineSegmenter_segment_latin1_mv1(
const icu4x::capi::LineSegmenter* self, diplomat::capi::DiplomatU8View input);
55 void icu4x_LineSegmenter_destroy_mv1(LineSegmenter* self);
62 auto result = icu4x::capi::icu4x_LineSegmenter_create_auto_mv1();
63 return std::unique_ptr<icu4x::LineSegmenter>(icu4x::LineSegmenter::FromFFI(result));
67 auto result = icu4x::capi::icu4x_LineSegmenter_create_lstm_mv1();
68 return std::unique_ptr<icu4x::LineSegmenter>(icu4x::LineSegmenter::FromFFI(result));
72 auto result = icu4x::capi::icu4x_LineSegmenter_create_dictionary_mv1();
73 return std::unique_ptr<icu4x::LineSegmenter>(icu4x::LineSegmenter::FromFFI(result));
77 auto result = icu4x::capi::icu4x_LineSegmenter_create_auto_with_options_v2_mv1(content_locale ? content_locale->AsFFI() :
nullptr,
79 return std::unique_ptr<icu4x::LineSegmenter>(icu4x::LineSegmenter::FromFFI(result));
83 auto result = icu4x::capi::icu4x_LineSegmenter_create_auto_with_options_v2_and_provider_mv1(provider.AsFFI(),
84 content_locale ? content_locale->AsFFI() :
nullptr,
90 auto result = icu4x::capi::icu4x_LineSegmenter_create_lstm_with_options_v2_mv1(content_locale ? content_locale->AsFFI() :
nullptr,
92 return std::unique_ptr<icu4x::LineSegmenter>(icu4x::LineSegmenter::FromFFI(result));
96 auto result = icu4x::capi::icu4x_LineSegmenter_create_lstm_with_options_v2_and_provider_mv1(provider.AsFFI(),
97 content_locale ? content_locale->AsFFI() :
nullptr,
103 auto result = icu4x::capi::icu4x_LineSegmenter_create_dictionary_with_options_v2_mv1(content_locale ? content_locale->AsFFI() :
nullptr,
105 return std::unique_ptr<icu4x::LineSegmenter>(icu4x::LineSegmenter::FromFFI(result));
109 auto result = icu4x::capi::icu4x_LineSegmenter_create_dictionary_with_options_v2_and_provider_mv1(provider.AsFFI(),
110 content_locale ? content_locale->AsFFI() :
nullptr,
116 auto result = icu4x::capi::icu4x_LineSegmenter_segment_utf8_mv1(this->AsFFI(),
117 {input.data(), input.size()});
118 return std::unique_ptr<icu4x::LineBreakIteratorUtf8>(icu4x::LineBreakIteratorUtf8::FromFFI(result));
122 auto result = icu4x::capi::icu4x_LineSegmenter_segment_utf16_mv1(this->AsFFI(),
123 {input.data(), input.size()});
124 return std::unique_ptr<icu4x::LineBreakIteratorUtf16>(icu4x::LineBreakIteratorUtf16::FromFFI(result));
128 auto result = icu4x::capi::icu4x_LineSegmenter_segment_latin1_mv1(this->AsFFI(),
130 return std::unique_ptr<icu4x::LineBreakIteratorLatin1>(icu4x::LineBreakIteratorLatin1::FromFFI(result));
133inline const icu4x::capi::LineSegmenter* icu4x::LineSegmenter::AsFFI()
const {
134 return reinterpret_cast<const icu4x::capi::LineSegmenter*
>(
this);
137inline icu4x::capi::LineSegmenter* icu4x::LineSegmenter::AsFFI() {
138 return reinterpret_cast<icu4x::capi::LineSegmenter*
>(
this);
141inline const icu4x::LineSegmenter* icu4x::LineSegmenter::FromFFI(
const icu4x::capi::LineSegmenter* ptr) {
142 return reinterpret_cast<const icu4x::LineSegmenter*
>(ptr);
145inline icu4x::LineSegmenter* icu4x::LineSegmenter::FromFFI(icu4x::capi::LineSegmenter* ptr) {
146 return reinterpret_cast<icu4x::LineSegmenter*
>(ptr);
149inline void icu4x::LineSegmenter::operator
delete(
void* ptr) {
150 icu4x::capi::icu4x_LineSegmenter_destroy_mv1(
reinterpret_cast<icu4x::capi::LineSegmenter*
>(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
static std::unique_ptr< icu4x::LineSegmenter > create_dictionary_with_options_v2(const icu4x::Locale *content_locale, icu4x::LineBreakOptionsV2 options)
Definition LineSegmenter.hpp:102
std::unique_ptr< icu4x::LineBreakIteratorLatin1 > segment_latin1(diplomat::span< const uint8_t > input) const
Definition LineSegmenter.hpp:127
std::unique_ptr< icu4x::LineBreakIteratorUtf16 > segment16(std::u16string_view input) const
Definition LineSegmenter.hpp:121
std::unique_ptr< icu4x::LineBreakIteratorUtf8 > segment(std::string_view input) const
Definition LineSegmenter.hpp:115
static std::unique_ptr< icu4x::LineSegmenter > create_auto_with_options_v2(const icu4x::Locale *content_locale, icu4x::LineBreakOptionsV2 options)
Definition LineSegmenter.hpp:76
static diplomat::result< std::unique_ptr< icu4x::LineSegmenter >, icu4x::DataError > create_lstm_with_options_v2_and_provider(const icu4x::DataProvider &provider, const icu4x::Locale *content_locale, icu4x::LineBreakOptionsV2 options)
Definition LineSegmenter.hpp:95
static std::unique_ptr< icu4x::LineSegmenter > create_lstm_with_options_v2(const icu4x::Locale *content_locale, icu4x::LineBreakOptionsV2 options)
Definition LineSegmenter.hpp:89
static std::unique_ptr< icu4x::LineSegmenter > create_dictionary()
Definition LineSegmenter.hpp:71
static std::unique_ptr< icu4x::LineSegmenter > create_lstm()
Definition LineSegmenter.hpp:66
static diplomat::result< std::unique_ptr< icu4x::LineSegmenter >, icu4x::DataError > create_auto_with_options_v2_and_provider(const icu4x::DataProvider &provider, const icu4x::Locale *content_locale, icu4x::LineBreakOptionsV2 options)
Definition LineSegmenter.hpp:82
static diplomat::result< std::unique_ptr< icu4x::LineSegmenter >, icu4x::DataError > create_dictionary_with_options_v2_and_provider(const icu4x::DataProvider &provider, const icu4x::Locale *content_locale, icu4x::LineBreakOptionsV2 options)
Definition LineSegmenter.hpp:108
static std::unique_ptr< icu4x::LineSegmenter > create_auto()
Definition LineSegmenter.hpp:61
Definition Locale.d.hpp:33
Definition diplomat_runtime.hpp:125
Definition diplomat_runtime.hpp:111
Definition LineBreakOptionsV2.d.hpp:38