CaseMapCloser.d.hpp (3142B)
1 #ifndef icu4x_CaseMapCloser_D_HPP 2 #define icu4x_CaseMapCloser_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 <cstdlib> 12 #include "../diplomat_runtime.hpp" 13 14 namespace icu4x { 15 namespace capi { struct CaseMapCloser; } 16 class CaseMapCloser; 17 namespace capi { struct CodePointSetBuilder; } 18 class CodePointSetBuilder; 19 namespace capi { struct DataProvider; } 20 class DataProvider; 21 class DataError; 22 } 23 24 25 namespace icu4x { 26 namespace capi { 27 struct CaseMapCloser; 28 } // namespace capi 29 } // namespace 30 31 namespace icu4x { 32 /** 33 * See the [Rust documentation for `CaseMapCloser`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html) for more information. 34 */ 35 class CaseMapCloser { 36 public: 37 38 /** 39 * Construct a new CaseMapCloser instance using compiled data. 40 * 41 * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html#method.new) for more information. 42 */ 43 inline static diplomat::result<std::unique_ptr<icu4x::CaseMapCloser>, icu4x::DataError> create(); 44 45 /** 46 * Construct a new CaseMapCloser instance using a particular data source. 47 * 48 * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloser.html#method.new) for more information. 49 */ 50 inline static diplomat::result<std::unique_ptr<icu4x::CaseMapCloser>, icu4x::DataError> create_with_provider(const icu4x::DataProvider& provider); 51 52 /** 53 * Adds all simple case mappings and the full case folding for `c` to `builder`. 54 * Also adds special case closure mappings. 55 * 56 * See the [Rust documentation for `add_case_closure_to`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloserBorrowed.html#method.add_case_closure_to) for more information. 57 */ 58 inline void add_case_closure_to(char32_t c, icu4x::CodePointSetBuilder& builder) const; 59 60 /** 61 * Finds all characters and strings which may casemap to `s` as their full case folding string 62 * and adds them to the set. 63 * 64 * Returns true if the string was found 65 * 66 * See the [Rust documentation for `add_string_case_closure_to`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapCloserBorrowed.html#method.add_string_case_closure_to) for more information. 67 */ 68 inline bool add_string_case_closure_to(std::string_view s, icu4x::CodePointSetBuilder& builder) const; 69 70 inline const icu4x::capi::CaseMapCloser* AsFFI() const; 71 inline icu4x::capi::CaseMapCloser* AsFFI(); 72 inline static const icu4x::CaseMapCloser* FromFFI(const icu4x::capi::CaseMapCloser* ptr); 73 inline static icu4x::CaseMapCloser* FromFFI(icu4x::capi::CaseMapCloser* ptr); 74 inline static void operator delete(void* ptr); 75 private: 76 CaseMapCloser() = delete; 77 CaseMapCloser(const icu4x::CaseMapCloser&) = delete; 78 CaseMapCloser(icu4x::CaseMapCloser&&) noexcept = delete; 79 CaseMapCloser operator=(const icu4x::CaseMapCloser&) = delete; 80 CaseMapCloser operator=(icu4x::CaseMapCloser&&) noexcept = delete; 81 static void operator delete[](void*, size_t) = delete; 82 }; 83 84 } // namespace 85 #endif // icu4x_CaseMapCloser_D_HPP