• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef icu4x_DisplayNamesFallback_D_HPP
2 #define icu4x_DisplayNamesFallback_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 "../diplomat_runtime.hpp"
12 
13 
14 namespace icu4x {
15 namespace capi {
16     enum DisplayNamesFallback {
17       DisplayNamesFallback_Code = 0,
18       DisplayNamesFallback_None = 1,
19     };
20 
21     typedef struct DisplayNamesFallback_option {union { DisplayNamesFallback ok; }; bool is_ok; } DisplayNamesFallback_option;
22 } // namespace capi
23 } // namespace
24 
25 namespace icu4x {
26 class DisplayNamesFallback {
27 public:
28   enum Value {
29     Code = 0,
30     None = 1,
31   };
32 
33   DisplayNamesFallback() = default;
34   // Implicit conversions between enum and ::Value
DisplayNamesFallback(Value v)35   constexpr DisplayNamesFallback(Value v) : value(v) {}
operator Value() const36   constexpr operator Value() const { return value; }
37   // Prevent usage as boolean value
38   explicit operator bool() const = delete;
39 
40   inline icu4x::capi::DisplayNamesFallback AsFFI() const;
41   inline static icu4x::DisplayNamesFallback FromFFI(icu4x::capi::DisplayNamesFallback c_enum);
42 private:
43     Value value;
44 };
45 
46 } // namespace
47 #endif // icu4x_DisplayNamesFallback_D_HPP
48