• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef icu4x_CollatorAlternateHandling_D_HPP
2 #define icu4x_CollatorAlternateHandling_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 CollatorAlternateHandling {
17       CollatorAlternateHandling_NonIgnorable = 0,
18       CollatorAlternateHandling_Shifted = 1,
19     };
20 
21     typedef struct CollatorAlternateHandling_option {union { CollatorAlternateHandling ok; }; bool is_ok; } CollatorAlternateHandling_option;
22 } // namespace capi
23 } // namespace
24 
25 namespace icu4x {
26 class CollatorAlternateHandling {
27 public:
28   enum Value {
29     NonIgnorable = 0,
30     Shifted = 1,
31   };
32 
33   CollatorAlternateHandling() = default;
34   // Implicit conversions between enum and ::Value
CollatorAlternateHandling(Value v)35   constexpr CollatorAlternateHandling(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::CollatorAlternateHandling AsFFI() const;
41   inline static icu4x::CollatorAlternateHandling FromFFI(icu4x::capi::CollatorAlternateHandling c_enum);
42 private:
43     Value value;
44 };
45 
46 } // namespace
47 #endif // icu4x_CollatorAlternateHandling_D_HPP
48