1 #ifndef icu4x_LanguageDisplay_D_HPP 2 #define icu4x_LanguageDisplay_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 LanguageDisplay { 17 LanguageDisplay_Dialect = 0, 18 LanguageDisplay_Standard = 1, 19 }; 20 21 typedef struct LanguageDisplay_option {union { LanguageDisplay ok; }; bool is_ok; } LanguageDisplay_option; 22 } // namespace capi 23 } // namespace 24 25 namespace icu4x { 26 class LanguageDisplay { 27 public: 28 enum Value { 29 Dialect = 0, 30 Standard = 1, 31 }; 32 33 LanguageDisplay() = default; 34 // Implicit conversions between enum and ::Value LanguageDisplay(Value v)35 constexpr LanguageDisplay(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::LanguageDisplay AsFFI() const; 41 inline static icu4x::LanguageDisplay FromFFI(icu4x::capi::LanguageDisplay c_enum); 42 private: 43 Value value; 44 }; 45 46 } // namespace 47 #endif // icu4x_LanguageDisplay_D_HPP 48