ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
SentenceBreak.d.hpp
Go to the documentation of this file.
1#ifndef icu4x_SentenceBreak_D_HPP
2#define icu4x_SentenceBreak_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>
13
14namespace icu4x {
15class SentenceBreak;
16}
17
18
19namespace icu4x {
20namespace capi {
21 enum SentenceBreak {
22 SentenceBreak_Other = 0,
23 SentenceBreak_ATerm = 1,
24 SentenceBreak_Close = 2,
25 SentenceBreak_Format = 3,
26 SentenceBreak_Lower = 4,
27 SentenceBreak_Numeric = 5,
28 SentenceBreak_OLetter = 6,
29 SentenceBreak_Sep = 7,
30 SentenceBreak_Sp = 8,
31 SentenceBreak_STerm = 9,
32 SentenceBreak_Upper = 10,
33 SentenceBreak_CR = 11,
34 SentenceBreak_Extend = 12,
35 SentenceBreak_LF = 13,
36 SentenceBreak_SContinue = 14,
37 };
38
39 typedef struct SentenceBreak_option {union { SentenceBreak ok; }; bool is_ok; } SentenceBreak_option;
40} // namespace capi
41} // namespace
42
43namespace icu4x {
48public:
49 enum Value {
50 Other = 0,
51 ATerm = 1,
52 Close = 2,
53 Format = 3,
54 Lower = 4,
57 Sep = 7,
58 Sp = 8,
59 STerm = 9,
60 Upper = 10,
61 CR = 11,
62 Extend = 12,
63 LF = 13,
65 };
66
67 SentenceBreak() = default;
68 // Implicit conversions between enum and ::Value
69 constexpr SentenceBreak(Value v) : value(v) {}
70 constexpr operator Value() const { return value; }
71 // Prevent usage as boolean value
72 explicit operator bool() const = delete;
73
77 inline static icu4x::SentenceBreak for_char(char32_t ch);
78
84 inline std::optional<std::string_view> long_name() const;
85
91 inline std::optional<std::string_view> short_name() const;
92
98 inline uint8_t to_integer_value() const;
99
105 inline static std::optional<icu4x::SentenceBreak> from_integer_value(uint8_t other);
106
107 inline icu4x::capi::SentenceBreak AsFFI() const;
108 inline static icu4x::SentenceBreak FromFFI(icu4x::capi::SentenceBreak c_enum);
109private:
110 Value value;
111};
112
113} // namespace
114#endif // icu4x_SentenceBreak_D_HPP
Definition SentenceBreak.d.hpp:47
std::optional< std::string_view > short_name() const
Definition SentenceBreak.hpp:75
std::optional< std::string_view > long_name() const
Definition SentenceBreak.hpp:70
static icu4x::SentenceBreak for_char(char32_t ch)
Definition SentenceBreak.hpp:65
uint8_t to_integer_value() const
Definition SentenceBreak.hpp:80
static std::optional< icu4x::SentenceBreak > from_integer_value(uint8_t other)
Definition SentenceBreak.hpp:85
constexpr SentenceBreak(Value v)
Definition SentenceBreak.d.hpp:69
Value
Definition SentenceBreak.d.hpp:49
@ Sp
Definition SentenceBreak.d.hpp:58
@ Upper
Definition SentenceBreak.d.hpp:60
@ Other
Definition SentenceBreak.d.hpp:50
@ Format
Definition SentenceBreak.d.hpp:53
@ Numeric
Definition SentenceBreak.d.hpp:55
@ CR
Definition SentenceBreak.d.hpp:61
@ OLetter
Definition SentenceBreak.d.hpp:56
@ Lower
Definition SentenceBreak.d.hpp:54
@ Close
Definition SentenceBreak.d.hpp:52
@ Sep
Definition SentenceBreak.d.hpp:57
@ Extend
Definition SentenceBreak.d.hpp:62
@ STerm
Definition SentenceBreak.d.hpp:59
@ LF
Definition SentenceBreak.d.hpp:63
@ SContinue
Definition SentenceBreak.d.hpp:64
@ ATerm
Definition SentenceBreak.d.hpp:51
Definition Bidi.d.hpp:14