ExemplarCharacters.d.hpp (7581B)
1 #ifndef icu4x_ExemplarCharacters_D_HPP 2 #define icu4x_ExemplarCharacters_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 DataProvider; } 16 class DataProvider; 17 namespace capi { struct ExemplarCharacters; } 18 class ExemplarCharacters; 19 namespace capi { struct Locale; } 20 class Locale; 21 class DataError; 22 } 23 24 25 namespace icu4x { 26 namespace capi { 27 struct ExemplarCharacters; 28 } // namespace capi 29 } // namespace 30 31 namespace icu4x { 32 /** 33 * A set of "exemplar characters" for a given locale. 34 * 35 * See the [Rust documentation for `locale`](https://docs.rs/icu/latest/icu/locale/index.html) for more information. 36 * 37 * See the [Rust documentation for `ExemplarCharacters`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html) for more information. 38 * 39 * See the [Rust documentation for `ExemplarCharactersBorrowed`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharactersBorrowed.html) for more information. 40 */ 41 class ExemplarCharacters { 42 public: 43 44 /** 45 * Checks whether the string is in the set. 46 * 47 * See the [Rust documentation for `contains_str`](https://docs.rs/icu/latest/icu/collections/codepointinvliststringlist/struct.CodePointInversionListAndStringList.html#method.contains_str) for more information. 48 */ 49 inline bool contains(std::string_view s) const; 50 51 /** 52 * Checks whether the code point is in the set. 53 * 54 * See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/collections/codepointinvliststringlist/struct.CodePointInversionListAndStringList.html#method.contains) for more information. 55 */ 56 inline bool contains(char32_t cp) const; 57 58 /** 59 * Create an [`ExemplarCharacters`] for the "main" set of exemplar characters for a given locale, using compiled data. 60 * 61 * See the [Rust documentation for `try_new_main`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_main) for more information. 62 */ 63 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_main(const icu4x::Locale& locale); 64 65 /** 66 * Create an [`ExemplarCharacters`] for the "main" set of exemplar characters for a given locale, using a particular data source 67 * 68 * See the [Rust documentation for `try_new_main`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_main) for more information. 69 */ 70 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_main_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale); 71 72 /** 73 * Create an [`ExemplarCharacters`] for the "auxiliary" set of exemplar characters for a given locale, using compiled data. 74 * 75 * See the [Rust documentation for `try_new_auxiliary`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_auxiliary) for more information. 76 */ 77 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_auxiliary(const icu4x::Locale& locale); 78 79 /** 80 * Create an [`ExemplarCharacters`] for the "auxiliary" set of exemplar characters for a given locale, using compiled data. 81 * 82 * See the [Rust documentation for `try_new_auxiliary`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_auxiliary) for more information. 83 */ 84 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_auxiliary_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale); 85 86 /** 87 * Create an [`ExemplarCharacters`] for the "punctuation" set of exemplar characters for a given locale, using compiled data. 88 * 89 * See the [Rust documentation for `try_new_punctuation`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_punctuation) for more information. 90 */ 91 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_punctuation(const icu4x::Locale& locale); 92 93 /** 94 * Create an [`ExemplarCharacters`] for the "punctuation" set of exemplar characters for a given locale, using compiled data. 95 * 96 * See the [Rust documentation for `try_new_punctuation`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_punctuation) for more information. 97 */ 98 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_punctuation_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale); 99 100 /** 101 * Create an [`ExemplarCharacters`] for the "numbers" set of exemplar characters for a given locale, using compiled data. 102 * 103 * See the [Rust documentation for `try_new_numbers`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_numbers) for more information. 104 */ 105 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_numbers(const icu4x::Locale& locale); 106 107 /** 108 * Create an [`ExemplarCharacters`] for the "numbers" set of exemplar characters for a given locale, using compiled data. 109 * 110 * See the [Rust documentation for `try_new_numbers`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_numbers) for more information. 111 */ 112 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_numbers_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale); 113 114 /** 115 * Create an [`ExemplarCharacters`] for the "index" set of exemplar characters for a given locale, using compiled data. 116 * 117 * See the [Rust documentation for `try_new_index`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_index) for more information. 118 */ 119 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_index(const icu4x::Locale& locale); 120 121 /** 122 * Create an [`ExemplarCharacters`] for the "index" set of exemplar characters for a given locale, using compiled data. 123 * 124 * See the [Rust documentation for `try_new_index`](https://docs.rs/icu/latest/icu/locale/exemplar_chars/struct.ExemplarCharacters.html#method.try_new_index) for more information. 125 */ 126 inline static diplomat::result<std::unique_ptr<icu4x::ExemplarCharacters>, icu4x::DataError> create_index_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale); 127 128 inline const icu4x::capi::ExemplarCharacters* AsFFI() const; 129 inline icu4x::capi::ExemplarCharacters* AsFFI(); 130 inline static const icu4x::ExemplarCharacters* FromFFI(const icu4x::capi::ExemplarCharacters* ptr); 131 inline static icu4x::ExemplarCharacters* FromFFI(icu4x::capi::ExemplarCharacters* ptr); 132 inline static void operator delete(void* ptr); 133 private: 134 ExemplarCharacters() = delete; 135 ExemplarCharacters(const icu4x::ExemplarCharacters&) = delete; 136 ExemplarCharacters(icu4x::ExemplarCharacters&&) noexcept = delete; 137 ExemplarCharacters operator=(const icu4x::ExemplarCharacters&) = delete; 138 ExemplarCharacters operator=(icu4x::ExemplarCharacters&&) noexcept = delete; 139 static void operator delete[](void*, size_t) = delete; 140 }; 141 142 } // namespace 143 #endif // icu4x_ExemplarCharacters_D_HPP