CollatorStrength.d.hpp (1484B)
1 #ifndef icu4x_CollatorStrength_D_HPP 2 #define icu4x_CollatorStrength_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 CollatorStrength { 18 CollatorStrength_Primary = 0, 19 CollatorStrength_Secondary = 1, 20 CollatorStrength_Tertiary = 2, 21 CollatorStrength_Quaternary = 3, 22 CollatorStrength_Identical = 4, 23 }; 24 25 typedef struct CollatorStrength_option {union { CollatorStrength ok; }; bool is_ok; } CollatorStrength_option; 26 } // namespace capi 27 } // namespace 28 29 namespace icu4x { 30 /** 31 * See the [Rust documentation for `Strength`](https://docs.rs/icu/latest/icu/collator/options/enum.Strength.html) for more information. 32 */ 33 class CollatorStrength { 34 public: 35 enum Value { 36 Primary = 0, 37 Secondary = 1, 38 Tertiary = 2, 39 Quaternary = 3, 40 Identical = 4, 41 }; 42 43 CollatorStrength() = default; 44 // Implicit conversions between enum and ::Value 45 constexpr CollatorStrength(Value v) : value(v) {} 46 constexpr operator Value() const { return value; } 47 // Prevent usage as boolean value 48 explicit operator bool() const = delete; 49 50 inline icu4x::capi::CollatorStrength AsFFI() const; 51 inline static icu4x::CollatorStrength FromFFI(icu4x::capi::CollatorStrength c_enum); 52 private: 53 Value value; 54 }; 55 56 } // namespace 57 #endif // icu4x_CollatorStrength_D_HPP