1#ifndef icu4x_CaseMapper_HPP
2#define icu4x_CaseMapper_HPP
26 icu4x::capi::CaseMapper* icu4x_CaseMapper_create_mv1(
void);
28 typedef struct icu4x_CaseMapper_create_with_provider_mv1_result {
union {icu4x::capi::CaseMapper* ok; icu4x::capi::DataError err;};
bool is_ok;} icu4x_CaseMapper_create_with_provider_mv1_result;
29 icu4x_CaseMapper_create_with_provider_mv1_result icu4x_CaseMapper_create_with_provider_mv1(
const icu4x::capi::DataProvider* provider);
31 void icu4x_CaseMapper_lowercase_mv1(
const icu4x::capi::CaseMapper* self, diplomat::capi::DiplomatStringView s,
const icu4x::capi::Locale* locale, diplomat::capi::DiplomatWrite* write);
33 void icu4x_CaseMapper_uppercase_mv1(
const icu4x::capi::CaseMapper* self, diplomat::capi::DiplomatStringView s,
const icu4x::capi::Locale* locale, diplomat::capi::DiplomatWrite* write);
35 void icu4x_CaseMapper_lowercase_with_compiled_data_mv1(diplomat::capi::DiplomatStringView s,
const icu4x::capi::Locale* locale, diplomat::capi::DiplomatWrite* write);
37 void icu4x_CaseMapper_uppercase_with_compiled_data_mv1(diplomat::capi::DiplomatStringView s,
const icu4x::capi::Locale* locale, diplomat::capi::DiplomatWrite* write);
39 void icu4x_CaseMapper_titlecase_segment_with_only_case_data_v1_mv1(
const icu4x::capi::CaseMapper* self, diplomat::capi::DiplomatStringView s,
const icu4x::capi::Locale* locale, icu4x::capi::TitlecaseOptionsV1 options, diplomat::capi::DiplomatWrite* write);
41 void icu4x_CaseMapper_fold_mv1(
const icu4x::capi::CaseMapper* self, diplomat::capi::DiplomatStringView s, diplomat::capi::DiplomatWrite* write);
43 void icu4x_CaseMapper_fold_turkic_mv1(
const icu4x::capi::CaseMapper* self, diplomat::capi::DiplomatStringView s, diplomat::capi::DiplomatWrite* write);
45 void icu4x_CaseMapper_add_case_closure_to_mv1(
const icu4x::capi::CaseMapper* self,
char32_t c, icu4x::capi::CodePointSetBuilder* builder);
47 char32_t icu4x_CaseMapper_simple_lowercase_mv1(
const icu4x::capi::CaseMapper* self,
char32_t ch);
49 char32_t icu4x_CaseMapper_simple_uppercase_mv1(
const icu4x::capi::CaseMapper* self,
char32_t ch);
51 char32_t icu4x_CaseMapper_simple_titlecase_mv1(
const icu4x::capi::CaseMapper* self,
char32_t ch);
53 char32_t icu4x_CaseMapper_simple_fold_mv1(
const icu4x::capi::CaseMapper* self,
char32_t ch);
55 char32_t icu4x_CaseMapper_simple_fold_turkic_mv1(
const icu4x::capi::CaseMapper* self,
char32_t ch);
57 void icu4x_CaseMapper_destroy_mv1(CaseMapper* self);
64 auto result = icu4x::capi::icu4x_CaseMapper_create_mv1();
65 return std::unique_ptr<icu4x::CaseMapper>(icu4x::CaseMapper::FromFFI(result));
69 auto result = icu4x::capi::icu4x_CaseMapper_create_with_provider_mv1(provider.AsFFI());
74 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
78 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
79 icu4x::capi::icu4x_CaseMapper_lowercase_mv1(this->AsFFI(),
87 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
91 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
92 icu4x::capi::icu4x_CaseMapper_uppercase_mv1(this->AsFFI(),
100 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
104 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
105 icu4x::capi::icu4x_CaseMapper_lowercase_with_compiled_data_mv1({s.data(), s.size()},
112 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
116 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
117 icu4x::capi::icu4x_CaseMapper_uppercase_with_compiled_data_mv1({s.data(), s.size()},
124 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
128 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
129 icu4x::capi::icu4x_CaseMapper_titlecase_segment_with_only_case_data_v1_mv1(this->AsFFI(),
130 {s.data(), s.size()},
138 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
142 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
143 icu4x::capi::icu4x_CaseMapper_fold_mv1(this->AsFFI(),
144 {s.data(), s.size()},
150 if (!diplomat::capi::diplomat_is_str(s.data(), s.size())) {
154 diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output);
155 icu4x::capi::icu4x_CaseMapper_fold_turkic_mv1(this->AsFFI(),
156 {s.data(), s.size()},
162 icu4x::capi::icu4x_CaseMapper_add_case_closure_to_mv1(this->AsFFI(),
168 auto result = icu4x::capi::icu4x_CaseMapper_simple_lowercase_mv1(this->AsFFI(),
174 auto result = icu4x::capi::icu4x_CaseMapper_simple_uppercase_mv1(this->AsFFI(),
180 auto result = icu4x::capi::icu4x_CaseMapper_simple_titlecase_mv1(this->AsFFI(),
186 auto result = icu4x::capi::icu4x_CaseMapper_simple_fold_mv1(this->AsFFI(),
192 auto result = icu4x::capi::icu4x_CaseMapper_simple_fold_turkic_mv1(this->AsFFI(),
197inline const icu4x::capi::CaseMapper* icu4x::CaseMapper::AsFFI()
const {
198 return reinterpret_cast<const icu4x::capi::CaseMapper*
>(
this);
201inline icu4x::capi::CaseMapper* icu4x::CaseMapper::AsFFI() {
202 return reinterpret_cast<icu4x::capi::CaseMapper*
>(
this);
205inline const icu4x::CaseMapper* icu4x::CaseMapper::FromFFI(
const icu4x::capi::CaseMapper* ptr) {
206 return reinterpret_cast<const icu4x::CaseMapper*
>(ptr);
209inline icu4x::CaseMapper* icu4x::CaseMapper::FromFFI(icu4x::capi::CaseMapper* ptr) {
210 return reinterpret_cast<icu4x::CaseMapper*
>(ptr);
213inline void icu4x::CaseMapper::operator
delete(
void* ptr) {
214 icu4x::capi::icu4x_CaseMapper_destroy_mv1(
reinterpret_cast<icu4x::capi::CaseMapper*
>(ptr));
Definition diplomat_runtime.hpp:140
static std::unique_ptr< icu4x::CaseMapper > create()
Definition CaseMapper.hpp:63
diplomat::result< std::string, diplomat::Utf8Error > uppercase(std::string_view s, const icu4x::Locale &locale) const
Definition CaseMapper.hpp:86
diplomat::result< std::string, diplomat::Utf8Error > fold_turkic(std::string_view s) const
Definition CaseMapper.hpp:149
char32_t simple_fold(char32_t ch) const
Definition CaseMapper.hpp:185
diplomat::result< std::string, diplomat::Utf8Error > lowercase(std::string_view s, const icu4x::Locale &locale) const
Definition CaseMapper.hpp:73
char32_t simple_titlecase(char32_t ch) const
Definition CaseMapper.hpp:179
void add_case_closure_to(char32_t c, icu4x::CodePointSetBuilder &builder) const
Definition CaseMapper.hpp:161
diplomat::result< std::string, diplomat::Utf8Error > fold(std::string_view s) const
Definition CaseMapper.hpp:137
static diplomat::result< std::string, diplomat::Utf8Error > uppercase_with_compiled_data(std::string_view s, const icu4x::Locale &locale)
Definition CaseMapper.hpp:111
char32_t simple_fold_turkic(char32_t ch) const
Definition CaseMapper.hpp:191
static diplomat::result< std::string, diplomat::Utf8Error > lowercase_with_compiled_data(std::string_view s, const icu4x::Locale &locale)
Definition CaseMapper.hpp:99
char32_t simple_lowercase(char32_t ch) const
Definition CaseMapper.hpp:167
static diplomat::result< std::unique_ptr< icu4x::CaseMapper >, icu4x::DataError > create_with_provider(const icu4x::DataProvider &provider)
Definition CaseMapper.hpp:68
diplomat::result< std::string, diplomat::Utf8Error > titlecase_segment_with_only_case_data_v1(std::string_view s, const icu4x::Locale &locale, icu4x::TitlecaseOptionsV1 options) const
Definition CaseMapper.hpp:123
char32_t simple_uppercase(char32_t ch) const
Definition CaseMapper.hpp:173
Definition CodePointSetBuilder.d.hpp:32
Definition DataError.d.hpp:37
Definition DataProvider.d.hpp:40
Definition Locale.d.hpp:33
Definition diplomat_runtime.hpp:125
Definition diplomat_runtime.hpp:111
Definition TitlecaseOptionsV1.d.hpp:39