• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef icu4x_FixedDecimalSign_D_HPP
2 #define icu4x_FixedDecimalSign_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 FixedDecimalSign {
17       FixedDecimalSign_None = 0,
18       FixedDecimalSign_Negative = 1,
19       FixedDecimalSign_Positive = 2,
20     };
21 
22     typedef struct FixedDecimalSign_option {union { FixedDecimalSign ok; }; bool is_ok; } FixedDecimalSign_option;
23 } // namespace capi
24 } // namespace
25 
26 namespace icu4x {
27 class FixedDecimalSign {
28 public:
29   enum Value {
30     None = 0,
31     Negative = 1,
32     Positive = 2,
33   };
34 
35   FixedDecimalSign() = default;
36   // Implicit conversions between enum and ::Value
FixedDecimalSign(Value v)37   constexpr FixedDecimalSign(Value v) : value(v) {}
operator Value() const38   constexpr operator Value() const { return value; }
39   // Prevent usage as boolean value
40   explicit operator bool() const = delete;
41 
42   inline icu4x::capi::FixedDecimalSign AsFFI() const;
43   inline static icu4x::FixedDecimalSign FromFFI(icu4x::capi::FixedDecimalSign c_enum);
44 private:
45     Value value;
46 };
47 
48 } // namespace
49 #endif // icu4x_FixedDecimalSign_D_HPP
50