ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
CollatorOptionsV1.hpp
Go to the documentation of this file.
1#ifndef icu4x_CollatorOptionsV1_HPP
2#define icu4x_CollatorOptionsV1_HPP
3
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 <cstdlib>
16#include "CollatorCaseLevel.hpp"
18#include "CollatorStrength.hpp"
19
20
21namespace icu4x {
22namespace capi {
23 extern "C" {
24
25 } // extern "C"
26} // namespace capi
27} // namespace
28
29
30inline icu4x::capi::CollatorOptionsV1 icu4x::CollatorOptionsV1::AsFFI() const {
31 return icu4x::capi::CollatorOptionsV1 {
32 /* .strength = */ strength.has_value() ? (icu4x::capi::CollatorStrength_option{ { strength.value().AsFFI() }, true }) : (icu4x::capi::CollatorStrength_option{ {}, false }),
33 /* .alternate_handling = */ alternate_handling.has_value() ? (icu4x::capi::CollatorAlternateHandling_option{ { alternate_handling.value().AsFFI() }, true }) : (icu4x::capi::CollatorAlternateHandling_option{ {}, false }),
34 /* .max_variable = */ max_variable.has_value() ? (icu4x::capi::CollatorMaxVariable_option{ { max_variable.value().AsFFI() }, true }) : (icu4x::capi::CollatorMaxVariable_option{ {}, false }),
35 /* .case_level = */ case_level.has_value() ? (icu4x::capi::CollatorCaseLevel_option{ { case_level.value().AsFFI() }, true }) : (icu4x::capi::CollatorCaseLevel_option{ {}, false }),
36 };
37}
38
39inline icu4x::CollatorOptionsV1 icu4x::CollatorOptionsV1::FromFFI(icu4x::capi::CollatorOptionsV1 c_struct) {
40 return icu4x::CollatorOptionsV1 {
41 /* .strength = */ c_struct.strength.is_ok ? std::optional(icu4x::CollatorStrength::FromFFI(c_struct.strength.ok)) : std::nullopt,
42 /* .alternate_handling = */ c_struct.alternate_handling.is_ok ? std::optional(icu4x::CollatorAlternateHandling::FromFFI(c_struct.alternate_handling.ok)) : std::nullopt,
43 /* .max_variable = */ c_struct.max_variable.is_ok ? std::optional(icu4x::CollatorMaxVariable::FromFFI(c_struct.max_variable.ok)) : std::nullopt,
44 /* .case_level = */ c_struct.case_level.is_ok ? std::optional(icu4x::CollatorCaseLevel::FromFFI(c_struct.case_level.ok)) : std::nullopt,
45 };
46}
47
48
49#endif // icu4x_CollatorOptionsV1_HPP
Definition CollatorAlternateHandling.d.hpp:30
Definition CollatorCaseLevel.d.hpp:30
Definition CollatorMaxVariable.d.hpp:32
Definition Bidi.d.hpp:14
std::optional< icu4x::CollatorStrength > strength
Definition CollatorOptionsV1.d.hpp:45
std::optional< icu4x::CollatorAlternateHandling > alternate_handling
Definition CollatorOptionsV1.d.hpp:46