tor-browser

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

Rfc9557ParseError.d.hpp (1551B)


      1 #ifndef icu4x_Rfc9557ParseError_D_HPP
      2 #define icu4x_Rfc9557ParseError_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 Rfc9557ParseError {
     18      Rfc9557ParseError_Unknown = 0,
     19      Rfc9557ParseError_InvalidSyntax = 1,
     20      Rfc9557ParseError_OutOfRange = 2,
     21      Rfc9557ParseError_MissingFields = 3,
     22      Rfc9557ParseError_UnknownCalendar = 4,
     23    };
     24 
     25    typedef struct Rfc9557ParseError_option {union { Rfc9557ParseError ok; }; bool is_ok; } Rfc9557ParseError_option;
     26 } // namespace capi
     27 } // namespace
     28 
     29 namespace icu4x {
     30 /**
     31 * Additional information: [1](https://docs.rs/icu/latest/icu/calendar/enum.ParseError.html), [2](https://docs.rs/icu/latest/icu/time/enum.ParseError.html)
     32 */
     33 class Rfc9557ParseError {
     34 public:
     35  enum Value {
     36    Unknown = 0,
     37    InvalidSyntax = 1,
     38    OutOfRange = 2,
     39    MissingFields = 3,
     40    UnknownCalendar = 4,
     41  };
     42 
     43  Rfc9557ParseError() = default;
     44  // Implicit conversions between enum and ::Value
     45  constexpr Rfc9557ParseError(Value v) : value(v) {}
     46  constexpr operator Value() const { return value; }
     47  // Prevent usage as boolean value
     48  explicit operator bool() const = delete;
     49 
     50  inline icu4x::capi::Rfc9557ParseError AsFFI() const;
     51  inline static icu4x::Rfc9557ParseError FromFFI(icu4x::capi::Rfc9557ParseError c_enum);
     52 private:
     53    Value value;
     54 };
     55 
     56 } // namespace
     57 #endif // icu4x_Rfc9557ParseError_D_HPP