tor-browser

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

CalendarError.d.hpp (1418B)


      1 #ifndef icu4x_CalendarError_D_HPP
      2 #define icu4x_CalendarError_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 
     15 namespace icu4x {
     16 namespace capi {
     17    enum CalendarError {
     18      CalendarError_Unknown = 0,
     19      CalendarError_OutOfRange = 1,
     20      CalendarError_UnknownEra = 2,
     21      CalendarError_UnknownMonthCode = 3,
     22    };
     23 
     24    typedef struct CalendarError_option {union { CalendarError ok; }; bool is_ok; } CalendarError_option;
     25 } // namespace capi
     26 } // namespace
     27 
     28 namespace icu4x {
     29 /**
     30 * Additional information: [1](https://docs.rs/icu/latest/icu/calendar/struct.RangeError.html), [2](https://docs.rs/icu/latest/icu/calendar/enum.DateError.html)
     31 */
     32 class CalendarError {
     33 public:
     34  enum Value {
     35    Unknown = 0,
     36    OutOfRange = 1,
     37    UnknownEra = 2,
     38    UnknownMonthCode = 3,
     39  };
     40 
     41  CalendarError() = default;
     42  // Implicit conversions between enum and ::Value
     43  constexpr CalendarError(Value v) : value(v) {}
     44  constexpr operator Value() const { return value; }
     45  // Prevent usage as boolean value
     46  explicit operator bool() const = delete;
     47 
     48  inline icu4x::capi::CalendarError AsFFI() const;
     49  inline static icu4x::CalendarError FromFFI(icu4x::capi::CalendarError c_enum);
     50 private:
     51    Value value;
     52 };
     53 
     54 } // namespace
     55 #endif // icu4x_CalendarError_D_HPP