WindowsParser.d.hpp (2721B)
1 #ifndef icu4x_WindowsParser_D_HPP 2 #define icu4x_WindowsParser_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 TimeZone; } 18 class TimeZone; 19 namespace capi { struct WindowsParser; } 20 class WindowsParser; 21 class DataError; 22 } 23 24 25 namespace icu4x { 26 namespace capi { 27 struct WindowsParser; 28 } // namespace capi 29 } // namespace 30 31 namespace icu4x { 32 /** 33 * A mapper between Windows time zone identifiers and BCP-47 time zone identifiers. 34 * 35 * This mapper supports two-way mapping, but it is optimized for the case of Windows to BCP-47. 36 * It also supports normalizing and canonicalizing the Windows strings. 37 * 38 * See the [Rust documentation for `WindowsParser`](https://docs.rs/icu/latest/icu/time/zone/windows/struct.WindowsParser.html) for more information. 39 */ 40 class WindowsParser { 41 public: 42 43 /** 44 * Create a new [`WindowsParser`] using compiled data 45 * 46 * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/time/zone/windows/struct.WindowsParser.html#method.new) for more information. 47 */ 48 inline static std::unique_ptr<icu4x::WindowsParser> create(); 49 50 /** 51 * Create a new [`WindowsParser`] using a particular data source 52 * 53 * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/time/zone/windows/struct.WindowsParser.html#method.new) for more information. 54 */ 55 inline static diplomat::result<std::unique_ptr<icu4x::WindowsParser>, icu4x::DataError> create_with_provider(const icu4x::DataProvider& provider); 56 57 /** 58 * See the [Rust documentation for `parse`](https://docs.rs/icu/latest/icu/time/zone/windows/struct.WindowsParserBorrowed.html#method.parse) for more information. 59 */ 60 inline std::unique_ptr<icu4x::TimeZone> parse(std::string_view value, std::string_view region) const; 61 62 inline const icu4x::capi::WindowsParser* AsFFI() const; 63 inline icu4x::capi::WindowsParser* AsFFI(); 64 inline static const icu4x::WindowsParser* FromFFI(const icu4x::capi::WindowsParser* ptr); 65 inline static icu4x::WindowsParser* FromFFI(icu4x::capi::WindowsParser* ptr); 66 inline static void operator delete(void* ptr); 67 private: 68 WindowsParser() = delete; 69 WindowsParser(const icu4x::WindowsParser&) = delete; 70 WindowsParser(icu4x::WindowsParser&&) noexcept = delete; 71 WindowsParser operator=(const icu4x::WindowsParser&) = delete; 72 WindowsParser operator=(icu4x::WindowsParser&&) noexcept = delete; 73 static void operator delete[](void*, size_t) = delete; 74 }; 75 76 } // namespace 77 #endif // icu4x_WindowsParser_D_HPP