1 #ifndef icu4x_TimeZone_D_HPP 2 #define icu4x_TimeZone_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 TimeZone; } 15 class TimeZone; 16 namespace capi { struct TimeZoneInfo; } 17 class TimeZoneInfo; 18 namespace capi { struct UtcOffset; } 19 class UtcOffset; 20 } 21 22 23 namespace icu4x { 24 namespace capi { 25 struct TimeZone; 26 } // namespace capi 27 } // namespace 28 29 namespace icu4x { 30 class TimeZone { 31 public: 32 33 inline static std::unique_ptr<icu4x::TimeZone> unknown(); 34 35 inline static std::unique_ptr<icu4x::TimeZone> create_from_bcp47(std::string_view id); 36 37 inline std::unique_ptr<icu4x::TimeZoneInfo> with_offset(const icu4x::UtcOffset& offset) const; 38 39 inline std::unique_ptr<icu4x::TimeZoneInfo> without_offset() const; 40 41 inline const icu4x::capi::TimeZone* AsFFI() const; 42 inline icu4x::capi::TimeZone* AsFFI(); 43 inline static const icu4x::TimeZone* FromFFI(const icu4x::capi::TimeZone* ptr); 44 inline static icu4x::TimeZone* FromFFI(icu4x::capi::TimeZone* ptr); 45 inline static void operator delete(void* ptr); 46 private: 47 TimeZone() = delete; 48 TimeZone(const icu4x::TimeZone&) = delete; 49 TimeZone(icu4x::TimeZone&&) noexcept = delete; 50 TimeZone operator=(const icu4x::TimeZone&) = delete; 51 TimeZone operator=(icu4x::TimeZone&&) noexcept = delete; 52 static void operator delete[](void*, size_t) = delete; 53 }; 54 55 } // namespace 56 #endif // icu4x_TimeZone_D_HPP 57