14#include <unicode/ubrk.h>
15#include <unicode/uloc.h>
16#include <unicode/utypes.h>
22template<
typename T,
typename =
void>
24 static UBreakIterator* clone(
T bi, UErrorCode* status) {
25 return ubrk_safeClone(bi,
nullptr,
nullptr, status);
29struct SkUbrkClone<
T,
std::
void_t<decltype(ubrk_clone(std::declval<T>(), nullptr))>> {
30 static UBreakIterator* clone(
T bi, UErrorCode* status) {
31 return ubrk_clone(bi, status);
37template<
typename T,
typename =
void>
38struct SkUbrkGetLocaleByType {
39 static const char* getLocaleByType(
T bi, ULocDataLocaleType
type, UErrorCode* status) {
40 *status = U_UNSUPPORTED_ERROR;
45struct SkUbrkGetLocaleByType<
47 std::
void_t<decltype(ubrk_getLocaleByType(std::declval<T>(),
48 std::declval<ULocDataLocaleType>(),
51 static const char* getLocaleByType(
T bi, ULocDataLocaleType
type, UErrorCode* status) {
52 return ubrk_getLocaleByType(bi,
type, status);
58#define SKICU_FUNC(funcname) funcname,
60 return std::make_unique<SkICULib>(
SkICULib{
62 &SkUbrkClone<const UBreakIterator*>::clone,
64 &SkUbrkGetLocaleByType<const UBreakIterator*>::getLocaleByType,
std::unique_ptr< SkICULib > SkLoadICULib()