DisplayNamesFallback.d.hpp (1374B)
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 <cstdlib> 12 #include "../diplomat_runtime.hpp" 13 14 15 namespace icu4x { 16 namespace capi { 17 enum DisplayNamesFallback { 18 DisplayNamesFallback_Code = 0, 19 DisplayNamesFallback_None = 1, 20 }; 21 22 typedef struct DisplayNamesFallback_option {union { DisplayNamesFallback ok; }; bool is_ok; } DisplayNamesFallback_option; 23 } // namespace capi 24 } // namespace 25 26 namespace icu4x { 27 /** 28 * See the [Rust documentation for `Fallback`](https://docs.rs/icu/latest/icu/experimental/displaynames/options/enum.Fallback.html) for more information. 29 */ 30 class DisplayNamesFallback { 31 public: 32 enum Value { 33 Code = 0, 34 None = 1, 35 }; 36 37 DisplayNamesFallback() = default; 38 // Implicit conversions between enum and ::Value 39 constexpr DisplayNamesFallback(Value v) : value(v) {} 40 constexpr operator Value() const { return value; } 41 // Prevent usage as boolean value 42 explicit operator bool() const = delete; 43 44 inline icu4x::capi::DisplayNamesFallback AsFFI() const; 45 inline static icu4x::DisplayNamesFallback FromFFI(icu4x::capi::DisplayNamesFallback c_enum); 46 private: 47 Value value; 48 }; 49 50 } // namespace 51 #endif // icu4x_DisplayNamesFallback_D_HPP