ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
GraphemeClusterBreak.d.hpp
Go to the documentation of this file.
1#ifndef ICU4X_GraphemeClusterBreak_D_HPP
2#define ICU4X_GraphemeClusterBreak_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 {
15} // namespace icu4x
16
17
18
19namespace icu4x {
20namespace capi {
21 enum GraphemeClusterBreak {
22 GraphemeClusterBreak_Other = 0,
23 GraphemeClusterBreak_Control = 1,
24 GraphemeClusterBreak_CR = 2,
25 GraphemeClusterBreak_Extend = 3,
26 GraphemeClusterBreak_L = 4,
27 GraphemeClusterBreak_LF = 5,
28 GraphemeClusterBreak_LV = 6,
29 GraphemeClusterBreak_LVT = 7,
30 GraphemeClusterBreak_T = 8,
31 GraphemeClusterBreak_V = 9,
32 GraphemeClusterBreak_SpacingMark = 10,
33 GraphemeClusterBreak_Prepend = 11,
34 GraphemeClusterBreak_RegionalIndicator = 12,
35 GraphemeClusterBreak_EBase = 13,
36 GraphemeClusterBreak_EBaseGAZ = 14,
37 GraphemeClusterBreak_EModifier = 15,
38 GraphemeClusterBreak_GlueAfterZwj = 16,
39 GraphemeClusterBreak_ZWJ = 17,
40 };
41
42 typedef struct GraphemeClusterBreak_option {union { GraphemeClusterBreak ok; }; bool is_ok; } GraphemeClusterBreak_option;
43} // namespace capi
44} // namespace
45
46namespace icu4x {
51public:
52 enum Value {
56 Other = 0,
64 CR = 2,
68 Extend = 3,
72 L = 4,
76 LF = 5,
80 LV = 6,
84 LVT = 7,
88 T = 8,
92 V = 9,
108 EBase = 13,
124 ZWJ = 17,
125 };
126
128
129 // Implicit conversions between enum and ::Value
130 constexpr GraphemeClusterBreak(Value v) : value(v) {}
131 constexpr operator Value() const { return value; }
132 // Prevent usage as boolean value
133 explicit operator bool() const = delete;
134
138 inline static icu4x::GraphemeClusterBreak for_char(char32_t ch);
139
145 inline std::optional<std::string_view> long_name() const;
146
152 inline std::optional<std::string_view> short_name() const;
153
159 inline uint8_t to_integer_value() const;
160
166 inline static std::optional<icu4x::GraphemeClusterBreak> from_integer_value(uint8_t other);
167
168 inline static std::optional<icu4x::GraphemeClusterBreak> try_from_str(std::string_view s);
169
170 inline icu4x::capi::GraphemeClusterBreak AsFFI() const;
171 inline static icu4x::GraphemeClusterBreak FromFFI(icu4x::capi::GraphemeClusterBreak c_enum);
172private:
173 Value value;
174};
175
176} // namespace
177#endif // ICU4X_GraphemeClusterBreak_D_HPP
Definition GraphemeClusterBreak.d.hpp:50
std::optional< std::string_view > long_name() const
Definition GraphemeClusterBreak.hpp:76
static icu4x::GraphemeClusterBreak for_char(char32_t ch)
Definition GraphemeClusterBreak.hpp:71
uint8_t to_integer_value() const
Definition GraphemeClusterBreak.hpp:86
std::optional< std::string_view > short_name() const
Definition GraphemeClusterBreak.hpp:81
Value
Definition GraphemeClusterBreak.d.hpp:52
@ CR
Definition GraphemeClusterBreak.d.hpp:64
@ LV
Definition GraphemeClusterBreak.d.hpp:80
@ LVT
Definition GraphemeClusterBreak.d.hpp:84
@ ZWJ
Definition GraphemeClusterBreak.d.hpp:124
@ Control
Definition GraphemeClusterBreak.d.hpp:60
@ Other
Definition GraphemeClusterBreak.d.hpp:56
@ EModifier
Definition GraphemeClusterBreak.d.hpp:116
@ V
Definition GraphemeClusterBreak.d.hpp:92
@ EBase
Definition GraphemeClusterBreak.d.hpp:108
@ EBaseGAZ
Definition GraphemeClusterBreak.d.hpp:112
@ T
Definition GraphemeClusterBreak.d.hpp:88
@ RegionalIndicator
Definition GraphemeClusterBreak.d.hpp:104
@ SpacingMark
Definition GraphemeClusterBreak.d.hpp:96
@ LF
Definition GraphemeClusterBreak.d.hpp:76
@ Extend
Definition GraphemeClusterBreak.d.hpp:68
@ Prepend
Definition GraphemeClusterBreak.d.hpp:100
@ L
Definition GraphemeClusterBreak.d.hpp:72
@ GlueAfterZwj
Definition GraphemeClusterBreak.d.hpp:120
constexpr GraphemeClusterBreak(Value v)
Definition GraphemeClusterBreak.d.hpp:130
GraphemeClusterBreak()
Definition GraphemeClusterBreak.d.hpp:127
static std::optional< icu4x::GraphemeClusterBreak > from_integer_value(uint8_t other)
Definition GraphemeClusterBreak.hpp:91
static std::optional< icu4x::GraphemeClusterBreak > try_from_str(std::string_view s)
Definition GraphemeClusterBreak.hpp:96
Definition Bidi.d.hpp:13