ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
JoiningType.d.hpp
Go to the documentation of this file.
1#ifndef ICU4X_JoiningType_D_HPP
2#define ICU4X_JoiningType_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"
13namespace icu4x {
14class JoiningType;
15} // namespace icu4x
16
17
18
19namespace icu4x {
20namespace capi {
21 enum JoiningType {
22 JoiningType_NonJoining = 0,
23 JoiningType_JoinCausing = 1,
24 JoiningType_DualJoining = 2,
25 JoiningType_LeftJoining = 3,
26 JoiningType_RightJoining = 4,
27 JoiningType_Transparent = 5,
28 };
29
30 typedef struct JoiningType_option {union { JoiningType ok; }; bool is_ok; } JoiningType_option;
31} // namespace capi
32} // namespace
33
34namespace icu4x {
39public:
66
68
69 // Implicit conversions between enum and ::Value
70 constexpr JoiningType(Value v) : value(v) {}
71 constexpr operator Value() const { return value; }
72 // Prevent usage as boolean value
73 explicit operator bool() const = delete;
74
78 inline static icu4x::JoiningType for_char(char32_t ch);
79
85 inline std::optional<std::string_view> long_name() const;
86
92 inline std::optional<std::string_view> short_name() const;
93
99 inline uint8_t to_integer_value() const;
100
106 inline static std::optional<icu4x::JoiningType> from_integer_value(uint8_t other);
107
108 inline static std::optional<icu4x::JoiningType> try_from_str(std::string_view s);
109
110 inline icu4x::capi::JoiningType AsFFI() const;
111 inline static icu4x::JoiningType FromFFI(icu4x::capi::JoiningType c_enum);
112private:
113 Value value;
114};
115
116} // namespace
117#endif // ICU4X_JoiningType_D_HPP
Definition JoiningType.d.hpp:38
static std::optional< icu4x::JoiningType > try_from_str(std::string_view s)
Definition JoiningType.hpp:84
std::optional< std::string_view > long_name() const
Definition JoiningType.hpp:64
Value
Definition JoiningType.d.hpp:40
@ JoinCausing
Definition JoiningType.d.hpp:48
@ LeftJoining
Definition JoiningType.d.hpp:56
@ DualJoining
Definition JoiningType.d.hpp:52
@ NonJoining
Definition JoiningType.d.hpp:44
@ Transparent
Definition JoiningType.d.hpp:64
@ RightJoining
Definition JoiningType.d.hpp:60
static icu4x::JoiningType for_char(char32_t ch)
Definition JoiningType.hpp:59
uint8_t to_integer_value() const
Definition JoiningType.hpp:74
static std::optional< icu4x::JoiningType > from_integer_value(uint8_t other)
Definition JoiningType.hpp:79
constexpr JoiningType(Value v)
Definition JoiningType.d.hpp:70
std::optional< std::string_view > short_name() const
Definition JoiningType.hpp:69
JoiningType()
Definition JoiningType.d.hpp:67
Definition Bidi.d.hpp:13