• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef icu4x_DisplayNamesStyle_D_HPP
2 #define icu4x_DisplayNamesStyle_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 DisplayNamesStyle {
17       DisplayNamesStyle_Narrow = 0,
18       DisplayNamesStyle_Short = 1,
19       DisplayNamesStyle_Long = 2,
20       DisplayNamesStyle_Menu = 3,
21     };
22 
23     typedef struct DisplayNamesStyle_option {union { DisplayNamesStyle ok; }; bool is_ok; } DisplayNamesStyle_option;
24 } // namespace capi
25 } // namespace
26 
27 namespace icu4x {
28 class DisplayNamesStyle {
29 public:
30   enum Value {
31     Narrow = 0,
32     Short = 1,
33     Long = 2,
34     Menu = 3,
35   };
36 
37   DisplayNamesStyle() = default;
38   // Implicit conversions between enum and ::Value
DisplayNamesStyle(Value v)39   constexpr DisplayNamesStyle(Value v) : value(v) {}
operator Value() const40   constexpr operator Value() const { return value; }
41   // Prevent usage as boolean value
42   explicit operator bool() const = delete;
43 
44   inline icu4x::capi::DisplayNamesStyle AsFFI() const;
45   inline static icu4x::DisplayNamesStyle FromFFI(icu4x::capi::DisplayNamesStyle c_enum);
46 private:
47     Value value;
48 };
49 
50 } // namespace
51 #endif // icu4x_DisplayNamesStyle_D_HPP
52