ZonedDateFormatterGregorian.d.hpp (12626B)
1 #ifndef icu4x_ZonedDateFormatterGregorian_D_HPP 2 #define icu4x_ZonedDateFormatterGregorian_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 DateFormatterGregorian; } 18 class DateFormatterGregorian; 19 namespace capi { struct IsoDate; } 20 class IsoDate; 21 namespace capi { struct Locale; } 22 class Locale; 23 namespace capi { struct TimeZoneInfo; } 24 class TimeZoneInfo; 25 namespace capi { struct ZonedDateFormatterGregorian; } 26 class ZonedDateFormatterGregorian; 27 class DateTimeFormatterLoadError; 28 class DateTimeWriteError; 29 } 30 31 32 namespace icu4x { 33 namespace capi { 34 struct ZonedDateFormatterGregorian; 35 } // namespace capi 36 } // namespace 37 38 namespace icu4x { 39 /** 40 * See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information. 41 */ 42 class ZonedDateFormatterGregorian { 43 public: 44 45 /** 46 * Creates a zoned formatter based on a non-zoned formatter. 47 * 48 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 49 * or else unexpected behavior may occur! 50 * 51 * See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information. 52 */ 53 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_specific_long(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 54 55 /** 56 * Creates a zoned formatter based on a non-zoned formatter. 57 * 58 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 59 * or else unexpected behavior may occur! 60 * 61 * See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information. 62 */ 63 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_specific_long_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 64 65 /** 66 * Creates a zoned formatter based on a non-zoned formatter. 67 * 68 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 69 * or else unexpected behavior may occur! 70 * 71 * See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information. 72 */ 73 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_specific_short(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 74 75 /** 76 * Creates a zoned formatter based on a non-zoned formatter. 77 * 78 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 79 * or else unexpected behavior may occur! 80 * 81 * See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information. 82 */ 83 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_specific_short_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 84 85 /** 86 * Creates a zoned formatter based on a non-zoned formatter. 87 * 88 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 89 * or else unexpected behavior may occur! 90 * 91 * See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information. 92 */ 93 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_localized_offset_long(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 94 95 /** 96 * Creates a zoned formatter based on a non-zoned formatter. 97 * 98 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 99 * or else unexpected behavior may occur! 100 * 101 * See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information. 102 */ 103 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_localized_offset_long_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 104 105 /** 106 * Creates a zoned formatter based on a non-zoned formatter. 107 * 108 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 109 * or else unexpected behavior may occur! 110 * 111 * See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information. 112 */ 113 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_localized_offset_short(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 114 115 /** 116 * Creates a zoned formatter based on a non-zoned formatter. 117 * 118 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 119 * or else unexpected behavior may occur! 120 * 121 * See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information. 122 */ 123 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_localized_offset_short_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 124 125 /** 126 * Creates a zoned formatter based on a non-zoned formatter. 127 * 128 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 129 * or else unexpected behavior may occur! 130 * 131 * See the [Rust documentation for `GenericLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information. 132 */ 133 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_generic_long(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 134 135 /** 136 * Creates a zoned formatter based on a non-zoned formatter. 137 * 138 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 139 * or else unexpected behavior may occur! 140 * 141 * See the [Rust documentation for `GenericLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information. 142 */ 143 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_generic_long_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 144 145 /** 146 * Creates a zoned formatter based on a non-zoned formatter. 147 * 148 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 149 * or else unexpected behavior may occur! 150 * 151 * See the [Rust documentation for `GenericShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information. 152 */ 153 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_generic_short(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 154 155 /** 156 * Creates a zoned formatter based on a non-zoned formatter. 157 * 158 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 159 * or else unexpected behavior may occur! 160 * 161 * See the [Rust documentation for `GenericShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information. 162 */ 163 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_generic_short_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 164 165 /** 166 * Creates a zoned formatter based on a non-zoned formatter. 167 * 168 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 169 * or else unexpected behavior may occur! 170 * 171 * See the [Rust documentation for `Location`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.Location.html) for more information. 172 */ 173 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_location(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 174 175 /** 176 * Creates a zoned formatter based on a non-zoned formatter. 177 * 178 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 179 * or else unexpected behavior may occur! 180 * 181 * See the [Rust documentation for `Location`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.Location.html) for more information. 182 */ 183 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_location_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 184 185 /** 186 * Creates a zoned formatter based on a non-zoned formatter. 187 * 188 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 189 * or else unexpected behavior may occur! 190 * 191 * See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information. 192 */ 193 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_exemplar_city(const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 194 195 /** 196 * Creates a zoned formatter based on a non-zoned formatter. 197 * 198 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 199 * or else unexpected behavior may occur! 200 * 201 * See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information. 202 */ 203 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateFormatterGregorian>, icu4x::DateTimeFormatterLoadError> create_exemplar_city_with_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, const icu4x::DateFormatterGregorian& formatter); 204 205 /** 206 * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information. 207 */ 208 inline diplomat::result<std::string, icu4x::DateTimeWriteError> format_iso(const icu4x::IsoDate& date, const icu4x::TimeZoneInfo& zone) const; 209 210 inline const icu4x::capi::ZonedDateFormatterGregorian* AsFFI() const; 211 inline icu4x::capi::ZonedDateFormatterGregorian* AsFFI(); 212 inline static const icu4x::ZonedDateFormatterGregorian* FromFFI(const icu4x::capi::ZonedDateFormatterGregorian* ptr); 213 inline static icu4x::ZonedDateFormatterGregorian* FromFFI(icu4x::capi::ZonedDateFormatterGregorian* ptr); 214 inline static void operator delete(void* ptr); 215 private: 216 ZonedDateFormatterGregorian() = delete; 217 ZonedDateFormatterGregorian(const icu4x::ZonedDateFormatterGregorian&) = delete; 218 ZonedDateFormatterGregorian(icu4x::ZonedDateFormatterGregorian&&) noexcept = delete; 219 ZonedDateFormatterGregorian operator=(const icu4x::ZonedDateFormatterGregorian&) = delete; 220 ZonedDateFormatterGregorian operator=(icu4x::ZonedDateFormatterGregorian&&) noexcept = delete; 221 static void operator delete[](void*, size_t) = delete; 222 }; 223 224 } // namespace 225 #endif // icu4x_ZonedDateFormatterGregorian_D_HPP