1 #ifndef icu4x_ZonedDateTimeFormatter_D_HPP 2 #define icu4x_ZonedDateTimeFormatter_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 Date; } 17 class Date; 18 namespace capi { struct IsoDate; } 19 class IsoDate; 20 namespace capi { struct Locale; } 21 class Locale; 22 namespace capi { struct Time; } 23 class Time; 24 namespace capi { struct TimeZoneInfo; } 25 class TimeZoneInfo; 26 namespace capi { struct ZonedDateTimeFormatter; } 27 class ZonedDateTimeFormatter; 28 class DateTimeFormatError; 29 class DateTimeFormatterLoadError; 30 class DateTimeLength; 31 } 32 33 34 namespace icu4x { 35 namespace capi { 36 struct ZonedDateTimeFormatter; 37 } // namespace capi 38 } // namespace 39 40 namespace icu4x { 41 class ZonedDateTimeFormatter { 42 public: 43 44 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateTimeFormatter>, icu4x::DateTimeFormatterLoadError> create_with_length(const icu4x::Locale& locale, icu4x::DateTimeLength length); 45 46 inline static diplomat::result<std::unique_ptr<icu4x::ZonedDateTimeFormatter>, icu4x::DateTimeFormatterLoadError> create_with_length_and_provider(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::DateTimeLength length); 47 48 inline diplomat::result<std::string, icu4x::DateTimeFormatError> format(const icu4x::Date& date, const icu4x::Time& time, const icu4x::TimeZoneInfo& zone) const; 49 50 inline diplomat::result<std::string, icu4x::DateTimeFormatError> format_iso(const icu4x::IsoDate& date, const icu4x::Time& time, const icu4x::TimeZoneInfo& zone) const; 51 52 inline const icu4x::capi::ZonedDateTimeFormatter* AsFFI() const; 53 inline icu4x::capi::ZonedDateTimeFormatter* AsFFI(); 54 inline static const icu4x::ZonedDateTimeFormatter* FromFFI(const icu4x::capi::ZonedDateTimeFormatter* ptr); 55 inline static icu4x::ZonedDateTimeFormatter* FromFFI(icu4x::capi::ZonedDateTimeFormatter* ptr); 56 inline static void operator delete(void* ptr); 57 private: 58 ZonedDateTimeFormatter() = delete; 59 ZonedDateTimeFormatter(const icu4x::ZonedDateTimeFormatter&) = delete; 60 ZonedDateTimeFormatter(icu4x::ZonedDateTimeFormatter&&) noexcept = delete; 61 ZonedDateTimeFormatter operator=(const icu4x::ZonedDateTimeFormatter&) = delete; 62 ZonedDateTimeFormatter operator=(icu4x::ZonedDateTimeFormatter&&) noexcept = delete; 63 static void operator delete[](void*, size_t) = delete; 64 }; 65 66 } // namespace 67 #endif // icu4x_ZonedDateTimeFormatter_D_HPP 68