1 #ifndef icu4x_TransformResult_D_HPP 2 #define icu4x_TransformResult_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 TransformResult { 17 TransformResult_Modified = 0, 18 TransformResult_Unmodified = 1, 19 }; 20 21 typedef struct TransformResult_option {union { TransformResult ok; }; bool is_ok; } TransformResult_option; 22 } // namespace capi 23 } // namespace 24 25 namespace icu4x { 26 class TransformResult { 27 public: 28 enum Value { 29 Modified = 0, 30 Unmodified = 1, 31 }; 32 33 TransformResult() = default; 34 // Implicit conversions between enum and ::Value TransformResult(Value v)35 constexpr TransformResult(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::TransformResult AsFFI() const; 41 inline static icu4x::TransformResult FromFFI(icu4x::capi::TransformResult c_enum); 42 private: 43 Value value; 44 }; 45 46 } // namespace 47 #endif // icu4x_TransformResult_D_HPP 48