tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TimeZoneVariant.d.hpp (1784B)


      1 #ifndef icu4x_TimeZoneVariant_D_HPP
      2 #define icu4x_TimeZoneVariant_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 class TimeZoneVariant;
     16 }
     17 
     18 
     19 namespace icu4x {
     20 namespace capi {
     21    enum TimeZoneVariant {
     22      TimeZoneVariant_Standard = 0,
     23      TimeZoneVariant_Daylight = 1,
     24    };
     25 
     26    typedef struct TimeZoneVariant_option {union { TimeZoneVariant ok; }; bool is_ok; } TimeZoneVariant_option;
     27 } // namespace capi
     28 } // namespace
     29 
     30 namespace icu4x {
     31 class TimeZoneVariant {
     32 public:
     33  enum Value {
     34    Standard = 0,
     35    Daylight = 1,
     36  };
     37 
     38  TimeZoneVariant() = default;
     39  // Implicit conversions between enum and ::Value
     40  constexpr TimeZoneVariant(Value v) : value(v) {}
     41  constexpr operator Value() const { return value; }
     42  // Prevent usage as boolean value
     43  explicit operator bool() const = delete;
     44 
     45  /**
     46   * Sets the `variant` field to "daylight" time.
     47   *
     48   * See the [Rust documentation for `from_rearguard_isdst`](https://docs.rs/icu/latest/icu/time/zone/enum.TimeZoneVariant.html#method.from_rearguard_isdst) for more information.
     49   *
     50   * See the [Rust documentation for `with_variant`](https://docs.rs/icu/latest/icu/time/struct.TimeZoneInfo.html#method.with_variant) for more information.
     51   *
     52   * Additional information: [1](https://docs.rs/icu/latest/icu/time/zone/enum.TimeZoneVariant.html)
     53   */
     54  inline icu4x::TimeZoneVariant from_rearguard_isdst(bool isdst) const;
     55 
     56  inline icu4x::capi::TimeZoneVariant AsFFI() const;
     57  inline static icu4x::TimeZoneVariant FromFFI(icu4x::capi::TimeZoneVariant c_enum);
     58 private:
     59    Value value;
     60 };
     61 
     62 } // namespace
     63 #endif // icu4x_TimeZoneVariant_D_HPP