1 #ifndef icu4x_GraphemeClusterSegmenter_D_HPP 2 #define icu4x_GraphemeClusterSegmenter_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 "../diplomat_runtime.hpp" 12 13 namespace icu4x { 14 namespace capi { struct DataProvider; } 15 class DataProvider; 16 namespace capi { struct GraphemeClusterBreakIteratorLatin1; } 17 class GraphemeClusterBreakIteratorLatin1; 18 namespace capi { struct GraphemeClusterBreakIteratorUtf16; } 19 class GraphemeClusterBreakIteratorUtf16; 20 namespace capi { struct GraphemeClusterBreakIteratorUtf8; } 21 class GraphemeClusterBreakIteratorUtf8; 22 namespace capi { struct GraphemeClusterSegmenter; } 23 class GraphemeClusterSegmenter; 24 class DataError; 25 } 26 27 28 namespace icu4x { 29 namespace capi { 30 struct GraphemeClusterSegmenter; 31 } // namespace capi 32 } // namespace 33 34 namespace icu4x { 35 class GraphemeClusterSegmenter { 36 public: 37 38 inline static std::unique_ptr<icu4x::GraphemeClusterSegmenter> create(); 39 40 inline static diplomat::result<std::unique_ptr<icu4x::GraphemeClusterSegmenter>, icu4x::DataError> create_with_provider(const icu4x::DataProvider& provider); 41 42 inline std::unique_ptr<icu4x::GraphemeClusterBreakIteratorUtf8> segment(std::string_view input) const; 43 44 inline std::unique_ptr<icu4x::GraphemeClusterBreakIteratorUtf16> segment16(std::u16string_view input) const; 45 46 inline std::unique_ptr<icu4x::GraphemeClusterBreakIteratorLatin1> segment_latin1(diplomat::span<const uint8_t> input) const; 47 48 inline const icu4x::capi::GraphemeClusterSegmenter* AsFFI() const; 49 inline icu4x::capi::GraphemeClusterSegmenter* AsFFI(); 50 inline static const icu4x::GraphemeClusterSegmenter* FromFFI(const icu4x::capi::GraphemeClusterSegmenter* ptr); 51 inline static icu4x::GraphemeClusterSegmenter* FromFFI(icu4x::capi::GraphemeClusterSegmenter* ptr); 52 inline static void operator delete(void* ptr); 53 private: 54 GraphemeClusterSegmenter() = delete; 55 GraphemeClusterSegmenter(const icu4x::GraphemeClusterSegmenter&) = delete; 56 GraphemeClusterSegmenter(icu4x::GraphemeClusterSegmenter&&) noexcept = delete; 57 GraphemeClusterSegmenter operator=(const icu4x::GraphemeClusterSegmenter&) = delete; 58 GraphemeClusterSegmenter operator=(icu4x::GraphemeClusterSegmenter&&) noexcept = delete; 59 static void operator delete[](void*, size_t) = delete; 60 }; 61 62 } // namespace 63 #endif // icu4x_GraphemeClusterSegmenter_D_HPP 64