• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef icu4x_CollatorMaxVariable_D_HPP
2 #define icu4x_CollatorMaxVariable_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 CollatorMaxVariable {
17       CollatorMaxVariable_Space = 0,
18       CollatorMaxVariable_Punctuation = 1,
19       CollatorMaxVariable_Symbol = 2,
20       CollatorMaxVariable_Currency = 3,
21     };
22 
23     typedef struct CollatorMaxVariable_option {union { CollatorMaxVariable ok; }; bool is_ok; } CollatorMaxVariable_option;
24 } // namespace capi
25 } // namespace
26 
27 namespace icu4x {
28 class CollatorMaxVariable {
29 public:
30   enum Value {
31     Space = 0,
32     Punctuation = 1,
33     Symbol = 2,
34     Currency = 3,
35   };
36 
37   CollatorMaxVariable() = default;
38   // Implicit conversions between enum and ::Value
CollatorMaxVariable(Value v)39   constexpr CollatorMaxVariable(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::CollatorMaxVariable AsFFI() const;
45   inline static icu4x::CollatorMaxVariable FromFFI(icu4x::capi::CollatorMaxVariable c_enum);
46 private:
47     Value value;
48 };
49 
50 } // namespace
51 #endif // icu4x_CollatorMaxVariable_D_HPP
52