ListFormatter.d.hpp (4621B)
1 #ifndef icu4x_ListFormatter_D_HPP 2 #define icu4x_ListFormatter_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 ListFormatter; } 18 class ListFormatter; 19 namespace capi { struct Locale; } 20 class Locale; 21 class DataError; 22 class ListLength; 23 } 24 25 26 namespace icu4x { 27 namespace capi { 28 struct ListFormatter; 29 } // namespace capi 30 } // namespace 31 32 namespace icu4x { 33 /** 34 * See the [Rust documentation for `ListFormatter`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html) for more information. 35 */ 36 class ListFormatter { 37 public: 38 39 /** 40 * Construct a new ListFormatter instance for And patterns from compiled data. 41 * 42 * See the [Rust documentation for `try_new_and`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_and) for more information. 43 */ 44 inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_and_with_length(const icu4x::Locale& locale, icu4x::ListLength length); 45 46 /** 47 * Construct a new ListFormatter instance for And patterns 48 * 49 * See the [Rust documentation for `try_new_and`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_and) for more information. 50 */ 51 inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_and_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::ListLength length); 52 53 /** 54 * Construct a new ListFormatter instance for And patterns from compiled data. 55 * 56 * See the [Rust documentation for `try_new_or`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_or) for more information. 57 */ 58 inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_or_with_length(const icu4x::Locale& locale, icu4x::ListLength length); 59 60 /** 61 * Construct a new ListFormatter instance for And patterns 62 * 63 * See the [Rust documentation for `try_new_or`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_or) for more information. 64 */ 65 inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_or_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::ListLength length); 66 67 /** 68 * Construct a new ListFormatter instance for And patterns from compiled data. 69 * 70 * See the [Rust documentation for `try_new_unit`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_unit) for more information. 71 */ 72 inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_unit_with_length(const icu4x::Locale& locale, icu4x::ListLength length); 73 74 /** 75 * Construct a new ListFormatter instance for And patterns 76 * 77 * See the [Rust documentation for `try_new_unit`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_unit) for more information. 78 */ 79 inline static diplomat::result<std::unique_ptr<icu4x::ListFormatter>, icu4x::DataError> create_unit_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::ListLength length); 80 81 /** 82 * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.format) for more information. 83 */ 84 inline std::string format(diplomat::span<const std::string_view> list) const; 85 86 /** 87 * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.format) for more information. 88 */ 89 inline std::string format16(diplomat::span<const std::u16string_view> list) const; 90 91 inline const icu4x::capi::ListFormatter* AsFFI() const; 92 inline icu4x::capi::ListFormatter* AsFFI(); 93 inline static const icu4x::ListFormatter* FromFFI(const icu4x::capi::ListFormatter* ptr); 94 inline static icu4x::ListFormatter* FromFFI(icu4x::capi::ListFormatter* ptr); 95 inline static void operator delete(void* ptr); 96 private: 97 ListFormatter() = delete; 98 ListFormatter(const icu4x::ListFormatter&) = delete; 99 ListFormatter(icu4x::ListFormatter&&) noexcept = delete; 100 ListFormatter operator=(const icu4x::ListFormatter&) = delete; 101 ListFormatter operator=(icu4x::ListFormatter&&) noexcept = delete; 102 static void operator delete[](void*, size_t) = delete; 103 }; 104 105 } // namespace 106 #endif // icu4x_ListFormatter_D_HPP