1 #ifndef icu4x_LineBreakStrictness_D_HPP 2 #define icu4x_LineBreakStrictness_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 LineBreakStrictness { 17 LineBreakStrictness_Loose = 0, 18 LineBreakStrictness_Normal = 1, 19 LineBreakStrictness_Strict = 2, 20 LineBreakStrictness_Anywhere = 3, 21 }; 22 23 typedef struct LineBreakStrictness_option {union { LineBreakStrictness ok; }; bool is_ok; } LineBreakStrictness_option; 24 } // namespace capi 25 } // namespace 26 27 namespace icu4x { 28 class LineBreakStrictness { 29 public: 30 enum Value { 31 Loose = 0, 32 Normal = 1, 33 Strict = 2, 34 Anywhere = 3, 35 }; 36 37 LineBreakStrictness() = default; 38 // Implicit conversions between enum and ::Value LineBreakStrictness(Value v)39 constexpr LineBreakStrictness(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::LineBreakStrictness AsFFI() const; 45 inline static icu4x::LineBreakStrictness FromFFI(icu4x::capi::LineBreakStrictness c_enum); 46 private: 47 Value value; 48 }; 49 50 } // namespace 51 #endif // icu4x_LineBreakStrictness_D_HPP 52