1 #ifndef icu4x_DateTimeMismatchedCalendarError_HPP 2 #define icu4x_DateTimeMismatchedCalendarError_HPP 3 4 #include "DateTimeMismatchedCalendarError.d.hpp" 5 6 #include <stdio.h> 7 #include <stdint.h> 8 #include <stddef.h> 9 #include <stdbool.h> 10 #include <memory> 11 #include <functional> 12 #include <optional> 13 #include "../diplomat_runtime.hpp" 14 #include "AnyCalendarKind.hpp" 15 16 17 namespace icu4x { 18 namespace capi { 19 extern "C" { 20 21 22 } // extern "C" 23 } // namespace capi 24 } // namespace 25 26 AsFFI() const27inline icu4x::capi::DateTimeMismatchedCalendarError icu4x::DateTimeMismatchedCalendarError::AsFFI() const { 28 return icu4x::capi::DateTimeMismatchedCalendarError { 29 /* .this_kind = */ this_kind.AsFFI(), 30 /* .date_kind = */ date_kind.has_value() ? (icu4x::capi::AnyCalendarKind_option{ { date_kind.value().AsFFI() }, true }) : (icu4x::capi::AnyCalendarKind_option{ {}, false }), 31 }; 32 } 33 FromFFI(icu4x::capi::DateTimeMismatchedCalendarError c_struct)34inline icu4x::DateTimeMismatchedCalendarError icu4x::DateTimeMismatchedCalendarError::FromFFI(icu4x::capi::DateTimeMismatchedCalendarError c_struct) { 35 return icu4x::DateTimeMismatchedCalendarError { 36 /* .this_kind = */ icu4x::AnyCalendarKind::FromFFI(c_struct.this_kind), 37 /* .date_kind = */ c_struct.date_kind.is_ok ? std::optional(icu4x::AnyCalendarKind::FromFFI(c_struct.date_kind.ok)) : std::nullopt, 38 }; 39 } 40 41 42 #endif // icu4x_DateTimeMismatchedCalendarError_HPP 43