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