From 147d5df4cea136d7d173c9751a982f0ae19866d1 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 18 Nov 2024 19:45:17 -0800 Subject: [PATCH] Add prop enums to FFI --- components/properties/src/props.rs | 6 + ffi/capi/bindings/c/BidiClass.d.h | 44 + ffi/capi/bindings/c/BidiClass.h | 28 + .../bindings/c/CanonicalCombiningClass.d.h | 79 + ffi/capi/bindings/c/CanonicalCombiningClass.h | 28 + ffi/capi/bindings/c/EastAsianWidth.d.h | 27 + ffi/capi/bindings/c/EastAsianWidth.h | 28 + ffi/capi/bindings/c/GraphemeClusterBreak.d.h | 39 + ffi/capi/bindings/c/GraphemeClusterBreak.h | 28 + ffi/capi/bindings/c/HangulSyllableType.d.h | 27 + ffi/capi/bindings/c/HangulSyllableType.h | 28 + ffi/capi/bindings/c/IndicSyllabicCategory.d.h | 58 + ffi/capi/bindings/c/IndicSyllabicCategory.h | 28 + ffi/capi/bindings/c/JoiningType.d.h | 27 + ffi/capi/bindings/c/JoiningType.h | 28 + ffi/capi/bindings/c/LineBreak.d.h | 69 + ffi/capi/bindings/c/LineBreak.h | 28 + ffi/capi/bindings/c/Script.d.h | 186 ++ ffi/capi/bindings/c/Script.h | 28 + ffi/capi/bindings/c/SentenceBreak.d.h | 36 + ffi/capi/bindings/c/SentenceBreak.h | 28 + ffi/capi/bindings/c/WordBreak.d.h | 44 + ffi/capi/bindings/c/WordBreak.h | 28 + ffi/capi/bindings/cpp/icu4x/BidiClass.d.hpp | 96 + ffi/capi/bindings/cpp/icu4x/BidiClass.hpp | 73 + .../cpp/icu4x/CanonicalCombiningClass.d.hpp | 166 ++ .../cpp/icu4x/CanonicalCombiningClass.hpp | 108 ++ .../bindings/cpp/icu4x/EastAsianWidth.d.hpp | 62 + .../bindings/cpp/icu4x/EastAsianWidth.hpp | 56 + .../cpp/icu4x/GraphemeClusterBreak.d.hpp | 86 + .../cpp/icu4x/GraphemeClusterBreak.hpp | 68 + .../cpp/icu4x/HangulSyllableType.d.hpp | 62 + .../bindings/cpp/icu4x/HangulSyllableType.hpp | 56 + .../cpp/icu4x/IndicSyllabicCategory.d.hpp | 124 ++ .../cpp/icu4x/IndicSyllabicCategory.hpp | 87 + ffi/capi/bindings/cpp/icu4x/JoiningType.d.hpp | 62 + ffi/capi/bindings/cpp/icu4x/JoiningType.hpp | 56 + ffi/capi/bindings/cpp/icu4x/LineBreak.d.hpp | 146 ++ ffi/capi/bindings/cpp/icu4x/LineBreak.hpp | 98 + ffi/capi/bindings/cpp/icu4x/Script.d.hpp | 380 ++++ ffi/capi/bindings/cpp/icu4x/Script.hpp | 215 +++ .../bindings/cpp/icu4x/SentenceBreak.d.hpp | 80 + ffi/capi/bindings/cpp/icu4x/SentenceBreak.hpp | 65 + ffi/capi/bindings/cpp/icu4x/WordBreak.d.hpp | 96 + ffi/capi/bindings/cpp/icu4x/WordBreak.hpp | 73 + ffi/capi/bindings/dart/BidiClass.g.dart | 98 + .../dart/CanonicalCombiningClass.g.dart | 324 ++++ ffi/capi/bindings/dart/EastAsianWidth.g.dart | 47 + .../bindings/dart/GraphemeClusterBreak.g.dart | 83 + .../bindings/dart/HangulSyllableType.g.dart | 47 + .../dart/IndicSyllabicCategory.g.dart | 140 ++ ffi/capi/bindings/dart/JoiningType.g.dart | 47 + ffi/capi/bindings/dart/LineBreak.g.dart | 173 ++ ffi/capi/bindings/dart/Script.g.dart | 859 +++++++++ ffi/capi/bindings/dart/SentenceBreak.g.dart | 74 + ffi/capi/bindings/dart/WordBreak.g.dart | 98 + ffi/capi/bindings/dart/lib.g.dart | 11 + ffi/capi/bindings/js/BidiClass.d.ts | 41 + ffi/capi/bindings/js/BidiClass.mjs | 149 ++ .../bindings/js/CanonicalCombiningClass.d.ts | 76 + .../bindings/js/CanonicalCombiningClass.mjs | 258 +++ ffi/capi/bindings/js/EastAsianWidth.d.ts | 24 + ffi/capi/bindings/js/EastAsianWidth.mjs | 98 + .../bindings/js/GraphemeClusterBreak.d.ts | 36 + ffi/capi/bindings/js/GraphemeClusterBreak.mjs | 134 ++ ffi/capi/bindings/js/HangulSyllableType.d.ts | 24 + ffi/capi/bindings/js/HangulSyllableType.mjs | 98 + .../bindings/js/IndicSyllabicCategory.d.ts | 55 + .../bindings/js/IndicSyllabicCategory.mjs | 191 ++ ffi/capi/bindings/js/JoiningType.d.ts | 24 + ffi/capi/bindings/js/JoiningType.mjs | 98 + ffi/capi/bindings/js/LineBreak.d.ts | 66 + ffi/capi/bindings/js/LineBreak.mjs | 224 +++ ffi/capi/bindings/js/Script.d.ts | 183 ++ ffi/capi/bindings/js/Script.mjs | 579 ++++++ ffi/capi/bindings/js/SentenceBreak.d.ts | 33 + ffi/capi/bindings/js/SentenceBreak.mjs | 125 ++ ffi/capi/bindings/js/WordBreak.d.ts | 41 + ffi/capi/bindings/js/WordBreak.mjs | 149 ++ ffi/capi/bindings/js/index.d.ts | 22 + ffi/capi/bindings/js/index.mjs | 22 + ffi/capi/src/lib.rs | 2 + ffi/capi/src/properties_enums.rs | 1663 +++++++++++++++++ 83 files changed, 9681 insertions(+) create mode 100644 ffi/capi/bindings/c/BidiClass.d.h create mode 100644 ffi/capi/bindings/c/BidiClass.h create mode 100644 ffi/capi/bindings/c/CanonicalCombiningClass.d.h create mode 100644 ffi/capi/bindings/c/CanonicalCombiningClass.h create mode 100644 ffi/capi/bindings/c/EastAsianWidth.d.h create mode 100644 ffi/capi/bindings/c/EastAsianWidth.h create mode 100644 ffi/capi/bindings/c/GraphemeClusterBreak.d.h create mode 100644 ffi/capi/bindings/c/GraphemeClusterBreak.h create mode 100644 ffi/capi/bindings/c/HangulSyllableType.d.h create mode 100644 ffi/capi/bindings/c/HangulSyllableType.h create mode 100644 ffi/capi/bindings/c/IndicSyllabicCategory.d.h create mode 100644 ffi/capi/bindings/c/IndicSyllabicCategory.h create mode 100644 ffi/capi/bindings/c/JoiningType.d.h create mode 100644 ffi/capi/bindings/c/JoiningType.h create mode 100644 ffi/capi/bindings/c/LineBreak.d.h create mode 100644 ffi/capi/bindings/c/LineBreak.h create mode 100644 ffi/capi/bindings/c/Script.d.h create mode 100644 ffi/capi/bindings/c/Script.h create mode 100644 ffi/capi/bindings/c/SentenceBreak.d.h create mode 100644 ffi/capi/bindings/c/SentenceBreak.h create mode 100644 ffi/capi/bindings/c/WordBreak.d.h create mode 100644 ffi/capi/bindings/c/WordBreak.h create mode 100644 ffi/capi/bindings/cpp/icu4x/BidiClass.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/BidiClass.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/EastAsianWidth.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/EastAsianWidth.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/HangulSyllableType.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/HangulSyllableType.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/JoiningType.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/JoiningType.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/LineBreak.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/LineBreak.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/Script.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/Script.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/SentenceBreak.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/SentenceBreak.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/WordBreak.d.hpp create mode 100644 ffi/capi/bindings/cpp/icu4x/WordBreak.hpp create mode 100644 ffi/capi/bindings/dart/BidiClass.g.dart create mode 100644 ffi/capi/bindings/dart/CanonicalCombiningClass.g.dart create mode 100644 ffi/capi/bindings/dart/EastAsianWidth.g.dart create mode 100644 ffi/capi/bindings/dart/GraphemeClusterBreak.g.dart create mode 100644 ffi/capi/bindings/dart/HangulSyllableType.g.dart create mode 100644 ffi/capi/bindings/dart/IndicSyllabicCategory.g.dart create mode 100644 ffi/capi/bindings/dart/JoiningType.g.dart create mode 100644 ffi/capi/bindings/dart/LineBreak.g.dart create mode 100644 ffi/capi/bindings/dart/Script.g.dart create mode 100644 ffi/capi/bindings/dart/SentenceBreak.g.dart create mode 100644 ffi/capi/bindings/dart/WordBreak.g.dart create mode 100644 ffi/capi/bindings/js/BidiClass.d.ts create mode 100644 ffi/capi/bindings/js/BidiClass.mjs create mode 100644 ffi/capi/bindings/js/CanonicalCombiningClass.d.ts create mode 100644 ffi/capi/bindings/js/CanonicalCombiningClass.mjs create mode 100644 ffi/capi/bindings/js/EastAsianWidth.d.ts create mode 100644 ffi/capi/bindings/js/EastAsianWidth.mjs create mode 100644 ffi/capi/bindings/js/GraphemeClusterBreak.d.ts create mode 100644 ffi/capi/bindings/js/GraphemeClusterBreak.mjs create mode 100644 ffi/capi/bindings/js/HangulSyllableType.d.ts create mode 100644 ffi/capi/bindings/js/HangulSyllableType.mjs create mode 100644 ffi/capi/bindings/js/IndicSyllabicCategory.d.ts create mode 100644 ffi/capi/bindings/js/IndicSyllabicCategory.mjs create mode 100644 ffi/capi/bindings/js/JoiningType.d.ts create mode 100644 ffi/capi/bindings/js/JoiningType.mjs create mode 100644 ffi/capi/bindings/js/LineBreak.d.ts create mode 100644 ffi/capi/bindings/js/LineBreak.mjs create mode 100644 ffi/capi/bindings/js/Script.d.ts create mode 100644 ffi/capi/bindings/js/Script.mjs create mode 100644 ffi/capi/bindings/js/SentenceBreak.d.ts create mode 100644 ffi/capi/bindings/js/SentenceBreak.mjs create mode 100644 ffi/capi/bindings/js/WordBreak.d.ts create mode 100644 ffi/capi/bindings/js/WordBreak.mjs create mode 100644 ffi/capi/src/properties_enums.rs diff --git a/components/properties/src/props.rs b/components/properties/src/props.rs index ce701c0b8bc..920bbf808b2 100644 --- a/components/properties/src/props.rs +++ b/components/properties/src/props.rs @@ -628,6 +628,7 @@ impl From for u32 { #[repr(transparent)] pub struct Script(pub u16); +create_const_array! { #[allow(missing_docs)] // These constants don't need individual documentation. #[allow(non_upper_case_globals)] impl Script { @@ -797,6 +798,7 @@ impl Script { pub const Yi: Script = Script(41); pub const ZanabazarSquare: Script = Script(177); } +} make_enumerated_property! { name: "Script"; @@ -941,6 +943,7 @@ make_enumerated_property! { #[repr(transparent)] pub struct LineBreak(pub u8); +create_const_array! { #[allow(missing_docs)] // These constants don't need individual documentation. #[allow(non_upper_case_globals)] impl LineBreak { @@ -995,6 +998,7 @@ impl LineBreak { pub const ViramaFinal: LineBreak = LineBreak(46); // name=VF" pub const Virama: LineBreak = LineBreak(47); // name=VI" } +} make_enumerated_property! { name: "Line_Break"; @@ -1034,6 +1038,7 @@ make_enumerated_property! { #[repr(transparent)] pub struct GraphemeClusterBreak(pub u8); +create_const_array! { #[allow(missing_docs)] // These constants don't need individual documentation. #[allow(non_upper_case_globals)] impl GraphemeClusterBreak { @@ -1060,6 +1065,7 @@ impl GraphemeClusterBreak { pub const GlueAfterZwj: GraphemeClusterBreak = GraphemeClusterBreak(16); // name="GAZ" pub const ZWJ: GraphemeClusterBreak = GraphemeClusterBreak(17); // name="ZWJ" } +} make_enumerated_property! { name: "Grapheme_Cluster_Break"; diff --git a/ffi/capi/bindings/c/BidiClass.d.h b/ffi/capi/bindings/c/BidiClass.d.h new file mode 100644 index 00000000000..66c71f86cf4 --- /dev/null +++ b/ffi/capi/bindings/c/BidiClass.d.h @@ -0,0 +1,44 @@ +#ifndef BidiClass_D_H +#define BidiClass_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum BidiClass { + BidiClass_LeftToRight = 0, + BidiClass_RightToLeft = 1, + BidiClass_EuropeanNumber = 2, + BidiClass_EuropeanSeparator = 3, + BidiClass_EuropeanTerminator = 4, + BidiClass_ArabicNumber = 5, + BidiClass_CommonSeparator = 6, + BidiClass_ParagraphSeparator = 7, + BidiClass_SegmentSeparator = 8, + BidiClass_WhiteSpace = 9, + BidiClass_OtherNeutral = 10, + BidiClass_LeftToRightEmbedding = 11, + BidiClass_LeftToRightOverride = 12, + BidiClass_ArabicLetter = 13, + BidiClass_RightToLeftEmbedding = 14, + BidiClass_RightToLeftOverride = 15, + BidiClass_PopDirectionalFormat = 16, + BidiClass_NonspacingMark = 17, + BidiClass_BoundaryNeutral = 18, + BidiClass_FirstStrongIsolate = 19, + BidiClass_LeftToRightIsolate = 20, + BidiClass_RightToLeftIsolate = 21, + BidiClass_PopDirectionalIsolate = 22, +} BidiClass; + +typedef struct BidiClass_option {union { BidiClass ok; }; bool is_ok; } BidiClass_option; + + + +#endif // BidiClass_D_H diff --git a/ffi/capi/bindings/c/BidiClass.h b/ffi/capi/bindings/c/BidiClass.h new file mode 100644 index 00000000000..d4153a1ae4b --- /dev/null +++ b/ffi/capi/bindings/c/BidiClass.h @@ -0,0 +1,28 @@ +#ifndef BidiClass_H +#define BidiClass_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "BidiClass.d.h" + + + + + + +uint8_t icu4x_BidiClass_to_integer_mv1(BidiClass self); + +typedef struct icu4x_BidiClass_from_integer_mv1_result {union {BidiClass ok; }; bool is_ok;} icu4x_BidiClass_from_integer_mv1_result; +icu4x_BidiClass_from_integer_mv1_result icu4x_BidiClass_from_integer_mv1(uint8_t other); + + + + + + +#endif // BidiClass_H diff --git a/ffi/capi/bindings/c/CanonicalCombiningClass.d.h b/ffi/capi/bindings/c/CanonicalCombiningClass.d.h new file mode 100644 index 00000000000..f74945ceeba --- /dev/null +++ b/ffi/capi/bindings/c/CanonicalCombiningClass.d.h @@ -0,0 +1,79 @@ +#ifndef CanonicalCombiningClass_D_H +#define CanonicalCombiningClass_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum CanonicalCombiningClass { + CanonicalCombiningClass_NotReordered = 0, + CanonicalCombiningClass_Overlay = 1, + CanonicalCombiningClass_HanReading = 6, + CanonicalCombiningClass_Nukta = 7, + CanonicalCombiningClass_KanaVoicing = 8, + CanonicalCombiningClass_Virama = 9, + CanonicalCombiningClass_CCC10 = 10, + CanonicalCombiningClass_CCC11 = 11, + CanonicalCombiningClass_CCC12 = 12, + CanonicalCombiningClass_CCC13 = 13, + CanonicalCombiningClass_CCC14 = 14, + CanonicalCombiningClass_CCC15 = 15, + CanonicalCombiningClass_CCC16 = 16, + CanonicalCombiningClass_CCC17 = 17, + CanonicalCombiningClass_CCC18 = 18, + CanonicalCombiningClass_CCC19 = 19, + CanonicalCombiningClass_CCC20 = 20, + CanonicalCombiningClass_CCC21 = 21, + CanonicalCombiningClass_CCC22 = 22, + CanonicalCombiningClass_CCC23 = 23, + CanonicalCombiningClass_CCC24 = 24, + CanonicalCombiningClass_CCC25 = 25, + CanonicalCombiningClass_CCC26 = 26, + CanonicalCombiningClass_CCC27 = 27, + CanonicalCombiningClass_CCC28 = 28, + CanonicalCombiningClass_CCC29 = 29, + CanonicalCombiningClass_CCC30 = 30, + CanonicalCombiningClass_CCC31 = 31, + CanonicalCombiningClass_CCC32 = 32, + CanonicalCombiningClass_CCC33 = 33, + CanonicalCombiningClass_CCC34 = 34, + CanonicalCombiningClass_CCC35 = 35, + CanonicalCombiningClass_CCC36 = 36, + CanonicalCombiningClass_CCC84 = 84, + CanonicalCombiningClass_CCC91 = 91, + CanonicalCombiningClass_CCC103 = 103, + CanonicalCombiningClass_CCC107 = 107, + CanonicalCombiningClass_CCC118 = 118, + CanonicalCombiningClass_CCC122 = 122, + CanonicalCombiningClass_CCC129 = 129, + CanonicalCombiningClass_CCC130 = 130, + CanonicalCombiningClass_CCC132 = 132, + CanonicalCombiningClass_CCC133 = 133, + CanonicalCombiningClass_AttachedBelowLeft = 200, + CanonicalCombiningClass_AttachedBelow = 202, + CanonicalCombiningClass_AttachedAbove = 214, + CanonicalCombiningClass_AttachedAboveRight = 216, + CanonicalCombiningClass_BelowLeft = 218, + CanonicalCombiningClass_Below = 220, + CanonicalCombiningClass_BelowRight = 222, + CanonicalCombiningClass_Left = 224, + CanonicalCombiningClass_Right = 226, + CanonicalCombiningClass_AboveLeft = 228, + CanonicalCombiningClass_Above = 230, + CanonicalCombiningClass_AboveRight = 232, + CanonicalCombiningClass_DoubleBelow = 233, + CanonicalCombiningClass_DoubleAbove = 234, + CanonicalCombiningClass_IotaSubscript = 240, +} CanonicalCombiningClass; + +typedef struct CanonicalCombiningClass_option {union { CanonicalCombiningClass ok; }; bool is_ok; } CanonicalCombiningClass_option; + + + +#endif // CanonicalCombiningClass_D_H diff --git a/ffi/capi/bindings/c/CanonicalCombiningClass.h b/ffi/capi/bindings/c/CanonicalCombiningClass.h new file mode 100644 index 00000000000..3332be32fc2 --- /dev/null +++ b/ffi/capi/bindings/c/CanonicalCombiningClass.h @@ -0,0 +1,28 @@ +#ifndef CanonicalCombiningClass_H +#define CanonicalCombiningClass_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "CanonicalCombiningClass.d.h" + + + + + + +uint8_t icu4x_CanonicalCombiningClass_to_integer_mv1(CanonicalCombiningClass self); + +typedef struct icu4x_CanonicalCombiningClass_from_integer_mv1_result {union {CanonicalCombiningClass ok; }; bool is_ok;} icu4x_CanonicalCombiningClass_from_integer_mv1_result; +icu4x_CanonicalCombiningClass_from_integer_mv1_result icu4x_CanonicalCombiningClass_from_integer_mv1(uint8_t other); + + + + + + +#endif // CanonicalCombiningClass_H diff --git a/ffi/capi/bindings/c/EastAsianWidth.d.h b/ffi/capi/bindings/c/EastAsianWidth.d.h new file mode 100644 index 00000000000..03e8ceb6b76 --- /dev/null +++ b/ffi/capi/bindings/c/EastAsianWidth.d.h @@ -0,0 +1,27 @@ +#ifndef EastAsianWidth_D_H +#define EastAsianWidth_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum EastAsianWidth { + EastAsianWidth_Neutral = 0, + EastAsianWidth_Ambiguous = 1, + EastAsianWidth_Halfwidth = 2, + EastAsianWidth_Fullwidth = 3, + EastAsianWidth_Narrow = 4, + EastAsianWidth_Wide = 5, +} EastAsianWidth; + +typedef struct EastAsianWidth_option {union { EastAsianWidth ok; }; bool is_ok; } EastAsianWidth_option; + + + +#endif // EastAsianWidth_D_H diff --git a/ffi/capi/bindings/c/EastAsianWidth.h b/ffi/capi/bindings/c/EastAsianWidth.h new file mode 100644 index 00000000000..0bdcf43f1d4 --- /dev/null +++ b/ffi/capi/bindings/c/EastAsianWidth.h @@ -0,0 +1,28 @@ +#ifndef EastAsianWidth_H +#define EastAsianWidth_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "EastAsianWidth.d.h" + + + + + + +uint8_t icu4x_EastAsianWidth_to_integer_mv1(EastAsianWidth self); + +typedef struct icu4x_EastAsianWidth_from_integer_mv1_result {union {EastAsianWidth ok; }; bool is_ok;} icu4x_EastAsianWidth_from_integer_mv1_result; +icu4x_EastAsianWidth_from_integer_mv1_result icu4x_EastAsianWidth_from_integer_mv1(uint8_t other); + + + + + + +#endif // EastAsianWidth_H diff --git a/ffi/capi/bindings/c/GraphemeClusterBreak.d.h b/ffi/capi/bindings/c/GraphemeClusterBreak.d.h new file mode 100644 index 00000000000..8384218181c --- /dev/null +++ b/ffi/capi/bindings/c/GraphemeClusterBreak.d.h @@ -0,0 +1,39 @@ +#ifndef GraphemeClusterBreak_D_H +#define GraphemeClusterBreak_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum GraphemeClusterBreak { + GraphemeClusterBreak_Other = 0, + GraphemeClusterBreak_Control = 1, + GraphemeClusterBreak_CR = 2, + GraphemeClusterBreak_Extend = 3, + GraphemeClusterBreak_L = 4, + GraphemeClusterBreak_LF = 5, + GraphemeClusterBreak_LV = 6, + GraphemeClusterBreak_LVT = 7, + GraphemeClusterBreak_T = 8, + GraphemeClusterBreak_V = 9, + GraphemeClusterBreak_SpacingMark = 10, + GraphemeClusterBreak_Prepend = 11, + GraphemeClusterBreak_RegionalIndicator = 12, + GraphemeClusterBreak_EBase = 13, + GraphemeClusterBreak_EBaseGAZ = 14, + GraphemeClusterBreak_EModifier = 15, + GraphemeClusterBreak_GlueAfterZwj = 16, + GraphemeClusterBreak_ZWJ = 17, +} GraphemeClusterBreak; + +typedef struct GraphemeClusterBreak_option {union { GraphemeClusterBreak ok; }; bool is_ok; } GraphemeClusterBreak_option; + + + +#endif // GraphemeClusterBreak_D_H diff --git a/ffi/capi/bindings/c/GraphemeClusterBreak.h b/ffi/capi/bindings/c/GraphemeClusterBreak.h new file mode 100644 index 00000000000..c31d76f5b78 --- /dev/null +++ b/ffi/capi/bindings/c/GraphemeClusterBreak.h @@ -0,0 +1,28 @@ +#ifndef GraphemeClusterBreak_H +#define GraphemeClusterBreak_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "GraphemeClusterBreak.d.h" + + + + + + +uint8_t icu4x_GraphemeClusterBreak_to_integer_mv1(GraphemeClusterBreak self); + +typedef struct icu4x_GraphemeClusterBreak_from_integer_mv1_result {union {GraphemeClusterBreak ok; }; bool is_ok;} icu4x_GraphemeClusterBreak_from_integer_mv1_result; +icu4x_GraphemeClusterBreak_from_integer_mv1_result icu4x_GraphemeClusterBreak_from_integer_mv1(uint8_t other); + + + + + + +#endif // GraphemeClusterBreak_H diff --git a/ffi/capi/bindings/c/HangulSyllableType.d.h b/ffi/capi/bindings/c/HangulSyllableType.d.h new file mode 100644 index 00000000000..122312c6577 --- /dev/null +++ b/ffi/capi/bindings/c/HangulSyllableType.d.h @@ -0,0 +1,27 @@ +#ifndef HangulSyllableType_D_H +#define HangulSyllableType_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum HangulSyllableType { + HangulSyllableType_NotApplicable = 0, + HangulSyllableType_LeadingJamo = 1, + HangulSyllableType_VowelJamo = 2, + HangulSyllableType_TrailingJamo = 3, + HangulSyllableType_LeadingVowelSyllable = 4, + HangulSyllableType_LeadingVowelTrailingSyllable = 5, +} HangulSyllableType; + +typedef struct HangulSyllableType_option {union { HangulSyllableType ok; }; bool is_ok; } HangulSyllableType_option; + + + +#endif // HangulSyllableType_D_H diff --git a/ffi/capi/bindings/c/HangulSyllableType.h b/ffi/capi/bindings/c/HangulSyllableType.h new file mode 100644 index 00000000000..7b2f1e58fb6 --- /dev/null +++ b/ffi/capi/bindings/c/HangulSyllableType.h @@ -0,0 +1,28 @@ +#ifndef HangulSyllableType_H +#define HangulSyllableType_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "HangulSyllableType.d.h" + + + + + + +uint8_t icu4x_HangulSyllableType_to_integer_mv1(HangulSyllableType self); + +typedef struct icu4x_HangulSyllableType_from_integer_mv1_result {union {HangulSyllableType ok; }; bool is_ok;} icu4x_HangulSyllableType_from_integer_mv1_result; +icu4x_HangulSyllableType_from_integer_mv1_result icu4x_HangulSyllableType_from_integer_mv1(uint8_t other); + + + + + + +#endif // HangulSyllableType_H diff --git a/ffi/capi/bindings/c/IndicSyllabicCategory.d.h b/ffi/capi/bindings/c/IndicSyllabicCategory.d.h new file mode 100644 index 00000000000..7dd8148e680 --- /dev/null +++ b/ffi/capi/bindings/c/IndicSyllabicCategory.d.h @@ -0,0 +1,58 @@ +#ifndef IndicSyllabicCategory_D_H +#define IndicSyllabicCategory_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum IndicSyllabicCategory { + IndicSyllabicCategory_Other = 0, + IndicSyllabicCategory_Avagraha = 1, + IndicSyllabicCategory_Bindu = 2, + IndicSyllabicCategory_BrahmiJoiningNumber = 3, + IndicSyllabicCategory_CantillationMark = 4, + IndicSyllabicCategory_Consonant = 5, + IndicSyllabicCategory_ConsonantDead = 6, + IndicSyllabicCategory_ConsonantFinal = 7, + IndicSyllabicCategory_ConsonantHeadLetter = 8, + IndicSyllabicCategory_ConsonantInitialPostfixed = 9, + IndicSyllabicCategory_ConsonantKiller = 10, + IndicSyllabicCategory_ConsonantMedial = 11, + IndicSyllabicCategory_ConsonantPlaceholder = 12, + IndicSyllabicCategory_ConsonantPrecedingRepha = 13, + IndicSyllabicCategory_ConsonantPrefixed = 14, + IndicSyllabicCategory_ConsonantSucceedingRepha = 15, + IndicSyllabicCategory_ConsonantSubjoined = 16, + IndicSyllabicCategory_ConsonantWithStacker = 17, + IndicSyllabicCategory_GeminationMark = 18, + IndicSyllabicCategory_InvisibleStacker = 19, + IndicSyllabicCategory_Joiner = 20, + IndicSyllabicCategory_ModifyingLetter = 21, + IndicSyllabicCategory_NonJoiner = 22, + IndicSyllabicCategory_Nukta = 23, + IndicSyllabicCategory_Number = 24, + IndicSyllabicCategory_NumberJoiner = 25, + IndicSyllabicCategory_PureKiller = 26, + IndicSyllabicCategory_RegisterShifter = 27, + IndicSyllabicCategory_SyllableModifier = 28, + IndicSyllabicCategory_ToneLetter = 29, + IndicSyllabicCategory_ToneMark = 30, + IndicSyllabicCategory_Virama = 31, + IndicSyllabicCategory_Visarga = 32, + IndicSyllabicCategory_Vowel = 33, + IndicSyllabicCategory_VowelDependent = 34, + IndicSyllabicCategory_VowelIndependent = 35, + IndicSyllabicCategory_ReorderingKiller = 36, +} IndicSyllabicCategory; + +typedef struct IndicSyllabicCategory_option {union { IndicSyllabicCategory ok; }; bool is_ok; } IndicSyllabicCategory_option; + + + +#endif // IndicSyllabicCategory_D_H diff --git a/ffi/capi/bindings/c/IndicSyllabicCategory.h b/ffi/capi/bindings/c/IndicSyllabicCategory.h new file mode 100644 index 00000000000..a6c6efee35e --- /dev/null +++ b/ffi/capi/bindings/c/IndicSyllabicCategory.h @@ -0,0 +1,28 @@ +#ifndef IndicSyllabicCategory_H +#define IndicSyllabicCategory_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "IndicSyllabicCategory.d.h" + + + + + + +uint8_t icu4x_IndicSyllabicCategory_to_integer_mv1(IndicSyllabicCategory self); + +typedef struct icu4x_IndicSyllabicCategory_from_integer_mv1_result {union {IndicSyllabicCategory ok; }; bool is_ok;} icu4x_IndicSyllabicCategory_from_integer_mv1_result; +icu4x_IndicSyllabicCategory_from_integer_mv1_result icu4x_IndicSyllabicCategory_from_integer_mv1(uint8_t other); + + + + + + +#endif // IndicSyllabicCategory_H diff --git a/ffi/capi/bindings/c/JoiningType.d.h b/ffi/capi/bindings/c/JoiningType.d.h new file mode 100644 index 00000000000..d616850ba27 --- /dev/null +++ b/ffi/capi/bindings/c/JoiningType.d.h @@ -0,0 +1,27 @@ +#ifndef JoiningType_D_H +#define JoiningType_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum JoiningType { + JoiningType_NonJoining = 0, + JoiningType_JoinCausing = 1, + JoiningType_DualJoining = 2, + JoiningType_LeftJoining = 3, + JoiningType_RightJoining = 4, + JoiningType_Transparent = 5, +} JoiningType; + +typedef struct JoiningType_option {union { JoiningType ok; }; bool is_ok; } JoiningType_option; + + + +#endif // JoiningType_D_H diff --git a/ffi/capi/bindings/c/JoiningType.h b/ffi/capi/bindings/c/JoiningType.h new file mode 100644 index 00000000000..20a257eda42 --- /dev/null +++ b/ffi/capi/bindings/c/JoiningType.h @@ -0,0 +1,28 @@ +#ifndef JoiningType_H +#define JoiningType_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "JoiningType.d.h" + + + + + + +uint8_t icu4x_JoiningType_to_integer_mv1(JoiningType self); + +typedef struct icu4x_JoiningType_from_integer_mv1_result {union {JoiningType ok; }; bool is_ok;} icu4x_JoiningType_from_integer_mv1_result; +icu4x_JoiningType_from_integer_mv1_result icu4x_JoiningType_from_integer_mv1(uint8_t other); + + + + + + +#endif // JoiningType_H diff --git a/ffi/capi/bindings/c/LineBreak.d.h b/ffi/capi/bindings/c/LineBreak.d.h new file mode 100644 index 00000000000..fa633ab9370 --- /dev/null +++ b/ffi/capi/bindings/c/LineBreak.d.h @@ -0,0 +1,69 @@ +#ifndef LineBreak_D_H +#define LineBreak_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum LineBreak { + LineBreak_Unknown = 0, + LineBreak_Ambiguous = 1, + LineBreak_Alphabetic = 2, + LineBreak_BreakBoth = 3, + LineBreak_BreakAfter = 4, + LineBreak_BreakBefore = 5, + LineBreak_MandatoryBreak = 6, + LineBreak_ContingentBreak = 7, + LineBreak_ClosePunctuation = 8, + LineBreak_CombiningMark = 9, + LineBreak_CarriageReturn = 10, + LineBreak_Exclamation = 11, + LineBreak_Glue = 12, + LineBreak_Hyphen = 13, + LineBreak_Ideographic = 14, + LineBreak_Inseparable = 15, + LineBreak_InfixNumeric = 16, + LineBreak_LineFeed = 17, + LineBreak_Nonstarter = 18, + LineBreak_Numeric = 19, + LineBreak_OpenPunctuation = 20, + LineBreak_PostfixNumeric = 21, + LineBreak_PrefixNumeric = 22, + LineBreak_Quotation = 23, + LineBreak_ComplexContext = 24, + LineBreak_Surrogate = 25, + LineBreak_Space = 26, + LineBreak_BreakSymbols = 27, + LineBreak_ZWSpace = 28, + LineBreak_NextLine = 29, + LineBreak_WordJoiner = 30, + LineBreak_H2 = 31, + LineBreak_H3 = 32, + LineBreak_JL = 33, + LineBreak_JT = 34, + LineBreak_JV = 35, + LineBreak_CloseParenthesis = 36, + LineBreak_ConditionalJapaneseStarter = 37, + LineBreak_HebrewLetter = 38, + LineBreak_RegionalIndicator = 39, + LineBreak_EBase = 40, + LineBreak_EModifier = 41, + LineBreak_ZWJ = 42, + LineBreak_Aksara = 43, + LineBreak_AksaraPrebase = 44, + LineBreak_AksaraStart = 45, + LineBreak_ViramaFinal = 46, + LineBreak_Virama = 47, +} LineBreak; + +typedef struct LineBreak_option {union { LineBreak ok; }; bool is_ok; } LineBreak_option; + + + +#endif // LineBreak_D_H diff --git a/ffi/capi/bindings/c/LineBreak.h b/ffi/capi/bindings/c/LineBreak.h new file mode 100644 index 00000000000..590b40e06f4 --- /dev/null +++ b/ffi/capi/bindings/c/LineBreak.h @@ -0,0 +1,28 @@ +#ifndef LineBreak_H +#define LineBreak_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "LineBreak.d.h" + + + + + + +uint8_t icu4x_LineBreak_to_integer_mv1(LineBreak self); + +typedef struct icu4x_LineBreak_from_integer_mv1_result {union {LineBreak ok; }; bool is_ok;} icu4x_LineBreak_from_integer_mv1_result; +icu4x_LineBreak_from_integer_mv1_result icu4x_LineBreak_from_integer_mv1(uint8_t other); + + + + + + +#endif // LineBreak_H diff --git a/ffi/capi/bindings/c/Script.d.h b/ffi/capi/bindings/c/Script.d.h new file mode 100644 index 00000000000..23f6564c215 --- /dev/null +++ b/ffi/capi/bindings/c/Script.d.h @@ -0,0 +1,186 @@ +#ifndef Script_D_H +#define Script_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum Script { + Script_Adlam = 167, + Script_Ahom = 161, + Script_AnatolianHieroglyphs = 156, + Script_Arabic = 2, + Script_Armenian = 3, + Script_Avestan = 117, + Script_Balinese = 62, + Script_Bamum = 130, + Script_BassaVah = 134, + Script_Batak = 63, + Script_Bengali = 4, + Script_Bhaiksuki = 168, + Script_Bopomofo = 5, + Script_Brahmi = 65, + Script_Braille = 46, + Script_Buginese = 55, + Script_Buhid = 44, + Script_CanadianAboriginal = 40, + Script_Carian = 104, + Script_CaucasianAlbanian = 159, + Script_Chakma = 118, + Script_Cham = 66, + Script_Cherokee = 6, + Script_Chorasmian = 189, + Script_Common = 0, + Script_Coptic = 7, + Script_Cuneiform = 101, + Script_Cypriot = 47, + Script_CyproMinoan = 193, + Script_Cyrillic = 8, + Script_Deseret = 9, + Script_Devanagari = 10, + Script_DivesAkuru = 190, + Script_Dogra = 178, + Script_Duployan = 135, + Script_EgyptianHieroglyphs = 71, + Script_Elbasan = 136, + Script_Elymaic = 185, + Script_Ethiopian = 11, + Script_Georgian = 12, + Script_Glagolitic = 56, + Script_Gothic = 13, + Script_Grantha = 137, + Script_Greek = 14, + Script_Gujarati = 15, + Script_GunjalaGondi = 179, + Script_Gurmukhi = 16, + Script_Han = 17, + Script_Hangul = 18, + Script_HanifiRohingya = 182, + Script_Hanunoo = 43, + Script_Hatran = 162, + Script_Hebrew = 19, + Script_Hiragana = 20, + Script_ImperialAramaic = 116, + Script_Inherited = 1, + Script_InscriptionalPahlavi = 122, + Script_InscriptionalParthian = 125, + Script_Javanese = 78, + Script_Kaithi = 120, + Script_Kannada = 21, + Script_Katakana = 22, + Script_Kawi = 198, + Script_KayahLi = 79, + Script_Kharoshthi = 57, + Script_KhitanSmallScript = 191, + Script_Khmer = 23, + Script_Khojki = 157, + Script_Khudawadi = 145, + Script_Lao = 24, + Script_Latin = 25, + Script_Lepcha = 82, + Script_Limbu = 48, + Script_LinearA = 83, + Script_LinearB = 49, + Script_Lisu = 131, + Script_Lycian = 107, + Script_Lydian = 108, + Script_Mahajani = 160, + Script_Makasar = 180, + Script_Malayalam = 26, + Script_Mandaic = 84, + Script_Manichaean = 121, + Script_Marchen = 169, + Script_MasaramGondi = 175, + Script_Medefaidrin = 181, + Script_MeeteiMayek = 115, + Script_MendeKikakui = 140, + Script_MeroiticCursive = 141, + Script_MeroiticHieroglyphs = 86, + Script_Miao = 92, + Script_Modi = 163, + Script_Mongolian = 27, + Script_Mro = 149, + Script_Multani = 164, + Script_Myanmar = 28, + Script_Nabataean = 143, + Script_NagMundari = 199, + Script_Nandinagari = 187, + Script_Nastaliq = 200, + Script_NewTaiLue = 59, + Script_Newa = 170, + Script_Nko = 87, + Script_Nushu = 150, + Script_NyiakengPuachueHmong = 186, + Script_Ogham = 29, + Script_OlChiki = 109, + Script_OldHungarian = 76, + Script_OldItalic = 30, + Script_OldNorthArabian = 142, + Script_OldPermic = 89, + Script_OldPersian = 61, + Script_OldSogdian = 184, + Script_OldSouthArabian = 133, + Script_OldTurkic = 88, + Script_OldUyghur = 194, + Script_Oriya = 31, + Script_Osage = 171, + Script_Osmanya = 50, + Script_PahawhHmong = 75, + Script_Palmyrene = 144, + Script_PauCinHau = 165, + Script_PhagsPa = 90, + Script_Phoenician = 91, + Script_PsalterPahlavi = 123, + Script_Rejang = 110, + Script_Runic = 32, + Script_Samaritan = 126, + Script_Saurashtra = 111, + Script_Sharada = 151, + Script_Shavian = 51, + Script_Siddham = 166, + Script_SignWriting = 112, + Script_Sinhala = 33, + Script_Sogdian = 183, + Script_SoraSompeng = 152, + Script_Soyombo = 176, + Script_Sundanese = 113, + Script_SylotiNagri = 58, + Script_Syriac = 34, + Script_Tagalog = 42, + Script_Tagbanwa = 45, + Script_TaiLe = 52, + Script_TaiTham = 106, + Script_TaiViet = 127, + Script_Takri = 153, + Script_Tamil = 35, + Script_Tangsa = 195, + Script_Tangut = 154, + Script_Telugu = 36, + Script_Thaana = 37, + Script_Thai = 38, + Script_Tibetan = 39, + Script_Tifinagh = 60, + Script_Tirhuta = 158, + Script_Toto = 196, + Script_Ugaritic = 53, + Script_Unknown = 103, + Script_Vai = 99, + Script_Vithkuqi = 197, + Script_Wancho = 188, + Script_WarangCiti = 146, + Script_Yezidi = 192, + Script_Yi = 41, + Script_ZanabazarSquare = 177, +} Script; + +typedef struct Script_option {union { Script ok; }; bool is_ok; } Script_option; + + + +#endif // Script_D_H diff --git a/ffi/capi/bindings/c/Script.h b/ffi/capi/bindings/c/Script.h new file mode 100644 index 00000000000..501c5d933c2 --- /dev/null +++ b/ffi/capi/bindings/c/Script.h @@ -0,0 +1,28 @@ +#ifndef Script_H +#define Script_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "Script.d.h" + + + + + + +uint16_t icu4x_Script_to_integer_mv1(Script self); + +typedef struct icu4x_Script_from_integer_mv1_result {union {Script ok; }; bool is_ok;} icu4x_Script_from_integer_mv1_result; +icu4x_Script_from_integer_mv1_result icu4x_Script_from_integer_mv1(uint16_t other); + + + + + + +#endif // Script_H diff --git a/ffi/capi/bindings/c/SentenceBreak.d.h b/ffi/capi/bindings/c/SentenceBreak.d.h new file mode 100644 index 00000000000..2cd0ddc99fc --- /dev/null +++ b/ffi/capi/bindings/c/SentenceBreak.d.h @@ -0,0 +1,36 @@ +#ifndef SentenceBreak_D_H +#define SentenceBreak_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum SentenceBreak { + SentenceBreak_Other = 0, + SentenceBreak_ATerm = 1, + SentenceBreak_Close = 2, + SentenceBreak_Format = 3, + SentenceBreak_Lower = 4, + SentenceBreak_Numeric = 5, + SentenceBreak_OLetter = 6, + SentenceBreak_Sep = 7, + SentenceBreak_Sp = 8, + SentenceBreak_STerm = 9, + SentenceBreak_Upper = 10, + SentenceBreak_CR = 11, + SentenceBreak_Extend = 12, + SentenceBreak_LF = 13, + SentenceBreak_SContinue = 14, +} SentenceBreak; + +typedef struct SentenceBreak_option {union { SentenceBreak ok; }; bool is_ok; } SentenceBreak_option; + + + +#endif // SentenceBreak_D_H diff --git a/ffi/capi/bindings/c/SentenceBreak.h b/ffi/capi/bindings/c/SentenceBreak.h new file mode 100644 index 00000000000..f9bfe086ed7 --- /dev/null +++ b/ffi/capi/bindings/c/SentenceBreak.h @@ -0,0 +1,28 @@ +#ifndef SentenceBreak_H +#define SentenceBreak_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "SentenceBreak.d.h" + + + + + + +uint8_t icu4x_SentenceBreak_to_integer_mv1(SentenceBreak self); + +typedef struct icu4x_SentenceBreak_from_integer_mv1_result {union {SentenceBreak ok; }; bool is_ok;} icu4x_SentenceBreak_from_integer_mv1_result; +icu4x_SentenceBreak_from_integer_mv1_result icu4x_SentenceBreak_from_integer_mv1(uint8_t other); + + + + + + +#endif // SentenceBreak_H diff --git a/ffi/capi/bindings/c/WordBreak.d.h b/ffi/capi/bindings/c/WordBreak.d.h new file mode 100644 index 00000000000..752a50b34dc --- /dev/null +++ b/ffi/capi/bindings/c/WordBreak.d.h @@ -0,0 +1,44 @@ +#ifndef WordBreak_D_H +#define WordBreak_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef enum WordBreak { + WordBreak_Other = 0, + WordBreak_ALetter = 1, + WordBreak_Format = 2, + WordBreak_Katakana = 3, + WordBreak_MidLetter = 4, + WordBreak_MidNum = 5, + WordBreak_Numeric = 6, + WordBreak_ExtendNumLet = 7, + WordBreak_CR = 8, + WordBreak_Extend = 9, + WordBreak_LF = 10, + WordBreak_MidNumLet = 11, + WordBreak_Newline = 12, + WordBreak_RegionalIndicator = 13, + WordBreak_HebrewLetter = 14, + WordBreak_SingleQuote = 15, + WordBreak_DoubleQuote = 16, + WordBreak_EBase = 17, + WordBreak_EBaseGAZ = 18, + WordBreak_EModifier = 19, + WordBreak_GlueAfterZwj = 20, + WordBreak_ZWJ = 21, + WordBreak_WSegSpace = 22, +} WordBreak; + +typedef struct WordBreak_option {union { WordBreak ok; }; bool is_ok; } WordBreak_option; + + + +#endif // WordBreak_D_H diff --git a/ffi/capi/bindings/c/WordBreak.h b/ffi/capi/bindings/c/WordBreak.h new file mode 100644 index 00000000000..b0afe7611c6 --- /dev/null +++ b/ffi/capi/bindings/c/WordBreak.h @@ -0,0 +1,28 @@ +#ifndef WordBreak_H +#define WordBreak_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + +#include "WordBreak.d.h" + + + + + + +uint8_t icu4x_WordBreak_to_integer_mv1(WordBreak self); + +typedef struct icu4x_WordBreak_from_integer_mv1_result {union {WordBreak ok; }; bool is_ok;} icu4x_WordBreak_from_integer_mv1_result; +icu4x_WordBreak_from_integer_mv1_result icu4x_WordBreak_from_integer_mv1(uint8_t other); + + + + + + +#endif // WordBreak_H diff --git a/ffi/capi/bindings/cpp/icu4x/BidiClass.d.hpp b/ffi/capi/bindings/cpp/icu4x/BidiClass.d.hpp new file mode 100644 index 00000000000..c52f0203daa --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/BidiClass.d.hpp @@ -0,0 +1,96 @@ +#ifndef icu4x_BidiClass_D_HPP +#define icu4x_BidiClass_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class BidiClass; +} + + +namespace icu4x { +namespace capi { + enum BidiClass { + BidiClass_LeftToRight = 0, + BidiClass_RightToLeft = 1, + BidiClass_EuropeanNumber = 2, + BidiClass_EuropeanSeparator = 3, + BidiClass_EuropeanTerminator = 4, + BidiClass_ArabicNumber = 5, + BidiClass_CommonSeparator = 6, + BidiClass_ParagraphSeparator = 7, + BidiClass_SegmentSeparator = 8, + BidiClass_WhiteSpace = 9, + BidiClass_OtherNeutral = 10, + BidiClass_LeftToRightEmbedding = 11, + BidiClass_LeftToRightOverride = 12, + BidiClass_ArabicLetter = 13, + BidiClass_RightToLeftEmbedding = 14, + BidiClass_RightToLeftOverride = 15, + BidiClass_PopDirectionalFormat = 16, + BidiClass_NonspacingMark = 17, + BidiClass_BoundaryNeutral = 18, + BidiClass_FirstStrongIsolate = 19, + BidiClass_LeftToRightIsolate = 20, + BidiClass_RightToLeftIsolate = 21, + BidiClass_PopDirectionalIsolate = 22, + }; + + typedef struct BidiClass_option {union { BidiClass ok; }; bool is_ok; } BidiClass_option; +} // namespace capi +} // namespace + +namespace icu4x { +class BidiClass { +public: + enum Value { + LeftToRight = 0, + RightToLeft = 1, + EuropeanNumber = 2, + EuropeanSeparator = 3, + EuropeanTerminator = 4, + ArabicNumber = 5, + CommonSeparator = 6, + ParagraphSeparator = 7, + SegmentSeparator = 8, + WhiteSpace = 9, + OtherNeutral = 10, + LeftToRightEmbedding = 11, + LeftToRightOverride = 12, + ArabicLetter = 13, + RightToLeftEmbedding = 14, + RightToLeftOverride = 15, + PopDirectionalFormat = 16, + NonspacingMark = 17, + BoundaryNeutral = 18, + FirstStrongIsolate = 19, + LeftToRightIsolate = 20, + RightToLeftIsolate = 21, + PopDirectionalIsolate = 22, + }; + + BidiClass() = default; + // Implicit conversions between enum and ::Value + constexpr BidiClass(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::BidiClass AsFFI() const; + inline static icu4x::BidiClass FromFFI(icu4x::capi::BidiClass c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_BidiClass_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/BidiClass.hpp b/ffi/capi/bindings/cpp/icu4x/BidiClass.hpp new file mode 100644 index 00000000000..7845ba67ceb --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/BidiClass.hpp @@ -0,0 +1,73 @@ +#ifndef icu4x_BidiClass_HPP +#define icu4x_BidiClass_HPP + +#include "BidiClass.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_BidiClass_to_integer_mv1(icu4x::capi::BidiClass self); + + typedef struct icu4x_BidiClass_from_integer_mv1_result {union {icu4x::capi::BidiClass ok; }; bool is_ok;} icu4x_BidiClass_from_integer_mv1_result; + icu4x_BidiClass_from_integer_mv1_result icu4x_BidiClass_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::BidiClass icu4x::BidiClass::AsFFI() const { + return static_cast(value); +} + +inline icu4x::BidiClass icu4x::BidiClass::FromFFI(icu4x::capi::BidiClass c_enum) { + switch (c_enum) { + case icu4x::capi::BidiClass_LeftToRight: + case icu4x::capi::BidiClass_RightToLeft: + case icu4x::capi::BidiClass_EuropeanNumber: + case icu4x::capi::BidiClass_EuropeanSeparator: + case icu4x::capi::BidiClass_EuropeanTerminator: + case icu4x::capi::BidiClass_ArabicNumber: + case icu4x::capi::BidiClass_CommonSeparator: + case icu4x::capi::BidiClass_ParagraphSeparator: + case icu4x::capi::BidiClass_SegmentSeparator: + case icu4x::capi::BidiClass_WhiteSpace: + case icu4x::capi::BidiClass_OtherNeutral: + case icu4x::capi::BidiClass_LeftToRightEmbedding: + case icu4x::capi::BidiClass_LeftToRightOverride: + case icu4x::capi::BidiClass_ArabicLetter: + case icu4x::capi::BidiClass_RightToLeftEmbedding: + case icu4x::capi::BidiClass_RightToLeftOverride: + case icu4x::capi::BidiClass_PopDirectionalFormat: + case icu4x::capi::BidiClass_NonspacingMark: + case icu4x::capi::BidiClass_BoundaryNeutral: + case icu4x::capi::BidiClass_FirstStrongIsolate: + case icu4x::capi::BidiClass_LeftToRightIsolate: + case icu4x::capi::BidiClass_RightToLeftIsolate: + case icu4x::capi::BidiClass_PopDirectionalIsolate: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::BidiClass::to_integer() { + auto result = icu4x::capi::icu4x_BidiClass_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::BidiClass::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_BidiClass_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::BidiClass::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_BidiClass_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.d.hpp b/ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.d.hpp new file mode 100644 index 00000000000..2be03676d73 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.d.hpp @@ -0,0 +1,166 @@ +#ifndef icu4x_CanonicalCombiningClass_D_HPP +#define icu4x_CanonicalCombiningClass_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class CanonicalCombiningClass; +} + + +namespace icu4x { +namespace capi { + enum CanonicalCombiningClass { + CanonicalCombiningClass_NotReordered = 0, + CanonicalCombiningClass_Overlay = 1, + CanonicalCombiningClass_HanReading = 6, + CanonicalCombiningClass_Nukta = 7, + CanonicalCombiningClass_KanaVoicing = 8, + CanonicalCombiningClass_Virama = 9, + CanonicalCombiningClass_CCC10 = 10, + CanonicalCombiningClass_CCC11 = 11, + CanonicalCombiningClass_CCC12 = 12, + CanonicalCombiningClass_CCC13 = 13, + CanonicalCombiningClass_CCC14 = 14, + CanonicalCombiningClass_CCC15 = 15, + CanonicalCombiningClass_CCC16 = 16, + CanonicalCombiningClass_CCC17 = 17, + CanonicalCombiningClass_CCC18 = 18, + CanonicalCombiningClass_CCC19 = 19, + CanonicalCombiningClass_CCC20 = 20, + CanonicalCombiningClass_CCC21 = 21, + CanonicalCombiningClass_CCC22 = 22, + CanonicalCombiningClass_CCC23 = 23, + CanonicalCombiningClass_CCC24 = 24, + CanonicalCombiningClass_CCC25 = 25, + CanonicalCombiningClass_CCC26 = 26, + CanonicalCombiningClass_CCC27 = 27, + CanonicalCombiningClass_CCC28 = 28, + CanonicalCombiningClass_CCC29 = 29, + CanonicalCombiningClass_CCC30 = 30, + CanonicalCombiningClass_CCC31 = 31, + CanonicalCombiningClass_CCC32 = 32, + CanonicalCombiningClass_CCC33 = 33, + CanonicalCombiningClass_CCC34 = 34, + CanonicalCombiningClass_CCC35 = 35, + CanonicalCombiningClass_CCC36 = 36, + CanonicalCombiningClass_CCC84 = 84, + CanonicalCombiningClass_CCC91 = 91, + CanonicalCombiningClass_CCC103 = 103, + CanonicalCombiningClass_CCC107 = 107, + CanonicalCombiningClass_CCC118 = 118, + CanonicalCombiningClass_CCC122 = 122, + CanonicalCombiningClass_CCC129 = 129, + CanonicalCombiningClass_CCC130 = 130, + CanonicalCombiningClass_CCC132 = 132, + CanonicalCombiningClass_CCC133 = 133, + CanonicalCombiningClass_AttachedBelowLeft = 200, + CanonicalCombiningClass_AttachedBelow = 202, + CanonicalCombiningClass_AttachedAbove = 214, + CanonicalCombiningClass_AttachedAboveRight = 216, + CanonicalCombiningClass_BelowLeft = 218, + CanonicalCombiningClass_Below = 220, + CanonicalCombiningClass_BelowRight = 222, + CanonicalCombiningClass_Left = 224, + CanonicalCombiningClass_Right = 226, + CanonicalCombiningClass_AboveLeft = 228, + CanonicalCombiningClass_Above = 230, + CanonicalCombiningClass_AboveRight = 232, + CanonicalCombiningClass_DoubleBelow = 233, + CanonicalCombiningClass_DoubleAbove = 234, + CanonicalCombiningClass_IotaSubscript = 240, + }; + + typedef struct CanonicalCombiningClass_option {union { CanonicalCombiningClass ok; }; bool is_ok; } CanonicalCombiningClass_option; +} // namespace capi +} // namespace + +namespace icu4x { +class CanonicalCombiningClass { +public: + enum Value { + NotReordered = 0, + Overlay = 1, + HanReading = 6, + Nukta = 7, + KanaVoicing = 8, + Virama = 9, + CCC10 = 10, + CCC11 = 11, + CCC12 = 12, + CCC13 = 13, + CCC14 = 14, + CCC15 = 15, + CCC16 = 16, + CCC17 = 17, + CCC18 = 18, + CCC19 = 19, + CCC20 = 20, + CCC21 = 21, + CCC22 = 22, + CCC23 = 23, + CCC24 = 24, + CCC25 = 25, + CCC26 = 26, + CCC27 = 27, + CCC28 = 28, + CCC29 = 29, + CCC30 = 30, + CCC31 = 31, + CCC32 = 32, + CCC33 = 33, + CCC34 = 34, + CCC35 = 35, + CCC36 = 36, + CCC84 = 84, + CCC91 = 91, + CCC103 = 103, + CCC107 = 107, + CCC118 = 118, + CCC122 = 122, + CCC129 = 129, + CCC130 = 130, + CCC132 = 132, + CCC133 = 133, + AttachedBelowLeft = 200, + AttachedBelow = 202, + AttachedAbove = 214, + AttachedAboveRight = 216, + BelowLeft = 218, + Below = 220, + BelowRight = 222, + Left = 224, + Right = 226, + AboveLeft = 228, + Above = 230, + AboveRight = 232, + DoubleBelow = 233, + DoubleAbove = 234, + IotaSubscript = 240, + }; + + CanonicalCombiningClass() = default; + // Implicit conversions between enum and ::Value + constexpr CanonicalCombiningClass(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::CanonicalCombiningClass AsFFI() const; + inline static icu4x::CanonicalCombiningClass FromFFI(icu4x::capi::CanonicalCombiningClass c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_CanonicalCombiningClass_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.hpp b/ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.hpp new file mode 100644 index 00000000000..e6b98919e2a --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/CanonicalCombiningClass.hpp @@ -0,0 +1,108 @@ +#ifndef icu4x_CanonicalCombiningClass_HPP +#define icu4x_CanonicalCombiningClass_HPP + +#include "CanonicalCombiningClass.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_CanonicalCombiningClass_to_integer_mv1(icu4x::capi::CanonicalCombiningClass self); + + typedef struct icu4x_CanonicalCombiningClass_from_integer_mv1_result {union {icu4x::capi::CanonicalCombiningClass ok; }; bool is_ok;} icu4x_CanonicalCombiningClass_from_integer_mv1_result; + icu4x_CanonicalCombiningClass_from_integer_mv1_result icu4x_CanonicalCombiningClass_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::CanonicalCombiningClass icu4x::CanonicalCombiningClass::AsFFI() const { + return static_cast(value); +} + +inline icu4x::CanonicalCombiningClass icu4x::CanonicalCombiningClass::FromFFI(icu4x::capi::CanonicalCombiningClass c_enum) { + switch (c_enum) { + case icu4x::capi::CanonicalCombiningClass_NotReordered: + case icu4x::capi::CanonicalCombiningClass_Overlay: + case icu4x::capi::CanonicalCombiningClass_HanReading: + case icu4x::capi::CanonicalCombiningClass_Nukta: + case icu4x::capi::CanonicalCombiningClass_KanaVoicing: + case icu4x::capi::CanonicalCombiningClass_Virama: + case icu4x::capi::CanonicalCombiningClass_CCC10: + case icu4x::capi::CanonicalCombiningClass_CCC11: + case icu4x::capi::CanonicalCombiningClass_CCC12: + case icu4x::capi::CanonicalCombiningClass_CCC13: + case icu4x::capi::CanonicalCombiningClass_CCC14: + case icu4x::capi::CanonicalCombiningClass_CCC15: + case icu4x::capi::CanonicalCombiningClass_CCC16: + case icu4x::capi::CanonicalCombiningClass_CCC17: + case icu4x::capi::CanonicalCombiningClass_CCC18: + case icu4x::capi::CanonicalCombiningClass_CCC19: + case icu4x::capi::CanonicalCombiningClass_CCC20: + case icu4x::capi::CanonicalCombiningClass_CCC21: + case icu4x::capi::CanonicalCombiningClass_CCC22: + case icu4x::capi::CanonicalCombiningClass_CCC23: + case icu4x::capi::CanonicalCombiningClass_CCC24: + case icu4x::capi::CanonicalCombiningClass_CCC25: + case icu4x::capi::CanonicalCombiningClass_CCC26: + case icu4x::capi::CanonicalCombiningClass_CCC27: + case icu4x::capi::CanonicalCombiningClass_CCC28: + case icu4x::capi::CanonicalCombiningClass_CCC29: + case icu4x::capi::CanonicalCombiningClass_CCC30: + case icu4x::capi::CanonicalCombiningClass_CCC31: + case icu4x::capi::CanonicalCombiningClass_CCC32: + case icu4x::capi::CanonicalCombiningClass_CCC33: + case icu4x::capi::CanonicalCombiningClass_CCC34: + case icu4x::capi::CanonicalCombiningClass_CCC35: + case icu4x::capi::CanonicalCombiningClass_CCC36: + case icu4x::capi::CanonicalCombiningClass_CCC84: + case icu4x::capi::CanonicalCombiningClass_CCC91: + case icu4x::capi::CanonicalCombiningClass_CCC103: + case icu4x::capi::CanonicalCombiningClass_CCC107: + case icu4x::capi::CanonicalCombiningClass_CCC118: + case icu4x::capi::CanonicalCombiningClass_CCC122: + case icu4x::capi::CanonicalCombiningClass_CCC129: + case icu4x::capi::CanonicalCombiningClass_CCC130: + case icu4x::capi::CanonicalCombiningClass_CCC132: + case icu4x::capi::CanonicalCombiningClass_CCC133: + case icu4x::capi::CanonicalCombiningClass_AttachedBelowLeft: + case icu4x::capi::CanonicalCombiningClass_AttachedBelow: + case icu4x::capi::CanonicalCombiningClass_AttachedAbove: + case icu4x::capi::CanonicalCombiningClass_AttachedAboveRight: + case icu4x::capi::CanonicalCombiningClass_BelowLeft: + case icu4x::capi::CanonicalCombiningClass_Below: + case icu4x::capi::CanonicalCombiningClass_BelowRight: + case icu4x::capi::CanonicalCombiningClass_Left: + case icu4x::capi::CanonicalCombiningClass_Right: + case icu4x::capi::CanonicalCombiningClass_AboveLeft: + case icu4x::capi::CanonicalCombiningClass_Above: + case icu4x::capi::CanonicalCombiningClass_AboveRight: + case icu4x::capi::CanonicalCombiningClass_DoubleBelow: + case icu4x::capi::CanonicalCombiningClass_DoubleAbove: + case icu4x::capi::CanonicalCombiningClass_IotaSubscript: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::CanonicalCombiningClass::to_integer() { + auto result = icu4x::capi::icu4x_CanonicalCombiningClass_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::CanonicalCombiningClass::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_CanonicalCombiningClass_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::CanonicalCombiningClass::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_CanonicalCombiningClass_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/EastAsianWidth.d.hpp b/ffi/capi/bindings/cpp/icu4x/EastAsianWidth.d.hpp new file mode 100644 index 00000000000..20f8332e35b --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/EastAsianWidth.d.hpp @@ -0,0 +1,62 @@ +#ifndef icu4x_EastAsianWidth_D_HPP +#define icu4x_EastAsianWidth_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class EastAsianWidth; +} + + +namespace icu4x { +namespace capi { + enum EastAsianWidth { + EastAsianWidth_Neutral = 0, + EastAsianWidth_Ambiguous = 1, + EastAsianWidth_Halfwidth = 2, + EastAsianWidth_Fullwidth = 3, + EastAsianWidth_Narrow = 4, + EastAsianWidth_Wide = 5, + }; + + typedef struct EastAsianWidth_option {union { EastAsianWidth ok; }; bool is_ok; } EastAsianWidth_option; +} // namespace capi +} // namespace + +namespace icu4x { +class EastAsianWidth { +public: + enum Value { + Neutral = 0, + Ambiguous = 1, + Halfwidth = 2, + Fullwidth = 3, + Narrow = 4, + Wide = 5, + }; + + EastAsianWidth() = default; + // Implicit conversions between enum and ::Value + constexpr EastAsianWidth(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::EastAsianWidth AsFFI() const; + inline static icu4x::EastAsianWidth FromFFI(icu4x::capi::EastAsianWidth c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_EastAsianWidth_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/EastAsianWidth.hpp b/ffi/capi/bindings/cpp/icu4x/EastAsianWidth.hpp new file mode 100644 index 00000000000..1e5090948ae --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/EastAsianWidth.hpp @@ -0,0 +1,56 @@ +#ifndef icu4x_EastAsianWidth_HPP +#define icu4x_EastAsianWidth_HPP + +#include "EastAsianWidth.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_EastAsianWidth_to_integer_mv1(icu4x::capi::EastAsianWidth self); + + typedef struct icu4x_EastAsianWidth_from_integer_mv1_result {union {icu4x::capi::EastAsianWidth ok; }; bool is_ok;} icu4x_EastAsianWidth_from_integer_mv1_result; + icu4x_EastAsianWidth_from_integer_mv1_result icu4x_EastAsianWidth_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::EastAsianWidth icu4x::EastAsianWidth::AsFFI() const { + return static_cast(value); +} + +inline icu4x::EastAsianWidth icu4x::EastAsianWidth::FromFFI(icu4x::capi::EastAsianWidth c_enum) { + switch (c_enum) { + case icu4x::capi::EastAsianWidth_Neutral: + case icu4x::capi::EastAsianWidth_Ambiguous: + case icu4x::capi::EastAsianWidth_Halfwidth: + case icu4x::capi::EastAsianWidth_Fullwidth: + case icu4x::capi::EastAsianWidth_Narrow: + case icu4x::capi::EastAsianWidth_Wide: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::EastAsianWidth::to_integer() { + auto result = icu4x::capi::icu4x_EastAsianWidth_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::EastAsianWidth::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_EastAsianWidth_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::EastAsianWidth::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_EastAsianWidth_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.d.hpp b/ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.d.hpp new file mode 100644 index 00000000000..bedcb472eed --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.d.hpp @@ -0,0 +1,86 @@ +#ifndef icu4x_GraphemeClusterBreak_D_HPP +#define icu4x_GraphemeClusterBreak_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class GraphemeClusterBreak; +} + + +namespace icu4x { +namespace capi { + enum GraphemeClusterBreak { + GraphemeClusterBreak_Other = 0, + GraphemeClusterBreak_Control = 1, + GraphemeClusterBreak_CR = 2, + GraphemeClusterBreak_Extend = 3, + GraphemeClusterBreak_L = 4, + GraphemeClusterBreak_LF = 5, + GraphemeClusterBreak_LV = 6, + GraphemeClusterBreak_LVT = 7, + GraphemeClusterBreak_T = 8, + GraphemeClusterBreak_V = 9, + GraphemeClusterBreak_SpacingMark = 10, + GraphemeClusterBreak_Prepend = 11, + GraphemeClusterBreak_RegionalIndicator = 12, + GraphemeClusterBreak_EBase = 13, + GraphemeClusterBreak_EBaseGAZ = 14, + GraphemeClusterBreak_EModifier = 15, + GraphemeClusterBreak_GlueAfterZwj = 16, + GraphemeClusterBreak_ZWJ = 17, + }; + + typedef struct GraphemeClusterBreak_option {union { GraphemeClusterBreak ok; }; bool is_ok; } GraphemeClusterBreak_option; +} // namespace capi +} // namespace + +namespace icu4x { +class GraphemeClusterBreak { +public: + enum Value { + Other = 0, + Control = 1, + CR = 2, + Extend = 3, + L = 4, + LF = 5, + LV = 6, + LVT = 7, + T = 8, + V = 9, + SpacingMark = 10, + Prepend = 11, + RegionalIndicator = 12, + EBase = 13, + EBaseGAZ = 14, + EModifier = 15, + GlueAfterZwj = 16, + ZWJ = 17, + }; + + GraphemeClusterBreak() = default; + // Implicit conversions between enum and ::Value + constexpr GraphemeClusterBreak(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::GraphemeClusterBreak AsFFI() const; + inline static icu4x::GraphemeClusterBreak FromFFI(icu4x::capi::GraphemeClusterBreak c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_GraphemeClusterBreak_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.hpp b/ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.hpp new file mode 100644 index 00000000000..94a5f0da8b2 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/GraphemeClusterBreak.hpp @@ -0,0 +1,68 @@ +#ifndef icu4x_GraphemeClusterBreak_HPP +#define icu4x_GraphemeClusterBreak_HPP + +#include "GraphemeClusterBreak.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_GraphemeClusterBreak_to_integer_mv1(icu4x::capi::GraphemeClusterBreak self); + + typedef struct icu4x_GraphemeClusterBreak_from_integer_mv1_result {union {icu4x::capi::GraphemeClusterBreak ok; }; bool is_ok;} icu4x_GraphemeClusterBreak_from_integer_mv1_result; + icu4x_GraphemeClusterBreak_from_integer_mv1_result icu4x_GraphemeClusterBreak_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::GraphemeClusterBreak icu4x::GraphemeClusterBreak::AsFFI() const { + return static_cast(value); +} + +inline icu4x::GraphemeClusterBreak icu4x::GraphemeClusterBreak::FromFFI(icu4x::capi::GraphemeClusterBreak c_enum) { + switch (c_enum) { + case icu4x::capi::GraphemeClusterBreak_Other: + case icu4x::capi::GraphemeClusterBreak_Control: + case icu4x::capi::GraphemeClusterBreak_CR: + case icu4x::capi::GraphemeClusterBreak_Extend: + case icu4x::capi::GraphemeClusterBreak_L: + case icu4x::capi::GraphemeClusterBreak_LF: + case icu4x::capi::GraphemeClusterBreak_LV: + case icu4x::capi::GraphemeClusterBreak_LVT: + case icu4x::capi::GraphemeClusterBreak_T: + case icu4x::capi::GraphemeClusterBreak_V: + case icu4x::capi::GraphemeClusterBreak_SpacingMark: + case icu4x::capi::GraphemeClusterBreak_Prepend: + case icu4x::capi::GraphemeClusterBreak_RegionalIndicator: + case icu4x::capi::GraphemeClusterBreak_EBase: + case icu4x::capi::GraphemeClusterBreak_EBaseGAZ: + case icu4x::capi::GraphemeClusterBreak_EModifier: + case icu4x::capi::GraphemeClusterBreak_GlueAfterZwj: + case icu4x::capi::GraphemeClusterBreak_ZWJ: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::GraphemeClusterBreak::to_integer() { + auto result = icu4x::capi::icu4x_GraphemeClusterBreak_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::GraphemeClusterBreak::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_GraphemeClusterBreak_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::GraphemeClusterBreak::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_GraphemeClusterBreak_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/HangulSyllableType.d.hpp b/ffi/capi/bindings/cpp/icu4x/HangulSyllableType.d.hpp new file mode 100644 index 00000000000..3ae0fb7676b --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/HangulSyllableType.d.hpp @@ -0,0 +1,62 @@ +#ifndef icu4x_HangulSyllableType_D_HPP +#define icu4x_HangulSyllableType_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class HangulSyllableType; +} + + +namespace icu4x { +namespace capi { + enum HangulSyllableType { + HangulSyllableType_NotApplicable = 0, + HangulSyllableType_LeadingJamo = 1, + HangulSyllableType_VowelJamo = 2, + HangulSyllableType_TrailingJamo = 3, + HangulSyllableType_LeadingVowelSyllable = 4, + HangulSyllableType_LeadingVowelTrailingSyllable = 5, + }; + + typedef struct HangulSyllableType_option {union { HangulSyllableType ok; }; bool is_ok; } HangulSyllableType_option; +} // namespace capi +} // namespace + +namespace icu4x { +class HangulSyllableType { +public: + enum Value { + NotApplicable = 0, + LeadingJamo = 1, + VowelJamo = 2, + TrailingJamo = 3, + LeadingVowelSyllable = 4, + LeadingVowelTrailingSyllable = 5, + }; + + HangulSyllableType() = default; + // Implicit conversions between enum and ::Value + constexpr HangulSyllableType(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::HangulSyllableType AsFFI() const; + inline static icu4x::HangulSyllableType FromFFI(icu4x::capi::HangulSyllableType c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_HangulSyllableType_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/HangulSyllableType.hpp b/ffi/capi/bindings/cpp/icu4x/HangulSyllableType.hpp new file mode 100644 index 00000000000..9005702e657 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/HangulSyllableType.hpp @@ -0,0 +1,56 @@ +#ifndef icu4x_HangulSyllableType_HPP +#define icu4x_HangulSyllableType_HPP + +#include "HangulSyllableType.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_HangulSyllableType_to_integer_mv1(icu4x::capi::HangulSyllableType self); + + typedef struct icu4x_HangulSyllableType_from_integer_mv1_result {union {icu4x::capi::HangulSyllableType ok; }; bool is_ok;} icu4x_HangulSyllableType_from_integer_mv1_result; + icu4x_HangulSyllableType_from_integer_mv1_result icu4x_HangulSyllableType_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::HangulSyllableType icu4x::HangulSyllableType::AsFFI() const { + return static_cast(value); +} + +inline icu4x::HangulSyllableType icu4x::HangulSyllableType::FromFFI(icu4x::capi::HangulSyllableType c_enum) { + switch (c_enum) { + case icu4x::capi::HangulSyllableType_NotApplicable: + case icu4x::capi::HangulSyllableType_LeadingJamo: + case icu4x::capi::HangulSyllableType_VowelJamo: + case icu4x::capi::HangulSyllableType_TrailingJamo: + case icu4x::capi::HangulSyllableType_LeadingVowelSyllable: + case icu4x::capi::HangulSyllableType_LeadingVowelTrailingSyllable: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::HangulSyllableType::to_integer() { + auto result = icu4x::capi::icu4x_HangulSyllableType_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::HangulSyllableType::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_HangulSyllableType_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::HangulSyllableType::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_HangulSyllableType_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.d.hpp b/ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.d.hpp new file mode 100644 index 00000000000..f70fd9395aa --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.d.hpp @@ -0,0 +1,124 @@ +#ifndef icu4x_IndicSyllabicCategory_D_HPP +#define icu4x_IndicSyllabicCategory_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class IndicSyllabicCategory; +} + + +namespace icu4x { +namespace capi { + enum IndicSyllabicCategory { + IndicSyllabicCategory_Other = 0, + IndicSyllabicCategory_Avagraha = 1, + IndicSyllabicCategory_Bindu = 2, + IndicSyllabicCategory_BrahmiJoiningNumber = 3, + IndicSyllabicCategory_CantillationMark = 4, + IndicSyllabicCategory_Consonant = 5, + IndicSyllabicCategory_ConsonantDead = 6, + IndicSyllabicCategory_ConsonantFinal = 7, + IndicSyllabicCategory_ConsonantHeadLetter = 8, + IndicSyllabicCategory_ConsonantInitialPostfixed = 9, + IndicSyllabicCategory_ConsonantKiller = 10, + IndicSyllabicCategory_ConsonantMedial = 11, + IndicSyllabicCategory_ConsonantPlaceholder = 12, + IndicSyllabicCategory_ConsonantPrecedingRepha = 13, + IndicSyllabicCategory_ConsonantPrefixed = 14, + IndicSyllabicCategory_ConsonantSucceedingRepha = 15, + IndicSyllabicCategory_ConsonantSubjoined = 16, + IndicSyllabicCategory_ConsonantWithStacker = 17, + IndicSyllabicCategory_GeminationMark = 18, + IndicSyllabicCategory_InvisibleStacker = 19, + IndicSyllabicCategory_Joiner = 20, + IndicSyllabicCategory_ModifyingLetter = 21, + IndicSyllabicCategory_NonJoiner = 22, + IndicSyllabicCategory_Nukta = 23, + IndicSyllabicCategory_Number = 24, + IndicSyllabicCategory_NumberJoiner = 25, + IndicSyllabicCategory_PureKiller = 26, + IndicSyllabicCategory_RegisterShifter = 27, + IndicSyllabicCategory_SyllableModifier = 28, + IndicSyllabicCategory_ToneLetter = 29, + IndicSyllabicCategory_ToneMark = 30, + IndicSyllabicCategory_Virama = 31, + IndicSyllabicCategory_Visarga = 32, + IndicSyllabicCategory_Vowel = 33, + IndicSyllabicCategory_VowelDependent = 34, + IndicSyllabicCategory_VowelIndependent = 35, + IndicSyllabicCategory_ReorderingKiller = 36, + }; + + typedef struct IndicSyllabicCategory_option {union { IndicSyllabicCategory ok; }; bool is_ok; } IndicSyllabicCategory_option; +} // namespace capi +} // namespace + +namespace icu4x { +class IndicSyllabicCategory { +public: + enum Value { + Other = 0, + Avagraha = 1, + Bindu = 2, + BrahmiJoiningNumber = 3, + CantillationMark = 4, + Consonant = 5, + ConsonantDead = 6, + ConsonantFinal = 7, + ConsonantHeadLetter = 8, + ConsonantInitialPostfixed = 9, + ConsonantKiller = 10, + ConsonantMedial = 11, + ConsonantPlaceholder = 12, + ConsonantPrecedingRepha = 13, + ConsonantPrefixed = 14, + ConsonantSucceedingRepha = 15, + ConsonantSubjoined = 16, + ConsonantWithStacker = 17, + GeminationMark = 18, + InvisibleStacker = 19, + Joiner = 20, + ModifyingLetter = 21, + NonJoiner = 22, + Nukta = 23, + Number = 24, + NumberJoiner = 25, + PureKiller = 26, + RegisterShifter = 27, + SyllableModifier = 28, + ToneLetter = 29, + ToneMark = 30, + Virama = 31, + Visarga = 32, + Vowel = 33, + VowelDependent = 34, + VowelIndependent = 35, + ReorderingKiller = 36, + }; + + IndicSyllabicCategory() = default; + // Implicit conversions between enum and ::Value + constexpr IndicSyllabicCategory(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::IndicSyllabicCategory AsFFI() const; + inline static icu4x::IndicSyllabicCategory FromFFI(icu4x::capi::IndicSyllabicCategory c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_IndicSyllabicCategory_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.hpp b/ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.hpp new file mode 100644 index 00000000000..dd79a28204b --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/IndicSyllabicCategory.hpp @@ -0,0 +1,87 @@ +#ifndef icu4x_IndicSyllabicCategory_HPP +#define icu4x_IndicSyllabicCategory_HPP + +#include "IndicSyllabicCategory.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_IndicSyllabicCategory_to_integer_mv1(icu4x::capi::IndicSyllabicCategory self); + + typedef struct icu4x_IndicSyllabicCategory_from_integer_mv1_result {union {icu4x::capi::IndicSyllabicCategory ok; }; bool is_ok;} icu4x_IndicSyllabicCategory_from_integer_mv1_result; + icu4x_IndicSyllabicCategory_from_integer_mv1_result icu4x_IndicSyllabicCategory_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::IndicSyllabicCategory icu4x::IndicSyllabicCategory::AsFFI() const { + return static_cast(value); +} + +inline icu4x::IndicSyllabicCategory icu4x::IndicSyllabicCategory::FromFFI(icu4x::capi::IndicSyllabicCategory c_enum) { + switch (c_enum) { + case icu4x::capi::IndicSyllabicCategory_Other: + case icu4x::capi::IndicSyllabicCategory_Avagraha: + case icu4x::capi::IndicSyllabicCategory_Bindu: + case icu4x::capi::IndicSyllabicCategory_BrahmiJoiningNumber: + case icu4x::capi::IndicSyllabicCategory_CantillationMark: + case icu4x::capi::IndicSyllabicCategory_Consonant: + case icu4x::capi::IndicSyllabicCategory_ConsonantDead: + case icu4x::capi::IndicSyllabicCategory_ConsonantFinal: + case icu4x::capi::IndicSyllabicCategory_ConsonantHeadLetter: + case icu4x::capi::IndicSyllabicCategory_ConsonantInitialPostfixed: + case icu4x::capi::IndicSyllabicCategory_ConsonantKiller: + case icu4x::capi::IndicSyllabicCategory_ConsonantMedial: + case icu4x::capi::IndicSyllabicCategory_ConsonantPlaceholder: + case icu4x::capi::IndicSyllabicCategory_ConsonantPrecedingRepha: + case icu4x::capi::IndicSyllabicCategory_ConsonantPrefixed: + case icu4x::capi::IndicSyllabicCategory_ConsonantSucceedingRepha: + case icu4x::capi::IndicSyllabicCategory_ConsonantSubjoined: + case icu4x::capi::IndicSyllabicCategory_ConsonantWithStacker: + case icu4x::capi::IndicSyllabicCategory_GeminationMark: + case icu4x::capi::IndicSyllabicCategory_InvisibleStacker: + case icu4x::capi::IndicSyllabicCategory_Joiner: + case icu4x::capi::IndicSyllabicCategory_ModifyingLetter: + case icu4x::capi::IndicSyllabicCategory_NonJoiner: + case icu4x::capi::IndicSyllabicCategory_Nukta: + case icu4x::capi::IndicSyllabicCategory_Number: + case icu4x::capi::IndicSyllabicCategory_NumberJoiner: + case icu4x::capi::IndicSyllabicCategory_PureKiller: + case icu4x::capi::IndicSyllabicCategory_RegisterShifter: + case icu4x::capi::IndicSyllabicCategory_SyllableModifier: + case icu4x::capi::IndicSyllabicCategory_ToneLetter: + case icu4x::capi::IndicSyllabicCategory_ToneMark: + case icu4x::capi::IndicSyllabicCategory_Virama: + case icu4x::capi::IndicSyllabicCategory_Visarga: + case icu4x::capi::IndicSyllabicCategory_Vowel: + case icu4x::capi::IndicSyllabicCategory_VowelDependent: + case icu4x::capi::IndicSyllabicCategory_VowelIndependent: + case icu4x::capi::IndicSyllabicCategory_ReorderingKiller: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::IndicSyllabicCategory::to_integer() { + auto result = icu4x::capi::icu4x_IndicSyllabicCategory_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::IndicSyllabicCategory::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_IndicSyllabicCategory_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::IndicSyllabicCategory::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_IndicSyllabicCategory_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/JoiningType.d.hpp b/ffi/capi/bindings/cpp/icu4x/JoiningType.d.hpp new file mode 100644 index 00000000000..bcb510000ef --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/JoiningType.d.hpp @@ -0,0 +1,62 @@ +#ifndef icu4x_JoiningType_D_HPP +#define icu4x_JoiningType_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class JoiningType; +} + + +namespace icu4x { +namespace capi { + enum JoiningType { + JoiningType_NonJoining = 0, + JoiningType_JoinCausing = 1, + JoiningType_DualJoining = 2, + JoiningType_LeftJoining = 3, + JoiningType_RightJoining = 4, + JoiningType_Transparent = 5, + }; + + typedef struct JoiningType_option {union { JoiningType ok; }; bool is_ok; } JoiningType_option; +} // namespace capi +} // namespace + +namespace icu4x { +class JoiningType { +public: + enum Value { + NonJoining = 0, + JoinCausing = 1, + DualJoining = 2, + LeftJoining = 3, + RightJoining = 4, + Transparent = 5, + }; + + JoiningType() = default; + // Implicit conversions between enum and ::Value + constexpr JoiningType(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::JoiningType AsFFI() const; + inline static icu4x::JoiningType FromFFI(icu4x::capi::JoiningType c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_JoiningType_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/JoiningType.hpp b/ffi/capi/bindings/cpp/icu4x/JoiningType.hpp new file mode 100644 index 00000000000..68cf126f61d --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/JoiningType.hpp @@ -0,0 +1,56 @@ +#ifndef icu4x_JoiningType_HPP +#define icu4x_JoiningType_HPP + +#include "JoiningType.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_JoiningType_to_integer_mv1(icu4x::capi::JoiningType self); + + typedef struct icu4x_JoiningType_from_integer_mv1_result {union {icu4x::capi::JoiningType ok; }; bool is_ok;} icu4x_JoiningType_from_integer_mv1_result; + icu4x_JoiningType_from_integer_mv1_result icu4x_JoiningType_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::JoiningType icu4x::JoiningType::AsFFI() const { + return static_cast(value); +} + +inline icu4x::JoiningType icu4x::JoiningType::FromFFI(icu4x::capi::JoiningType c_enum) { + switch (c_enum) { + case icu4x::capi::JoiningType_NonJoining: + case icu4x::capi::JoiningType_JoinCausing: + case icu4x::capi::JoiningType_DualJoining: + case icu4x::capi::JoiningType_LeftJoining: + case icu4x::capi::JoiningType_RightJoining: + case icu4x::capi::JoiningType_Transparent: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::JoiningType::to_integer() { + auto result = icu4x::capi::icu4x_JoiningType_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::JoiningType::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_JoiningType_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::JoiningType::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_JoiningType_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/LineBreak.d.hpp b/ffi/capi/bindings/cpp/icu4x/LineBreak.d.hpp new file mode 100644 index 00000000000..c7e0218b27f --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/LineBreak.d.hpp @@ -0,0 +1,146 @@ +#ifndef icu4x_LineBreak_D_HPP +#define icu4x_LineBreak_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class LineBreak; +} + + +namespace icu4x { +namespace capi { + enum LineBreak { + LineBreak_Unknown = 0, + LineBreak_Ambiguous = 1, + LineBreak_Alphabetic = 2, + LineBreak_BreakBoth = 3, + LineBreak_BreakAfter = 4, + LineBreak_BreakBefore = 5, + LineBreak_MandatoryBreak = 6, + LineBreak_ContingentBreak = 7, + LineBreak_ClosePunctuation = 8, + LineBreak_CombiningMark = 9, + LineBreak_CarriageReturn = 10, + LineBreak_Exclamation = 11, + LineBreak_Glue = 12, + LineBreak_Hyphen = 13, + LineBreak_Ideographic = 14, + LineBreak_Inseparable = 15, + LineBreak_InfixNumeric = 16, + LineBreak_LineFeed = 17, + LineBreak_Nonstarter = 18, + LineBreak_Numeric = 19, + LineBreak_OpenPunctuation = 20, + LineBreak_PostfixNumeric = 21, + LineBreak_PrefixNumeric = 22, + LineBreak_Quotation = 23, + LineBreak_ComplexContext = 24, + LineBreak_Surrogate = 25, + LineBreak_Space = 26, + LineBreak_BreakSymbols = 27, + LineBreak_ZWSpace = 28, + LineBreak_NextLine = 29, + LineBreak_WordJoiner = 30, + LineBreak_H2 = 31, + LineBreak_H3 = 32, + LineBreak_JL = 33, + LineBreak_JT = 34, + LineBreak_JV = 35, + LineBreak_CloseParenthesis = 36, + LineBreak_ConditionalJapaneseStarter = 37, + LineBreak_HebrewLetter = 38, + LineBreak_RegionalIndicator = 39, + LineBreak_EBase = 40, + LineBreak_EModifier = 41, + LineBreak_ZWJ = 42, + LineBreak_Aksara = 43, + LineBreak_AksaraPrebase = 44, + LineBreak_AksaraStart = 45, + LineBreak_ViramaFinal = 46, + LineBreak_Virama = 47, + }; + + typedef struct LineBreak_option {union { LineBreak ok; }; bool is_ok; } LineBreak_option; +} // namespace capi +} // namespace + +namespace icu4x { +class LineBreak { +public: + enum Value { + Unknown = 0, + Ambiguous = 1, + Alphabetic = 2, + BreakBoth = 3, + BreakAfter = 4, + BreakBefore = 5, + MandatoryBreak = 6, + ContingentBreak = 7, + ClosePunctuation = 8, + CombiningMark = 9, + CarriageReturn = 10, + Exclamation = 11, + Glue = 12, + Hyphen = 13, + Ideographic = 14, + Inseparable = 15, + InfixNumeric = 16, + LineFeed = 17, + Nonstarter = 18, + Numeric = 19, + OpenPunctuation = 20, + PostfixNumeric = 21, + PrefixNumeric = 22, + Quotation = 23, + ComplexContext = 24, + Surrogate = 25, + Space = 26, + BreakSymbols = 27, + ZWSpace = 28, + NextLine = 29, + WordJoiner = 30, + H2 = 31, + H3 = 32, + JL = 33, + JT = 34, + JV = 35, + CloseParenthesis = 36, + ConditionalJapaneseStarter = 37, + HebrewLetter = 38, + RegionalIndicator = 39, + EBase = 40, + EModifier = 41, + ZWJ = 42, + Aksara = 43, + AksaraPrebase = 44, + AksaraStart = 45, + ViramaFinal = 46, + Virama = 47, + }; + + LineBreak() = default; + // Implicit conversions between enum and ::Value + constexpr LineBreak(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::LineBreak AsFFI() const; + inline static icu4x::LineBreak FromFFI(icu4x::capi::LineBreak c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_LineBreak_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/LineBreak.hpp b/ffi/capi/bindings/cpp/icu4x/LineBreak.hpp new file mode 100644 index 00000000000..d8771125dbe --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/LineBreak.hpp @@ -0,0 +1,98 @@ +#ifndef icu4x_LineBreak_HPP +#define icu4x_LineBreak_HPP + +#include "LineBreak.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_LineBreak_to_integer_mv1(icu4x::capi::LineBreak self); + + typedef struct icu4x_LineBreak_from_integer_mv1_result {union {icu4x::capi::LineBreak ok; }; bool is_ok;} icu4x_LineBreak_from_integer_mv1_result; + icu4x_LineBreak_from_integer_mv1_result icu4x_LineBreak_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::LineBreak icu4x::LineBreak::AsFFI() const { + return static_cast(value); +} + +inline icu4x::LineBreak icu4x::LineBreak::FromFFI(icu4x::capi::LineBreak c_enum) { + switch (c_enum) { + case icu4x::capi::LineBreak_Unknown: + case icu4x::capi::LineBreak_Ambiguous: + case icu4x::capi::LineBreak_Alphabetic: + case icu4x::capi::LineBreak_BreakBoth: + case icu4x::capi::LineBreak_BreakAfter: + case icu4x::capi::LineBreak_BreakBefore: + case icu4x::capi::LineBreak_MandatoryBreak: + case icu4x::capi::LineBreak_ContingentBreak: + case icu4x::capi::LineBreak_ClosePunctuation: + case icu4x::capi::LineBreak_CombiningMark: + case icu4x::capi::LineBreak_CarriageReturn: + case icu4x::capi::LineBreak_Exclamation: + case icu4x::capi::LineBreak_Glue: + case icu4x::capi::LineBreak_Hyphen: + case icu4x::capi::LineBreak_Ideographic: + case icu4x::capi::LineBreak_Inseparable: + case icu4x::capi::LineBreak_InfixNumeric: + case icu4x::capi::LineBreak_LineFeed: + case icu4x::capi::LineBreak_Nonstarter: + case icu4x::capi::LineBreak_Numeric: + case icu4x::capi::LineBreak_OpenPunctuation: + case icu4x::capi::LineBreak_PostfixNumeric: + case icu4x::capi::LineBreak_PrefixNumeric: + case icu4x::capi::LineBreak_Quotation: + case icu4x::capi::LineBreak_ComplexContext: + case icu4x::capi::LineBreak_Surrogate: + case icu4x::capi::LineBreak_Space: + case icu4x::capi::LineBreak_BreakSymbols: + case icu4x::capi::LineBreak_ZWSpace: + case icu4x::capi::LineBreak_NextLine: + case icu4x::capi::LineBreak_WordJoiner: + case icu4x::capi::LineBreak_H2: + case icu4x::capi::LineBreak_H3: + case icu4x::capi::LineBreak_JL: + case icu4x::capi::LineBreak_JT: + case icu4x::capi::LineBreak_JV: + case icu4x::capi::LineBreak_CloseParenthesis: + case icu4x::capi::LineBreak_ConditionalJapaneseStarter: + case icu4x::capi::LineBreak_HebrewLetter: + case icu4x::capi::LineBreak_RegionalIndicator: + case icu4x::capi::LineBreak_EBase: + case icu4x::capi::LineBreak_EModifier: + case icu4x::capi::LineBreak_ZWJ: + case icu4x::capi::LineBreak_Aksara: + case icu4x::capi::LineBreak_AksaraPrebase: + case icu4x::capi::LineBreak_AksaraStart: + case icu4x::capi::LineBreak_ViramaFinal: + case icu4x::capi::LineBreak_Virama: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::LineBreak::to_integer() { + auto result = icu4x::capi::icu4x_LineBreak_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::LineBreak::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_LineBreak_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::LineBreak::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_LineBreak_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/Script.d.hpp b/ffi/capi/bindings/cpp/icu4x/Script.d.hpp new file mode 100644 index 00000000000..a49d688dd05 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/Script.d.hpp @@ -0,0 +1,380 @@ +#ifndef icu4x_Script_D_HPP +#define icu4x_Script_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class Script; +} + + +namespace icu4x { +namespace capi { + enum Script { + Script_Adlam = 167, + Script_Ahom = 161, + Script_AnatolianHieroglyphs = 156, + Script_Arabic = 2, + Script_Armenian = 3, + Script_Avestan = 117, + Script_Balinese = 62, + Script_Bamum = 130, + Script_BassaVah = 134, + Script_Batak = 63, + Script_Bengali = 4, + Script_Bhaiksuki = 168, + Script_Bopomofo = 5, + Script_Brahmi = 65, + Script_Braille = 46, + Script_Buginese = 55, + Script_Buhid = 44, + Script_CanadianAboriginal = 40, + Script_Carian = 104, + Script_CaucasianAlbanian = 159, + Script_Chakma = 118, + Script_Cham = 66, + Script_Cherokee = 6, + Script_Chorasmian = 189, + Script_Common = 0, + Script_Coptic = 7, + Script_Cuneiform = 101, + Script_Cypriot = 47, + Script_CyproMinoan = 193, + Script_Cyrillic = 8, + Script_Deseret = 9, + Script_Devanagari = 10, + Script_DivesAkuru = 190, + Script_Dogra = 178, + Script_Duployan = 135, + Script_EgyptianHieroglyphs = 71, + Script_Elbasan = 136, + Script_Elymaic = 185, + Script_Ethiopian = 11, + Script_Georgian = 12, + Script_Glagolitic = 56, + Script_Gothic = 13, + Script_Grantha = 137, + Script_Greek = 14, + Script_Gujarati = 15, + Script_GunjalaGondi = 179, + Script_Gurmukhi = 16, + Script_Han = 17, + Script_Hangul = 18, + Script_HanifiRohingya = 182, + Script_Hanunoo = 43, + Script_Hatran = 162, + Script_Hebrew = 19, + Script_Hiragana = 20, + Script_ImperialAramaic = 116, + Script_Inherited = 1, + Script_InscriptionalPahlavi = 122, + Script_InscriptionalParthian = 125, + Script_Javanese = 78, + Script_Kaithi = 120, + Script_Kannada = 21, + Script_Katakana = 22, + Script_Kawi = 198, + Script_KayahLi = 79, + Script_Kharoshthi = 57, + Script_KhitanSmallScript = 191, + Script_Khmer = 23, + Script_Khojki = 157, + Script_Khudawadi = 145, + Script_Lao = 24, + Script_Latin = 25, + Script_Lepcha = 82, + Script_Limbu = 48, + Script_LinearA = 83, + Script_LinearB = 49, + Script_Lisu = 131, + Script_Lycian = 107, + Script_Lydian = 108, + Script_Mahajani = 160, + Script_Makasar = 180, + Script_Malayalam = 26, + Script_Mandaic = 84, + Script_Manichaean = 121, + Script_Marchen = 169, + Script_MasaramGondi = 175, + Script_Medefaidrin = 181, + Script_MeeteiMayek = 115, + Script_MendeKikakui = 140, + Script_MeroiticCursive = 141, + Script_MeroiticHieroglyphs = 86, + Script_Miao = 92, + Script_Modi = 163, + Script_Mongolian = 27, + Script_Mro = 149, + Script_Multani = 164, + Script_Myanmar = 28, + Script_Nabataean = 143, + Script_NagMundari = 199, + Script_Nandinagari = 187, + Script_Nastaliq = 200, + Script_NewTaiLue = 59, + Script_Newa = 170, + Script_Nko = 87, + Script_Nushu = 150, + Script_NyiakengPuachueHmong = 186, + Script_Ogham = 29, + Script_OlChiki = 109, + Script_OldHungarian = 76, + Script_OldItalic = 30, + Script_OldNorthArabian = 142, + Script_OldPermic = 89, + Script_OldPersian = 61, + Script_OldSogdian = 184, + Script_OldSouthArabian = 133, + Script_OldTurkic = 88, + Script_OldUyghur = 194, + Script_Oriya = 31, + Script_Osage = 171, + Script_Osmanya = 50, + Script_PahawhHmong = 75, + Script_Palmyrene = 144, + Script_PauCinHau = 165, + Script_PhagsPa = 90, + Script_Phoenician = 91, + Script_PsalterPahlavi = 123, + Script_Rejang = 110, + Script_Runic = 32, + Script_Samaritan = 126, + Script_Saurashtra = 111, + Script_Sharada = 151, + Script_Shavian = 51, + Script_Siddham = 166, + Script_SignWriting = 112, + Script_Sinhala = 33, + Script_Sogdian = 183, + Script_SoraSompeng = 152, + Script_Soyombo = 176, + Script_Sundanese = 113, + Script_SylotiNagri = 58, + Script_Syriac = 34, + Script_Tagalog = 42, + Script_Tagbanwa = 45, + Script_TaiLe = 52, + Script_TaiTham = 106, + Script_TaiViet = 127, + Script_Takri = 153, + Script_Tamil = 35, + Script_Tangsa = 195, + Script_Tangut = 154, + Script_Telugu = 36, + Script_Thaana = 37, + Script_Thai = 38, + Script_Tibetan = 39, + Script_Tifinagh = 60, + Script_Tirhuta = 158, + Script_Toto = 196, + Script_Ugaritic = 53, + Script_Unknown = 103, + Script_Vai = 99, + Script_Vithkuqi = 197, + Script_Wancho = 188, + Script_WarangCiti = 146, + Script_Yezidi = 192, + Script_Yi = 41, + Script_ZanabazarSquare = 177, + }; + + typedef struct Script_option {union { Script ok; }; bool is_ok; } Script_option; +} // namespace capi +} // namespace + +namespace icu4x { +class Script { +public: + enum Value { + Adlam = 167, + Ahom = 161, + AnatolianHieroglyphs = 156, + Arabic = 2, + Armenian = 3, + Avestan = 117, + Balinese = 62, + Bamum = 130, + BassaVah = 134, + Batak = 63, + Bengali = 4, + Bhaiksuki = 168, + Bopomofo = 5, + Brahmi = 65, + Braille = 46, + Buginese = 55, + Buhid = 44, + CanadianAboriginal = 40, + Carian = 104, + CaucasianAlbanian = 159, + Chakma = 118, + Cham = 66, + Cherokee = 6, + Chorasmian = 189, + Common = 0, + Coptic = 7, + Cuneiform = 101, + Cypriot = 47, + CyproMinoan = 193, + Cyrillic = 8, + Deseret = 9, + Devanagari = 10, + DivesAkuru = 190, + Dogra = 178, + Duployan = 135, + EgyptianHieroglyphs = 71, + Elbasan = 136, + Elymaic = 185, + Ethiopian = 11, + Georgian = 12, + Glagolitic = 56, + Gothic = 13, + Grantha = 137, + Greek = 14, + Gujarati = 15, + GunjalaGondi = 179, + Gurmukhi = 16, + Han = 17, + Hangul = 18, + HanifiRohingya = 182, + Hanunoo = 43, + Hatran = 162, + Hebrew = 19, + Hiragana = 20, + ImperialAramaic = 116, + Inherited = 1, + InscriptionalPahlavi = 122, + InscriptionalParthian = 125, + Javanese = 78, + Kaithi = 120, + Kannada = 21, + Katakana = 22, + Kawi = 198, + KayahLi = 79, + Kharoshthi = 57, + KhitanSmallScript = 191, + Khmer = 23, + Khojki = 157, + Khudawadi = 145, + Lao = 24, + Latin = 25, + Lepcha = 82, + Limbu = 48, + LinearA = 83, + LinearB = 49, + Lisu = 131, + Lycian = 107, + Lydian = 108, + Mahajani = 160, + Makasar = 180, + Malayalam = 26, + Mandaic = 84, + Manichaean = 121, + Marchen = 169, + MasaramGondi = 175, + Medefaidrin = 181, + MeeteiMayek = 115, + MendeKikakui = 140, + MeroiticCursive = 141, + MeroiticHieroglyphs = 86, + Miao = 92, + Modi = 163, + Mongolian = 27, + Mro = 149, + Multani = 164, + Myanmar = 28, + Nabataean = 143, + NagMundari = 199, + Nandinagari = 187, + Nastaliq = 200, + NewTaiLue = 59, + Newa = 170, + Nko = 87, + Nushu = 150, + NyiakengPuachueHmong = 186, + Ogham = 29, + OlChiki = 109, + OldHungarian = 76, + OldItalic = 30, + OldNorthArabian = 142, + OldPermic = 89, + OldPersian = 61, + OldSogdian = 184, + OldSouthArabian = 133, + OldTurkic = 88, + OldUyghur = 194, + Oriya = 31, + Osage = 171, + Osmanya = 50, + PahawhHmong = 75, + Palmyrene = 144, + PauCinHau = 165, + PhagsPa = 90, + Phoenician = 91, + PsalterPahlavi = 123, + Rejang = 110, + Runic = 32, + Samaritan = 126, + Saurashtra = 111, + Sharada = 151, + Shavian = 51, + Siddham = 166, + SignWriting = 112, + Sinhala = 33, + Sogdian = 183, + SoraSompeng = 152, + Soyombo = 176, + Sundanese = 113, + SylotiNagri = 58, + Syriac = 34, + Tagalog = 42, + Tagbanwa = 45, + TaiLe = 52, + TaiTham = 106, + TaiViet = 127, + Takri = 153, + Tamil = 35, + Tangsa = 195, + Tangut = 154, + Telugu = 36, + Thaana = 37, + Thai = 38, + Tibetan = 39, + Tifinagh = 60, + Tirhuta = 158, + Toto = 196, + Ugaritic = 53, + Unknown = 103, + Vai = 99, + Vithkuqi = 197, + Wancho = 188, + WarangCiti = 146, + Yezidi = 192, + Yi = 41, + ZanabazarSquare = 177, + }; + + Script() = default; + // Implicit conversions between enum and ::Value + constexpr Script(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint16_t to_integer(); + + inline static std::optional from_integer(uint16_t other); + + inline icu4x::capi::Script AsFFI() const; + inline static icu4x::Script FromFFI(icu4x::capi::Script c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_Script_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/Script.hpp b/ffi/capi/bindings/cpp/icu4x/Script.hpp new file mode 100644 index 00000000000..521860bac21 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/Script.hpp @@ -0,0 +1,215 @@ +#ifndef icu4x_Script_HPP +#define icu4x_Script_HPP + +#include "Script.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint16_t icu4x_Script_to_integer_mv1(icu4x::capi::Script self); + + typedef struct icu4x_Script_from_integer_mv1_result {union {icu4x::capi::Script ok; }; bool is_ok;} icu4x_Script_from_integer_mv1_result; + icu4x_Script_from_integer_mv1_result icu4x_Script_from_integer_mv1(uint16_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::Script icu4x::Script::AsFFI() const { + return static_cast(value); +} + +inline icu4x::Script icu4x::Script::FromFFI(icu4x::capi::Script c_enum) { + switch (c_enum) { + case icu4x::capi::Script_Adlam: + case icu4x::capi::Script_Ahom: + case icu4x::capi::Script_AnatolianHieroglyphs: + case icu4x::capi::Script_Arabic: + case icu4x::capi::Script_Armenian: + case icu4x::capi::Script_Avestan: + case icu4x::capi::Script_Balinese: + case icu4x::capi::Script_Bamum: + case icu4x::capi::Script_BassaVah: + case icu4x::capi::Script_Batak: + case icu4x::capi::Script_Bengali: + case icu4x::capi::Script_Bhaiksuki: + case icu4x::capi::Script_Bopomofo: + case icu4x::capi::Script_Brahmi: + case icu4x::capi::Script_Braille: + case icu4x::capi::Script_Buginese: + case icu4x::capi::Script_Buhid: + case icu4x::capi::Script_CanadianAboriginal: + case icu4x::capi::Script_Carian: + case icu4x::capi::Script_CaucasianAlbanian: + case icu4x::capi::Script_Chakma: + case icu4x::capi::Script_Cham: + case icu4x::capi::Script_Cherokee: + case icu4x::capi::Script_Chorasmian: + case icu4x::capi::Script_Common: + case icu4x::capi::Script_Coptic: + case icu4x::capi::Script_Cuneiform: + case icu4x::capi::Script_Cypriot: + case icu4x::capi::Script_CyproMinoan: + case icu4x::capi::Script_Cyrillic: + case icu4x::capi::Script_Deseret: + case icu4x::capi::Script_Devanagari: + case icu4x::capi::Script_DivesAkuru: + case icu4x::capi::Script_Dogra: + case icu4x::capi::Script_Duployan: + case icu4x::capi::Script_EgyptianHieroglyphs: + case icu4x::capi::Script_Elbasan: + case icu4x::capi::Script_Elymaic: + case icu4x::capi::Script_Ethiopian: + case icu4x::capi::Script_Georgian: + case icu4x::capi::Script_Glagolitic: + case icu4x::capi::Script_Gothic: + case icu4x::capi::Script_Grantha: + case icu4x::capi::Script_Greek: + case icu4x::capi::Script_Gujarati: + case icu4x::capi::Script_GunjalaGondi: + case icu4x::capi::Script_Gurmukhi: + case icu4x::capi::Script_Han: + case icu4x::capi::Script_Hangul: + case icu4x::capi::Script_HanifiRohingya: + case icu4x::capi::Script_Hanunoo: + case icu4x::capi::Script_Hatran: + case icu4x::capi::Script_Hebrew: + case icu4x::capi::Script_Hiragana: + case icu4x::capi::Script_ImperialAramaic: + case icu4x::capi::Script_Inherited: + case icu4x::capi::Script_InscriptionalPahlavi: + case icu4x::capi::Script_InscriptionalParthian: + case icu4x::capi::Script_Javanese: + case icu4x::capi::Script_Kaithi: + case icu4x::capi::Script_Kannada: + case icu4x::capi::Script_Katakana: + case icu4x::capi::Script_Kawi: + case icu4x::capi::Script_KayahLi: + case icu4x::capi::Script_Kharoshthi: + case icu4x::capi::Script_KhitanSmallScript: + case icu4x::capi::Script_Khmer: + case icu4x::capi::Script_Khojki: + case icu4x::capi::Script_Khudawadi: + case icu4x::capi::Script_Lao: + case icu4x::capi::Script_Latin: + case icu4x::capi::Script_Lepcha: + case icu4x::capi::Script_Limbu: + case icu4x::capi::Script_LinearA: + case icu4x::capi::Script_LinearB: + case icu4x::capi::Script_Lisu: + case icu4x::capi::Script_Lycian: + case icu4x::capi::Script_Lydian: + case icu4x::capi::Script_Mahajani: + case icu4x::capi::Script_Makasar: + case icu4x::capi::Script_Malayalam: + case icu4x::capi::Script_Mandaic: + case icu4x::capi::Script_Manichaean: + case icu4x::capi::Script_Marchen: + case icu4x::capi::Script_MasaramGondi: + case icu4x::capi::Script_Medefaidrin: + case icu4x::capi::Script_MeeteiMayek: + case icu4x::capi::Script_MendeKikakui: + case icu4x::capi::Script_MeroiticCursive: + case icu4x::capi::Script_MeroiticHieroglyphs: + case icu4x::capi::Script_Miao: + case icu4x::capi::Script_Modi: + case icu4x::capi::Script_Mongolian: + case icu4x::capi::Script_Mro: + case icu4x::capi::Script_Multani: + case icu4x::capi::Script_Myanmar: + case icu4x::capi::Script_Nabataean: + case icu4x::capi::Script_NagMundari: + case icu4x::capi::Script_Nandinagari: + case icu4x::capi::Script_Nastaliq: + case icu4x::capi::Script_NewTaiLue: + case icu4x::capi::Script_Newa: + case icu4x::capi::Script_Nko: + case icu4x::capi::Script_Nushu: + case icu4x::capi::Script_NyiakengPuachueHmong: + case icu4x::capi::Script_Ogham: + case icu4x::capi::Script_OlChiki: + case icu4x::capi::Script_OldHungarian: + case icu4x::capi::Script_OldItalic: + case icu4x::capi::Script_OldNorthArabian: + case icu4x::capi::Script_OldPermic: + case icu4x::capi::Script_OldPersian: + case icu4x::capi::Script_OldSogdian: + case icu4x::capi::Script_OldSouthArabian: + case icu4x::capi::Script_OldTurkic: + case icu4x::capi::Script_OldUyghur: + case icu4x::capi::Script_Oriya: + case icu4x::capi::Script_Osage: + case icu4x::capi::Script_Osmanya: + case icu4x::capi::Script_PahawhHmong: + case icu4x::capi::Script_Palmyrene: + case icu4x::capi::Script_PauCinHau: + case icu4x::capi::Script_PhagsPa: + case icu4x::capi::Script_Phoenician: + case icu4x::capi::Script_PsalterPahlavi: + case icu4x::capi::Script_Rejang: + case icu4x::capi::Script_Runic: + case icu4x::capi::Script_Samaritan: + case icu4x::capi::Script_Saurashtra: + case icu4x::capi::Script_Sharada: + case icu4x::capi::Script_Shavian: + case icu4x::capi::Script_Siddham: + case icu4x::capi::Script_SignWriting: + case icu4x::capi::Script_Sinhala: + case icu4x::capi::Script_Sogdian: + case icu4x::capi::Script_SoraSompeng: + case icu4x::capi::Script_Soyombo: + case icu4x::capi::Script_Sundanese: + case icu4x::capi::Script_SylotiNagri: + case icu4x::capi::Script_Syriac: + case icu4x::capi::Script_Tagalog: + case icu4x::capi::Script_Tagbanwa: + case icu4x::capi::Script_TaiLe: + case icu4x::capi::Script_TaiTham: + case icu4x::capi::Script_TaiViet: + case icu4x::capi::Script_Takri: + case icu4x::capi::Script_Tamil: + case icu4x::capi::Script_Tangsa: + case icu4x::capi::Script_Tangut: + case icu4x::capi::Script_Telugu: + case icu4x::capi::Script_Thaana: + case icu4x::capi::Script_Thai: + case icu4x::capi::Script_Tibetan: + case icu4x::capi::Script_Tifinagh: + case icu4x::capi::Script_Tirhuta: + case icu4x::capi::Script_Toto: + case icu4x::capi::Script_Ugaritic: + case icu4x::capi::Script_Unknown: + case icu4x::capi::Script_Vai: + case icu4x::capi::Script_Vithkuqi: + case icu4x::capi::Script_Wancho: + case icu4x::capi::Script_WarangCiti: + case icu4x::capi::Script_Yezidi: + case icu4x::capi::Script_Yi: + case icu4x::capi::Script_ZanabazarSquare: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint16_t icu4x::Script::to_integer() { + auto result = icu4x::capi::icu4x_Script_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::Script::from_integer(uint16_t other) { + auto result = icu4x::capi::icu4x_Script_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::Script::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_Script_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/SentenceBreak.d.hpp b/ffi/capi/bindings/cpp/icu4x/SentenceBreak.d.hpp new file mode 100644 index 00000000000..1d23290d7b4 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/SentenceBreak.d.hpp @@ -0,0 +1,80 @@ +#ifndef icu4x_SentenceBreak_D_HPP +#define icu4x_SentenceBreak_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class SentenceBreak; +} + + +namespace icu4x { +namespace capi { + enum SentenceBreak { + SentenceBreak_Other = 0, + SentenceBreak_ATerm = 1, + SentenceBreak_Close = 2, + SentenceBreak_Format = 3, + SentenceBreak_Lower = 4, + SentenceBreak_Numeric = 5, + SentenceBreak_OLetter = 6, + SentenceBreak_Sep = 7, + SentenceBreak_Sp = 8, + SentenceBreak_STerm = 9, + SentenceBreak_Upper = 10, + SentenceBreak_CR = 11, + SentenceBreak_Extend = 12, + SentenceBreak_LF = 13, + SentenceBreak_SContinue = 14, + }; + + typedef struct SentenceBreak_option {union { SentenceBreak ok; }; bool is_ok; } SentenceBreak_option; +} // namespace capi +} // namespace + +namespace icu4x { +class SentenceBreak { +public: + enum Value { + Other = 0, + ATerm = 1, + Close = 2, + Format = 3, + Lower = 4, + Numeric = 5, + OLetter = 6, + Sep = 7, + Sp = 8, + STerm = 9, + Upper = 10, + CR = 11, + Extend = 12, + LF = 13, + SContinue = 14, + }; + + SentenceBreak() = default; + // Implicit conversions between enum and ::Value + constexpr SentenceBreak(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::SentenceBreak AsFFI() const; + inline static icu4x::SentenceBreak FromFFI(icu4x::capi::SentenceBreak c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_SentenceBreak_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/SentenceBreak.hpp b/ffi/capi/bindings/cpp/icu4x/SentenceBreak.hpp new file mode 100644 index 00000000000..2b5f2ae5c63 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/SentenceBreak.hpp @@ -0,0 +1,65 @@ +#ifndef icu4x_SentenceBreak_HPP +#define icu4x_SentenceBreak_HPP + +#include "SentenceBreak.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_SentenceBreak_to_integer_mv1(icu4x::capi::SentenceBreak self); + + typedef struct icu4x_SentenceBreak_from_integer_mv1_result {union {icu4x::capi::SentenceBreak ok; }; bool is_ok;} icu4x_SentenceBreak_from_integer_mv1_result; + icu4x_SentenceBreak_from_integer_mv1_result icu4x_SentenceBreak_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::SentenceBreak icu4x::SentenceBreak::AsFFI() const { + return static_cast(value); +} + +inline icu4x::SentenceBreak icu4x::SentenceBreak::FromFFI(icu4x::capi::SentenceBreak c_enum) { + switch (c_enum) { + case icu4x::capi::SentenceBreak_Other: + case icu4x::capi::SentenceBreak_ATerm: + case icu4x::capi::SentenceBreak_Close: + case icu4x::capi::SentenceBreak_Format: + case icu4x::capi::SentenceBreak_Lower: + case icu4x::capi::SentenceBreak_Numeric: + case icu4x::capi::SentenceBreak_OLetter: + case icu4x::capi::SentenceBreak_Sep: + case icu4x::capi::SentenceBreak_Sp: + case icu4x::capi::SentenceBreak_STerm: + case icu4x::capi::SentenceBreak_Upper: + case icu4x::capi::SentenceBreak_CR: + case icu4x::capi::SentenceBreak_Extend: + case icu4x::capi::SentenceBreak_LF: + case icu4x::capi::SentenceBreak_SContinue: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::SentenceBreak::to_integer() { + auto result = icu4x::capi::icu4x_SentenceBreak_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::SentenceBreak::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_SentenceBreak_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::SentenceBreak::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_SentenceBreak_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/WordBreak.d.hpp b/ffi/capi/bindings/cpp/icu4x/WordBreak.d.hpp new file mode 100644 index 00000000000..908a556cd37 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/WordBreak.d.hpp @@ -0,0 +1,96 @@ +#ifndef icu4x_WordBreak_D_HPP +#define icu4x_WordBreak_D_HPP + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + +namespace icu4x { +class WordBreak; +} + + +namespace icu4x { +namespace capi { + enum WordBreak { + WordBreak_Other = 0, + WordBreak_ALetter = 1, + WordBreak_Format = 2, + WordBreak_Katakana = 3, + WordBreak_MidLetter = 4, + WordBreak_MidNum = 5, + WordBreak_Numeric = 6, + WordBreak_ExtendNumLet = 7, + WordBreak_CR = 8, + WordBreak_Extend = 9, + WordBreak_LF = 10, + WordBreak_MidNumLet = 11, + WordBreak_Newline = 12, + WordBreak_RegionalIndicator = 13, + WordBreak_HebrewLetter = 14, + WordBreak_SingleQuote = 15, + WordBreak_DoubleQuote = 16, + WordBreak_EBase = 17, + WordBreak_EBaseGAZ = 18, + WordBreak_EModifier = 19, + WordBreak_GlueAfterZwj = 20, + WordBreak_ZWJ = 21, + WordBreak_WSegSpace = 22, + }; + + typedef struct WordBreak_option {union { WordBreak ok; }; bool is_ok; } WordBreak_option; +} // namespace capi +} // namespace + +namespace icu4x { +class WordBreak { +public: + enum Value { + Other = 0, + ALetter = 1, + Format = 2, + Katakana = 3, + MidLetter = 4, + MidNum = 5, + Numeric = 6, + ExtendNumLet = 7, + CR = 8, + Extend = 9, + LF = 10, + MidNumLet = 11, + Newline = 12, + RegionalIndicator = 13, + HebrewLetter = 14, + SingleQuote = 15, + DoubleQuote = 16, + EBase = 17, + EBaseGAZ = 18, + EModifier = 19, + GlueAfterZwj = 20, + ZWJ = 21, + WSegSpace = 22, + }; + + WordBreak() = default; + // Implicit conversions between enum and ::Value + constexpr WordBreak(Value v) : value(v) {} + constexpr operator Value() const { return value; } + // Prevent usage as boolean value + explicit operator bool() const = delete; + + inline uint8_t to_integer(); + + inline static std::optional from_integer(uint8_t other); + + inline icu4x::capi::WordBreak AsFFI() const; + inline static icu4x::WordBreak FromFFI(icu4x::capi::WordBreak c_enum); +private: + Value value; +}; + +} // namespace +#endif // icu4x_WordBreak_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/WordBreak.hpp b/ffi/capi/bindings/cpp/icu4x/WordBreak.hpp new file mode 100644 index 00000000000..6d4bcff8e21 --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/WordBreak.hpp @@ -0,0 +1,73 @@ +#ifndef icu4x_WordBreak_HPP +#define icu4x_WordBreak_HPP + +#include "WordBreak.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + uint8_t icu4x_WordBreak_to_integer_mv1(icu4x::capi::WordBreak self); + + typedef struct icu4x_WordBreak_from_integer_mv1_result {union {icu4x::capi::WordBreak ok; }; bool is_ok;} icu4x_WordBreak_from_integer_mv1_result; + icu4x_WordBreak_from_integer_mv1_result icu4x_WordBreak_from_integer_mv1(uint8_t other); + + + } // extern "C" +} // namespace capi +} // namespace + +inline icu4x::capi::WordBreak icu4x::WordBreak::AsFFI() const { + return static_cast(value); +} + +inline icu4x::WordBreak icu4x::WordBreak::FromFFI(icu4x::capi::WordBreak c_enum) { + switch (c_enum) { + case icu4x::capi::WordBreak_Other: + case icu4x::capi::WordBreak_ALetter: + case icu4x::capi::WordBreak_Format: + case icu4x::capi::WordBreak_Katakana: + case icu4x::capi::WordBreak_MidLetter: + case icu4x::capi::WordBreak_MidNum: + case icu4x::capi::WordBreak_Numeric: + case icu4x::capi::WordBreak_ExtendNumLet: + case icu4x::capi::WordBreak_CR: + case icu4x::capi::WordBreak_Extend: + case icu4x::capi::WordBreak_LF: + case icu4x::capi::WordBreak_MidNumLet: + case icu4x::capi::WordBreak_Newline: + case icu4x::capi::WordBreak_RegionalIndicator: + case icu4x::capi::WordBreak_HebrewLetter: + case icu4x::capi::WordBreak_SingleQuote: + case icu4x::capi::WordBreak_DoubleQuote: + case icu4x::capi::WordBreak_EBase: + case icu4x::capi::WordBreak_EBaseGAZ: + case icu4x::capi::WordBreak_EModifier: + case icu4x::capi::WordBreak_GlueAfterZwj: + case icu4x::capi::WordBreak_ZWJ: + case icu4x::capi::WordBreak_WSegSpace: + return static_cast(c_enum); + default: + abort(); + } +} + +inline uint8_t icu4x::WordBreak::to_integer() { + auto result = icu4x::capi::icu4x_WordBreak_to_integer_mv1(this->AsFFI()); + return result; +} + +inline std::optional icu4x::WordBreak::from_integer(uint8_t other) { + auto result = icu4x::capi::icu4x_WordBreak_from_integer_mv1(other); + return result.is_ok ? std::optional(icu4x::WordBreak::FromFFI(result.ok)) : std::nullopt; +} +#endif // icu4x_WordBreak_HPP diff --git a/ffi/capi/bindings/dart/BidiClass.g.dart b/ffi/capi/bindings/dart/BidiClass.g.dart new file mode 100644 index 00000000000..febd4a681f0 --- /dev/null +++ b/ffi/capi/bindings/dart/BidiClass.g.dart @@ -0,0 +1,98 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `BidiClass`](https://docs.rs/icu/latest/icu/properties/props/struct.BidiClass.html) for more information. +enum BidiClass { + /// See the [Rust documentation for `LeftToRight`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.LeftToRight) for more information. + leftToRight, + + /// See the [Rust documentation for `RightToLeft`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.RightToLeft) for more information. + rightToLeft, + + /// See the [Rust documentation for `EuropeanNumber`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.EuropeanNumber) for more information. + europeanNumber, + + /// See the [Rust documentation for `EuropeanSeparator`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.EuropeanSeparator) for more information. + europeanSeparator, + + /// See the [Rust documentation for `EuropeanTerminator`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.EuropeanTerminator) for more information. + europeanTerminator, + + /// See the [Rust documentation for `ArabicNumber`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.ArabicNumber) for more information. + arabicNumber, + + /// See the [Rust documentation for `CommonSeparator`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.CommonSeparator) for more information. + commonSeparator, + + /// See the [Rust documentation for `ParagraphSeparator`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.ParagraphSeparator) for more information. + paragraphSeparator, + + /// See the [Rust documentation for `SegmentSeparator`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.SegmentSeparator) for more information. + segmentSeparator, + + /// See the [Rust documentation for `WhiteSpace`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.WhiteSpace) for more information. + whiteSpace, + + /// See the [Rust documentation for `OtherNeutral`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.OtherNeutral) for more information. + otherNeutral, + + /// See the [Rust documentation for `LeftToRightEmbedding`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.LeftToRightEmbedding) for more information. + leftToRightEmbedding, + + /// See the [Rust documentation for `LeftToRightOverride`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.LeftToRightOverride) for more information. + leftToRightOverride, + + /// See the [Rust documentation for `ArabicLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.ArabicLetter) for more information. + arabicLetter, + + /// See the [Rust documentation for `RightToLeftEmbedding`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.RightToLeftEmbedding) for more information. + rightToLeftEmbedding, + + /// See the [Rust documentation for `RightToLeftOverride`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.RightToLeftOverride) for more information. + rightToLeftOverride, + + /// See the [Rust documentation for `PopDirectionalFormat`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.PopDirectionalFormat) for more information. + popDirectionalFormat, + + /// See the [Rust documentation for `NonspacingMark`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.NonspacingMark) for more information. + nonspacingMark, + + /// See the [Rust documentation for `BoundaryNeutral`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.BoundaryNeutral) for more information. + boundaryNeutral, + + /// See the [Rust documentation for `FirstStrongIsolate`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.FirstStrongIsolate) for more information. + firstStrongIsolate, + + /// See the [Rust documentation for `LeftToRightIsolate`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.LeftToRightIsolate) for more information. + leftToRightIsolate, + + /// See the [Rust documentation for `RightToLeftIsolate`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.RightToLeftIsolate) for more information. + rightToLeftIsolate, + + /// See the [Rust documentation for `PopDirectionalIsolate`](https://docs.rs/icu/latest/icu/properties/props/enum.BidiClass.html#variant.PopDirectionalIsolate) for more information. + popDirectionalIsolate; + + int toInteger() { + final result = _icu4x_BidiClass_to_integer_mv1(index); + return result; + } + + static BidiClass? fromInteger(int other) { + final result = _icu4x_BidiClass_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return BidiClass.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_BidiClass_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_BidiClass_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_BidiClass_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_BidiClass_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/CanonicalCombiningClass.g.dart b/ffi/capi/bindings/dart/CanonicalCombiningClass.g.dart new file mode 100644 index 00000000000..50a2f99a4e2 --- /dev/null +++ b/ffi/capi/bindings/dart/CanonicalCombiningClass.g.dart @@ -0,0 +1,324 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `CanonicalCombiningClass`](https://docs.rs/icu/latest/icu/properties/props/struct.CanonicalCombiningClass.html) for more information. +enum CanonicalCombiningClass { + /// See the [Rust documentation for `NotReordered`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.NotReordered) for more information. + notReordered, + + /// See the [Rust documentation for `Overlay`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Overlay) for more information. + overlay, + + /// See the [Rust documentation for `HanReading`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.HanReading) for more information. + hanReading, + + /// See the [Rust documentation for `Nukta`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Nukta) for more information. + nukta, + + /// See the [Rust documentation for `KanaVoicing`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.KanaVoicing) for more information. + kanaVoicing, + + /// See the [Rust documentation for `Virama`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Virama) for more information. + virama, + + /// See the [Rust documentation for `CCC10`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC10) for more information. + ccc10, + + /// See the [Rust documentation for `CCC11`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC11) for more information. + ccc11, + + /// See the [Rust documentation for `CCC12`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC12) for more information. + ccc12, + + /// See the [Rust documentation for `CCC13`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC13) for more information. + ccc13, + + /// See the [Rust documentation for `CCC14`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC14) for more information. + ccc14, + + /// See the [Rust documentation for `CCC15`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC15) for more information. + ccc15, + + /// See the [Rust documentation for `CCC16`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC16) for more information. + ccc16, + + /// See the [Rust documentation for `CCC17`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC17) for more information. + ccc17, + + /// See the [Rust documentation for `CCC18`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC18) for more information. + ccc18, + + /// See the [Rust documentation for `CCC19`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC19) for more information. + ccc19, + + /// See the [Rust documentation for `CCC20`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC20) for more information. + ccc20, + + /// See the [Rust documentation for `CCC21`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC21) for more information. + ccc21, + + /// See the [Rust documentation for `CCC22`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC22) for more information. + ccc22, + + /// See the [Rust documentation for `CCC23`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC23) for more information. + ccc23, + + /// See the [Rust documentation for `CCC24`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC24) for more information. + ccc24, + + /// See the [Rust documentation for `CCC25`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC25) for more information. + ccc25, + + /// See the [Rust documentation for `CCC26`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC26) for more information. + ccc26, + + /// See the [Rust documentation for `CCC27`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC27) for more information. + ccc27, + + /// See the [Rust documentation for `CCC28`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC28) for more information. + ccc28, + + /// See the [Rust documentation for `CCC29`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC29) for more information. + ccc29, + + /// See the [Rust documentation for `CCC30`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC30) for more information. + ccc30, + + /// See the [Rust documentation for `CCC31`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC31) for more information. + ccc31, + + /// See the [Rust documentation for `CCC32`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC32) for more information. + ccc32, + + /// See the [Rust documentation for `CCC33`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC33) for more information. + ccc33, + + /// See the [Rust documentation for `CCC34`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC34) for more information. + ccc34, + + /// See the [Rust documentation for `CCC35`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC35) for more information. + ccc35, + + /// See the [Rust documentation for `CCC36`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC36) for more information. + ccc36, + + /// See the [Rust documentation for `CCC84`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC84) for more information. + ccc84, + + /// See the [Rust documentation for `CCC91`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC91) for more information. + ccc91, + + /// See the [Rust documentation for `CCC103`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC103) for more information. + ccc103, + + /// See the [Rust documentation for `CCC107`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC107) for more information. + ccc107, + + /// See the [Rust documentation for `CCC118`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC118) for more information. + ccc118, + + /// See the [Rust documentation for `CCC122`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC122) for more information. + ccc122, + + /// See the [Rust documentation for `CCC129`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC129) for more information. + ccc129, + + /// See the [Rust documentation for `CCC130`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC130) for more information. + ccc130, + + /// See the [Rust documentation for `CCC132`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC132) for more information. + ccc132, + + /// See the [Rust documentation for `CCC133`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.CCC133) for more information. + ccc133, + + /// See the [Rust documentation for `AttachedBelowLeft`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.AttachedBelowLeft) for more information. + attachedBelowLeft, + + /// See the [Rust documentation for `AttachedBelow`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.AttachedBelow) for more information. + attachedBelow, + + /// See the [Rust documentation for `AttachedAbove`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.AttachedAbove) for more information. + attachedAbove, + + /// See the [Rust documentation for `AttachedAboveRight`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.AttachedAboveRight) for more information. + attachedAboveRight, + + /// See the [Rust documentation for `BelowLeft`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.BelowLeft) for more information. + belowLeft, + + /// See the [Rust documentation for `Below`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Below) for more information. + below, + + /// See the [Rust documentation for `BelowRight`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.BelowRight) for more information. + belowRight, + + /// See the [Rust documentation for `Left`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Left) for more information. + left, + + /// See the [Rust documentation for `Right`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Right) for more information. + right, + + /// See the [Rust documentation for `AboveLeft`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.AboveLeft) for more information. + aboveLeft, + + /// See the [Rust documentation for `Above`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.Above) for more information. + above, + + /// See the [Rust documentation for `AboveRight`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.AboveRight) for more information. + aboveRight, + + /// See the [Rust documentation for `DoubleBelow`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.DoubleBelow) for more information. + doubleBelow, + + /// See the [Rust documentation for `DoubleAbove`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.DoubleAbove) for more information. + doubleAbove, + + /// See the [Rust documentation for `IotaSubscript`](https://docs.rs/icu/latest/icu/properties/props/enum.CanonicalCombiningClass.html#variant.IotaSubscript) for more information. + iotaSubscript; + + int get _ffi { + switch (this) { + case notReordered: + return 0; + case overlay: + return 1; + case hanReading: + return 6; + case nukta: + return 7; + case kanaVoicing: + return 8; + case virama: + return 9; + case ccc10: + return 10; + case ccc11: + return 11; + case ccc12: + return 12; + case ccc13: + return 13; + case ccc14: + return 14; + case ccc15: + return 15; + case ccc16: + return 16; + case ccc17: + return 17; + case ccc18: + return 18; + case ccc19: + return 19; + case ccc20: + return 20; + case ccc21: + return 21; + case ccc22: + return 22; + case ccc23: + return 23; + case ccc24: + return 24; + case ccc25: + return 25; + case ccc26: + return 26; + case ccc27: + return 27; + case ccc28: + return 28; + case ccc29: + return 29; + case ccc30: + return 30; + case ccc31: + return 31; + case ccc32: + return 32; + case ccc33: + return 33; + case ccc34: + return 34; + case ccc35: + return 35; + case ccc36: + return 36; + case ccc84: + return 84; + case ccc91: + return 91; + case ccc103: + return 103; + case ccc107: + return 107; + case ccc118: + return 118; + case ccc122: + return 122; + case ccc129: + return 129; + case ccc130: + return 130; + case ccc132: + return 132; + case ccc133: + return 133; + case attachedBelowLeft: + return 200; + case attachedBelow: + return 202; + case attachedAbove: + return 214; + case attachedAboveRight: + return 216; + case belowLeft: + return 218; + case below: + return 220; + case belowRight: + return 222; + case left: + return 224; + case right: + return 226; + case aboveLeft: + return 228; + case above: + return 230; + case aboveRight: + return 232; + case doubleBelow: + return 233; + case doubleAbove: + return 234; + case iotaSubscript: + return 240; + } + } + + int toInteger() { + final result = _icu4x_CanonicalCombiningClass_to_integer_mv1(_ffi); + return result; + } + + static CanonicalCombiningClass? fromInteger(int other) { + final result = _icu4x_CanonicalCombiningClass_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return CanonicalCombiningClass.values.firstWhere((v) => v._ffi == result.union.ok); + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClass_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_CanonicalCombiningClass_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_CanonicalCombiningClass_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_CanonicalCombiningClass_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/EastAsianWidth.g.dart b/ffi/capi/bindings/dart/EastAsianWidth.g.dart new file mode 100644 index 00000000000..1aab4cec19b --- /dev/null +++ b/ffi/capi/bindings/dart/EastAsianWidth.g.dart @@ -0,0 +1,47 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/latest/icu/properties/props/struct.EastAsianWidth.html) for more information. +enum EastAsianWidth { + /// See the [Rust documentation for `Neutral`](https://docs.rs/icu/latest/icu/properties/props/enum.EastAsianWidth.html#variant.Neutral) for more information. + neutral, + + /// See the [Rust documentation for `Ambiguous`](https://docs.rs/icu/latest/icu/properties/props/enum.EastAsianWidth.html#variant.Ambiguous) for more information. + ambiguous, + + /// See the [Rust documentation for `Halfwidth`](https://docs.rs/icu/latest/icu/properties/props/enum.EastAsianWidth.html#variant.Halfwidth) for more information. + halfwidth, + + /// See the [Rust documentation for `Fullwidth`](https://docs.rs/icu/latest/icu/properties/props/enum.EastAsianWidth.html#variant.Fullwidth) for more information. + fullwidth, + + /// See the [Rust documentation for `Narrow`](https://docs.rs/icu/latest/icu/properties/props/enum.EastAsianWidth.html#variant.Narrow) for more information. + narrow, + + /// See the [Rust documentation for `Wide`](https://docs.rs/icu/latest/icu/properties/props/enum.EastAsianWidth.html#variant.Wide) for more information. + wide; + + int toInteger() { + final result = _icu4x_EastAsianWidth_to_integer_mv1(index); + return result; + } + + static EastAsianWidth? fromInteger(int other) { + final result = _icu4x_EastAsianWidth_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return EastAsianWidth.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_EastAsianWidth_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_EastAsianWidth_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_EastAsianWidth_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_EastAsianWidth_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/GraphemeClusterBreak.g.dart b/ffi/capi/bindings/dart/GraphemeClusterBreak.g.dart new file mode 100644 index 00000000000..c3a2b6f400a --- /dev/null +++ b/ffi/capi/bindings/dart/GraphemeClusterBreak.g.dart @@ -0,0 +1,83 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.GraphemeClusterBreak.html) for more information. +enum GraphemeClusterBreak { + /// See the [Rust documentation for `Other`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.Other) for more information. + other, + + /// See the [Rust documentation for `Control`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.Control) for more information. + control, + + /// See the [Rust documentation for `CR`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.CR) for more information. + cr, + + /// See the [Rust documentation for `Extend`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.Extend) for more information. + extend, + + /// See the [Rust documentation for `L`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.L) for more information. + l, + + /// See the [Rust documentation for `LF`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.LF) for more information. + lf, + + /// See the [Rust documentation for `LV`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.LV) for more information. + lv, + + /// See the [Rust documentation for `LVT`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.LVT) for more information. + lvt, + + /// See the [Rust documentation for `T`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.T) for more information. + t, + + /// See the [Rust documentation for `V`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.V) for more information. + v, + + /// See the [Rust documentation for `SpacingMark`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.SpacingMark) for more information. + spacingMark, + + /// See the [Rust documentation for `Prepend`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.Prepend) for more information. + prepend, + + /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.RegionalIndicator) for more information. + regionalIndicator, + + /// See the [Rust documentation for `EBase`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.EBase) for more information. + eBase, + + /// See the [Rust documentation for `EBaseGAZ`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.EBaseGAZ) for more information. + eBaseGaz, + + /// See the [Rust documentation for `EModifier`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.EModifier) for more information. + eModifier, + + /// See the [Rust documentation for `GlueAfterZwj`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.GlueAfterZwj) for more information. + glueAfterZwj, + + /// See the [Rust documentation for `ZWJ`](https://docs.rs/icu/latest/icu/properties/props/enum.LineBreak.html#variant.ZWJ) for more information. + zwj; + + int toInteger() { + final result = _icu4x_GraphemeClusterBreak_to_integer_mv1(index); + return result; + } + + static GraphemeClusterBreak? fromInteger(int other) { + final result = _icu4x_GraphemeClusterBreak_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return GraphemeClusterBreak.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreak_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_GraphemeClusterBreak_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_GraphemeClusterBreak_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_GraphemeClusterBreak_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/HangulSyllableType.g.dart b/ffi/capi/bindings/dart/HangulSyllableType.g.dart new file mode 100644 index 00000000000..fdadad09905 --- /dev/null +++ b/ffi/capi/bindings/dart/HangulSyllableType.g.dart @@ -0,0 +1,47 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/latest/icu/properties/props/struct.HangulSyllableType.html) for more information. +enum HangulSyllableType { + /// See the [Rust documentation for `NotApplicable`](https://docs.rs/icu/latest/icu/properties/props/enum.HangulSyllableType.html#variant.NotApplicable) for more information. + notApplicable, + + /// See the [Rust documentation for `LeadingJamo`](https://docs.rs/icu/latest/icu/properties/props/enum.HangulSyllableType.html#variant.LeadingJamo) for more information. + leadingJamo, + + /// See the [Rust documentation for `VowelJamo`](https://docs.rs/icu/latest/icu/properties/props/enum.HangulSyllableType.html#variant.VowelJamo) for more information. + vowelJamo, + + /// See the [Rust documentation for `TrailingJamo`](https://docs.rs/icu/latest/icu/properties/props/enum.HangulSyllableType.html#variant.TrailingJamo) for more information. + trailingJamo, + + /// See the [Rust documentation for `LeadingVowelSyllable`](https://docs.rs/icu/latest/icu/properties/props/enum.HangulSyllableType.html#variant.LeadingVowelSyllable) for more information. + leadingVowelSyllable, + + /// See the [Rust documentation for `LeadingVowelTrailingSyllable`](https://docs.rs/icu/latest/icu/properties/props/enum.HangulSyllableType.html#variant.LeadingVowelTrailingSyllable) for more information. + leadingVowelTrailingSyllable; + + int toInteger() { + final result = _icu4x_HangulSyllableType_to_integer_mv1(index); + return result; + } + + static HangulSyllableType? fromInteger(int other) { + final result = _icu4x_HangulSyllableType_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return HangulSyllableType.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_HangulSyllableType_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_HangulSyllableType_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_HangulSyllableType_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_HangulSyllableType_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/IndicSyllabicCategory.g.dart b/ffi/capi/bindings/dart/IndicSyllabicCategory.g.dart new file mode 100644 index 00000000000..e3fca509cee --- /dev/null +++ b/ffi/capi/bindings/dart/IndicSyllabicCategory.g.dart @@ -0,0 +1,140 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/latest/icu/properties/props/struct.IndicSyllabicCategory.html) for more information. +enum IndicSyllabicCategory { + /// See the [Rust documentation for `Other`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Other) for more information. + other, + + /// See the [Rust documentation for `Avagraha`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Avagraha) for more information. + avagraha, + + /// See the [Rust documentation for `Bindu`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Bindu) for more information. + bindu, + + /// See the [Rust documentation for `BrahmiJoiningNumber`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.BrahmiJoiningNumber) for more information. + brahmiJoiningNumber, + + /// See the [Rust documentation for `CantillationMark`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.CantillationMark) for more information. + cantillationMark, + + /// See the [Rust documentation for `Consonant`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Consonant) for more information. + consonant, + + /// See the [Rust documentation for `ConsonantDead`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantDead) for more information. + consonantDead, + + /// See the [Rust documentation for `ConsonantFinal`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantFinal) for more information. + consonantFinal, + + /// See the [Rust documentation for `ConsonantHeadLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantHeadLetter) for more information. + consonantHeadLetter, + + /// See the [Rust documentation for `ConsonantInitialPostfixed`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantInitialPostfixed) for more information. + consonantInitialPostfixed, + + /// See the [Rust documentation for `ConsonantKiller`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantKiller) for more information. + consonantKiller, + + /// See the [Rust documentation for `ConsonantMedial`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantMedial) for more information. + consonantMedial, + + /// See the [Rust documentation for `ConsonantPlaceholder`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantPlaceholder) for more information. + consonantPlaceholder, + + /// See the [Rust documentation for `ConsonantPrecedingRepha`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantPrecedingRepha) for more information. + consonantPrecedingRepha, + + /// See the [Rust documentation for `ConsonantPrefixed`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantPrefixed) for more information. + consonantPrefixed, + + /// See the [Rust documentation for `ConsonantSucceedingRepha`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantSucceedingRepha) for more information. + consonantSucceedingRepha, + + /// See the [Rust documentation for `ConsonantSubjoined`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantSubjoined) for more information. + consonantSubjoined, + + /// See the [Rust documentation for `ConsonantWithStacker`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ConsonantWithStacker) for more information. + consonantWithStacker, + + /// See the [Rust documentation for `GeminationMark`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.GeminationMark) for more information. + geminationMark, + + /// See the [Rust documentation for `InvisibleStacker`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.InvisibleStacker) for more information. + invisibleStacker, + + /// See the [Rust documentation for `Joiner`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Joiner) for more information. + joiner, + + /// See the [Rust documentation for `ModifyingLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ModifyingLetter) for more information. + modifyingLetter, + + /// See the [Rust documentation for `NonJoiner`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.NonJoiner) for more information. + nonJoiner, + + /// See the [Rust documentation for `Nukta`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Nukta) for more information. + nukta, + + /// See the [Rust documentation for `Number`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Number) for more information. + number, + + /// See the [Rust documentation for `NumberJoiner`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.NumberJoiner) for more information. + numberJoiner, + + /// See the [Rust documentation for `PureKiller`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.PureKiller) for more information. + pureKiller, + + /// See the [Rust documentation for `RegisterShifter`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.RegisterShifter) for more information. + registerShifter, + + /// See the [Rust documentation for `SyllableModifier`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.SyllableModifier) for more information. + syllableModifier, + + /// See the [Rust documentation for `ToneLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ToneLetter) for more information. + toneLetter, + + /// See the [Rust documentation for `ToneMark`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ToneMark) for more information. + toneMark, + + /// See the [Rust documentation for `Virama`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Virama) for more information. + virama, + + /// See the [Rust documentation for `Visarga`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Visarga) for more information. + visarga, + + /// See the [Rust documentation for `Vowel`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.Vowel) for more information. + vowel, + + /// See the [Rust documentation for `VowelDependent`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.VowelDependent) for more information. + vowelDependent, + + /// See the [Rust documentation for `VowelIndependent`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.VowelIndependent) for more information. + vowelIndependent, + + /// See the [Rust documentation for `ReorderingKiller`](https://docs.rs/icu/latest/icu/properties/props/enum.IndicSyllabicCategory.html#variant.ReorderingKiller) for more information. + reorderingKiller; + + int toInteger() { + final result = _icu4x_IndicSyllabicCategory_to_integer_mv1(index); + return result; + } + + static IndicSyllabicCategory? fromInteger(int other) { + final result = _icu4x_IndicSyllabicCategory_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return IndicSyllabicCategory.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_IndicSyllabicCategory_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_IndicSyllabicCategory_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_IndicSyllabicCategory_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_IndicSyllabicCategory_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/JoiningType.g.dart b/ffi/capi/bindings/dart/JoiningType.g.dart new file mode 100644 index 00000000000..4696fab53ca --- /dev/null +++ b/ffi/capi/bindings/dart/JoiningType.g.dart @@ -0,0 +1,47 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `JoiningType`](https://docs.rs/icu/latest/icu/properties/props/struct.JoiningType.html) for more information. +enum JoiningType { + /// See the [Rust documentation for `NonJoining`](https://docs.rs/icu/latest/icu/properties/props/enum.JoiningType.html#variant.NonJoining) for more information. + nonJoining, + + /// See the [Rust documentation for `JoinCausing`](https://docs.rs/icu/latest/icu/properties/props/enum.JoiningType.html#variant.JoinCausing) for more information. + joinCausing, + + /// See the [Rust documentation for `DualJoining`](https://docs.rs/icu/latest/icu/properties/props/enum.JoiningType.html#variant.DualJoining) for more information. + dualJoining, + + /// See the [Rust documentation for `LeftJoining`](https://docs.rs/icu/latest/icu/properties/props/enum.JoiningType.html#variant.LeftJoining) for more information. + leftJoining, + + /// See the [Rust documentation for `RightJoining`](https://docs.rs/icu/latest/icu/properties/props/enum.JoiningType.html#variant.RightJoining) for more information. + rightJoining, + + /// See the [Rust documentation for `Transparent`](https://docs.rs/icu/latest/icu/properties/props/enum.JoiningType.html#variant.Transparent) for more information. + transparent; + + int toInteger() { + final result = _icu4x_JoiningType_to_integer_mv1(index); + return result; + } + + static JoiningType? fromInteger(int other) { + final result = _icu4x_JoiningType_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return JoiningType.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_JoiningType_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_JoiningType_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_JoiningType_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_JoiningType_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/LineBreak.g.dart b/ffi/capi/bindings/dart/LineBreak.g.dart new file mode 100644 index 00000000000..f440b443ace --- /dev/null +++ b/ffi/capi/bindings/dart/LineBreak.g.dart @@ -0,0 +1,173 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `LineBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.LineBreak.html) for more information. +enum LineBreak { + /// See the [Rust documentation for `Unknown`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Unknown) for more information. + unknown, + + /// See the [Rust documentation for `Ambiguous`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Ambiguous) for more information. + ambiguous, + + /// See the [Rust documentation for `Alphabetic`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Alphabetic) for more information. + alphabetic, + + /// See the [Rust documentation for `BreakBoth`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.BreakBoth) for more information. + breakBoth, + + /// See the [Rust documentation for `BreakAfter`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.BreakAfter) for more information. + breakAfter, + + /// See the [Rust documentation for `BreakBefore`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.BreakBefore) for more information. + breakBefore, + + /// See the [Rust documentation for `MandatoryBreak`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.MandatoryBreak) for more information. + mandatoryBreak, + + /// See the [Rust documentation for `ContingentBreak`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ContingentBreak) for more information. + contingentBreak, + + /// See the [Rust documentation for `ClosePunctuation`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ClosePunctuation) for more information. + closePunctuation, + + /// See the [Rust documentation for `CombiningMark`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.CombiningMark) for more information. + combiningMark, + + /// See the [Rust documentation for `CarriageReturn`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.CarriageReturn) for more information. + carriageReturn, + + /// See the [Rust documentation for `Exclamation`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Exclamation) for more information. + exclamation, + + /// See the [Rust documentation for `Glue`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Glue) for more information. + glue, + + /// See the [Rust documentation for `Hyphen`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Hyphen) for more information. + hyphen, + + /// See the [Rust documentation for `Ideographic`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Ideographic) for more information. + ideographic, + + /// See the [Rust documentation for `Inseparable`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Inseparable) for more information. + inseparable, + + /// See the [Rust documentation for `InfixNumeric`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.InfixNumeric) for more information. + infixNumeric, + + /// See the [Rust documentation for `LineFeed`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.LineFeed) for more information. + lineFeed, + + /// See the [Rust documentation for `Nonstarter`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Nonstarter) for more information. + nonstarter, + + /// See the [Rust documentation for `Numeric`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Numeric) for more information. + numeric, + + /// See the [Rust documentation for `OpenPunctuation`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.OpenPunctuation) for more information. + openPunctuation, + + /// See the [Rust documentation for `PostfixNumeric`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.PostfixNumeric) for more information. + postfixNumeric, + + /// See the [Rust documentation for `PrefixNumeric`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.PrefixNumeric) for more information. + prefixNumeric, + + /// See the [Rust documentation for `Quotation`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Quotation) for more information. + quotation, + + /// See the [Rust documentation for `ComplexContext`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ComplexContext) for more information. + complexContext, + + /// See the [Rust documentation for `Surrogate`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Surrogate) for more information. + surrogate, + + /// See the [Rust documentation for `Space`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Space) for more information. + space, + + /// See the [Rust documentation for `BreakSymbols`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.BreakSymbols) for more information. + breakSymbols, + + /// See the [Rust documentation for `ZWSpace`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ZWSpace) for more information. + zwSpace, + + /// See the [Rust documentation for `NextLine`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.NextLine) for more information. + nextLine, + + /// See the [Rust documentation for `WordJoiner`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.WordJoiner) for more information. + wordJoiner, + + /// See the [Rust documentation for `H2`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.H2) for more information. + h2, + + /// See the [Rust documentation for `H3`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.H3) for more information. + h3, + + /// See the [Rust documentation for `JL`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.JL) for more information. + jl, + + /// See the [Rust documentation for `JT`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.JT) for more information. + jt, + + /// See the [Rust documentation for `JV`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.JV) for more information. + jv, + + /// See the [Rust documentation for `CloseParenthesis`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.CloseParenthesis) for more information. + closeParenthesis, + + /// See the [Rust documentation for `ConditionalJapaneseStarter`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ConditionalJapaneseStarter) for more information. + conditionalJapaneseStarter, + + /// See the [Rust documentation for `HebrewLetter`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.HebrewLetter) for more information. + hebrewLetter, + + /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.RegionalIndicator) for more information. + regionalIndicator, + + /// See the [Rust documentation for `EBase`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.EBase) for more information. + eBase, + + /// See the [Rust documentation for `EModifier`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.EModifier) for more information. + eModifier, + + /// See the [Rust documentation for `ZWJ`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ZWJ) for more information. + zwj, + + /// See the [Rust documentation for `Aksara`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Aksara) for more information. + aksara, + + /// See the [Rust documentation for `AksaraPrebase`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.AksaraPrebase) for more information. + aksaraPrebase, + + /// See the [Rust documentation for `AksaraStart`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.AksaraStart) for more information. + aksaraStart, + + /// See the [Rust documentation for `ViramaFinal`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.ViramaFinal) for more information. + viramaFinal, + + /// See the [Rust documentation for `Virama`](https://docs.rs/icu/latest/icu/props/enum.LineBreak.html#variant.Virama) for more information. + virama; + + int toInteger() { + final result = _icu4x_LineBreak_to_integer_mv1(index); + return result; + } + + static LineBreak? fromInteger(int other) { + final result = _icu4x_LineBreak_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return LineBreak.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_LineBreak_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_LineBreak_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_LineBreak_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_LineBreak_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/Script.g.dart b/ffi/capi/bindings/dart/Script.g.dart new file mode 100644 index 00000000000..4c99939f16a --- /dev/null +++ b/ffi/capi/bindings/dart/Script.g.dart @@ -0,0 +1,859 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `Script`](https://docs.rs/icu/latest/icu/properties/props/struct.Script.html) for more information. +enum Script { + /// See the [Rust documentation for `Adlam`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Adlam) for more information. + adlam, + + /// See the [Rust documentation for `Ahom`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Ahom) for more information. + ahom, + + /// See the [Rust documentation for `AnatolianHieroglyphs`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.AnatolianHieroglyphs) for more information. + anatolianHieroglyphs, + + /// See the [Rust documentation for `Arabic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Arabic) for more information. + arabic, + + /// See the [Rust documentation for `Armenian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Armenian) for more information. + armenian, + + /// See the [Rust documentation for `Avestan`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Avestan) for more information. + avestan, + + /// See the [Rust documentation for `Balinese`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Balinese) for more information. + balinese, + + /// See the [Rust documentation for `Bamum`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Bamum) for more information. + bamum, + + /// See the [Rust documentation for `BassaVah`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.BassaVah) for more information. + bassaVah, + + /// See the [Rust documentation for `Batak`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Batak) for more information. + batak, + + /// See the [Rust documentation for `Bengali`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Bengali) for more information. + bengali, + + /// See the [Rust documentation for `Bhaiksuki`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Bhaiksuki) for more information. + bhaiksuki, + + /// See the [Rust documentation for `Bopomofo`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Bopomofo) for more information. + bopomofo, + + /// See the [Rust documentation for `Brahmi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Brahmi) for more information. + brahmi, + + /// See the [Rust documentation for `Braille`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Braille) for more information. + braille, + + /// See the [Rust documentation for `Buginese`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Buginese) for more information. + buginese, + + /// See the [Rust documentation for `Buhid`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Buhid) for more information. + buhid, + + /// See the [Rust documentation for `CanadianAboriginal`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.CanadianAboriginal) for more information. + canadianAboriginal, + + /// See the [Rust documentation for `Carian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Carian) for more information. + carian, + + /// See the [Rust documentation for `CaucasianAlbanian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.CaucasianAlbanian) for more information. + caucasianAlbanian, + + /// See the [Rust documentation for `Chakma`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Chakma) for more information. + chakma, + + /// See the [Rust documentation for `Cham`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Cham) for more information. + cham, + + /// See the [Rust documentation for `Cherokee`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Cherokee) for more information. + cherokee, + + /// See the [Rust documentation for `Chorasmian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Chorasmian) for more information. + chorasmian, + + /// See the [Rust documentation for `Common`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Common) for more information. + common, + + /// See the [Rust documentation for `Coptic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Coptic) for more information. + coptic, + + /// See the [Rust documentation for `Cuneiform`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Cuneiform) for more information. + cuneiform, + + /// See the [Rust documentation for `Cypriot`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Cypriot) for more information. + cypriot, + + /// See the [Rust documentation for `CyproMinoan`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.CyproMinoan) for more information. + cyproMinoan, + + /// See the [Rust documentation for `Cyrillic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Cyrillic) for more information. + cyrillic, + + /// See the [Rust documentation for `Deseret`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Deseret) for more information. + deseret, + + /// See the [Rust documentation for `Devanagari`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Devanagari) for more information. + devanagari, + + /// See the [Rust documentation for `DivesAkuru`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.DivesAkuru) for more information. + divesAkuru, + + /// See the [Rust documentation for `Dogra`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Dogra) for more information. + dogra, + + /// See the [Rust documentation for `Duployan`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Duployan) for more information. + duployan, + + /// See the [Rust documentation for `EgyptianHieroglyphs`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.EgyptianHieroglyphs) for more information. + egyptianHieroglyphs, + + /// See the [Rust documentation for `Elbasan`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Elbasan) for more information. + elbasan, + + /// See the [Rust documentation for `Elymaic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Elymaic) for more information. + elymaic, + + /// See the [Rust documentation for `Ethiopian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Ethiopian) for more information. + ethiopian, + + /// See the [Rust documentation for `Georgian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Georgian) for more information. + georgian, + + /// See the [Rust documentation for `Glagolitic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Glagolitic) for more information. + glagolitic, + + /// See the [Rust documentation for `Gothic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Gothic) for more information. + gothic, + + /// See the [Rust documentation for `Grantha`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Grantha) for more information. + grantha, + + /// See the [Rust documentation for `Greek`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Greek) for more information. + greek, + + /// See the [Rust documentation for `Gujarati`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Gujarati) for more information. + gujarati, + + /// See the [Rust documentation for `GunjalaGondi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.GunjalaGondi) for more information. + gunjalaGondi, + + /// See the [Rust documentation for `Gurmukhi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Gurmukhi) for more information. + gurmukhi, + + /// See the [Rust documentation for `Han`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Han) for more information. + han, + + /// See the [Rust documentation for `Hangul`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Hangul) for more information. + hangul, + + /// See the [Rust documentation for `HanifiRohingya`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.HanifiRohingya) for more information. + hanifiRohingya, + + /// See the [Rust documentation for `Hanunoo`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Hanunoo) for more information. + hanunoo, + + /// See the [Rust documentation for `Hatran`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Hatran) for more information. + hatran, + + /// See the [Rust documentation for `Hebrew`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Hebrew) for more information. + hebrew, + + /// See the [Rust documentation for `Hiragana`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Hiragana) for more information. + hiragana, + + /// See the [Rust documentation for `ImperialAramaic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.ImperialAramaic) for more information. + imperialAramaic, + + /// See the [Rust documentation for `Inherited`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Inherited) for more information. + inherited, + + /// See the [Rust documentation for `InscriptionalPahlavi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.InscriptionalPahlavi) for more information. + inscriptionalPahlavi, + + /// See the [Rust documentation for `InscriptionalParthian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.InscriptionalParthian) for more information. + inscriptionalParthian, + + /// See the [Rust documentation for `Javanese`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Javanese) for more information. + javanese, + + /// See the [Rust documentation for `Kaithi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Kaithi) for more information. + kaithi, + + /// See the [Rust documentation for `Kannada`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Kannada) for more information. + kannada, + + /// See the [Rust documentation for `Katakana`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Katakana) for more information. + katakana, + + /// See the [Rust documentation for `Kawi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Kawi) for more information. + kawi, + + /// See the [Rust documentation for `KayahLi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.KayahLi) for more information. + kayahLi, + + /// See the [Rust documentation for `Kharoshthi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Kharoshthi) for more information. + kharoshthi, + + /// See the [Rust documentation for `KhitanSmallScript`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.KhitanSmallScript) for more information. + khitanSmallScript, + + /// See the [Rust documentation for `Khmer`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Khmer) for more information. + khmer, + + /// See the [Rust documentation for `Khojki`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Khojki) for more information. + khojki, + + /// See the [Rust documentation for `Khudawadi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Khudawadi) for more information. + khudawadi, + + /// See the [Rust documentation for `Lao`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Lao) for more information. + lao, + + /// See the [Rust documentation for `Latin`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Latin) for more information. + latin, + + /// See the [Rust documentation for `Lepcha`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Lepcha) for more information. + lepcha, + + /// See the [Rust documentation for `Limbu`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Limbu) for more information. + limbu, + + /// See the [Rust documentation for `LinearA`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.LinearA) for more information. + linearA, + + /// See the [Rust documentation for `LinearB`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.LinearB) for more information. + linearB, + + /// See the [Rust documentation for `Lisu`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Lisu) for more information. + lisu, + + /// See the [Rust documentation for `Lycian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Lycian) for more information. + lycian, + + /// See the [Rust documentation for `Lydian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Lydian) for more information. + lydian, + + /// See the [Rust documentation for `Mahajani`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Mahajani) for more information. + mahajani, + + /// See the [Rust documentation for `Makasar`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Makasar) for more information. + makasar, + + /// See the [Rust documentation for `Malayalam`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Malayalam) for more information. + malayalam, + + /// See the [Rust documentation for `Mandaic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Mandaic) for more information. + mandaic, + + /// See the [Rust documentation for `Manichaean`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Manichaean) for more information. + manichaean, + + /// See the [Rust documentation for `Marchen`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Marchen) for more information. + marchen, + + /// See the [Rust documentation for `MasaramGondi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.MasaramGondi) for more information. + masaramGondi, + + /// See the [Rust documentation for `Medefaidrin`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Medefaidrin) for more information. + medefaidrin, + + /// See the [Rust documentation for `MeeteiMayek`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.MeeteiMayek) for more information. + meeteiMayek, + + /// See the [Rust documentation for `MendeKikakui`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.MendeKikakui) for more information. + mendeKikakui, + + /// See the [Rust documentation for `MeroiticCursive`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.MeroiticCursive) for more information. + meroiticCursive, + + /// See the [Rust documentation for `MeroiticHieroglyphs`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.MeroiticHieroglyphs) for more information. + meroiticHieroglyphs, + + /// See the [Rust documentation for `Miao`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Miao) for more information. + miao, + + /// See the [Rust documentation for `Modi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Modi) for more information. + modi, + + /// See the [Rust documentation for `Mongolian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Mongolian) for more information. + mongolian, + + /// See the [Rust documentation for `Mro`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Mro) for more information. + mro, + + /// See the [Rust documentation for `Multani`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Multani) for more information. + multani, + + /// See the [Rust documentation for `Myanmar`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Myanmar) for more information. + myanmar, + + /// See the [Rust documentation for `Nabataean`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Nabataean) for more information. + nabataean, + + /// See the [Rust documentation for `NagMundari`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.NagMundari) for more information. + nagMundari, + + /// See the [Rust documentation for `Nandinagari`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Nandinagari) for more information. + nandinagari, + + /// See the [Rust documentation for `Nastaliq`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Nastaliq) for more information. + nastaliq, + + /// See the [Rust documentation for `NewTaiLue`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.NewTaiLue) for more information. + newTaiLue, + + /// See the [Rust documentation for `Newa`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Newa) for more information. + newa, + + /// See the [Rust documentation for `Nko`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Nko) for more information. + nko, + + /// See the [Rust documentation for `Nushu`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Nushu) for more information. + nushu, + + /// See the [Rust documentation for `NyiakengPuachueHmong`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.NyiakengPuachueHmong) for more information. + nyiakengPuachueHmong, + + /// See the [Rust documentation for `Ogham`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Ogham) for more information. + ogham, + + /// See the [Rust documentation for `OlChiki`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OlChiki) for more information. + olChiki, + + /// See the [Rust documentation for `OldHungarian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldHungarian) for more information. + oldHungarian, + + /// See the [Rust documentation for `OldItalic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldItalic) for more information. + oldItalic, + + /// See the [Rust documentation for `OldNorthArabian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldNorthArabian) for more information. + oldNorthArabian, + + /// See the [Rust documentation for `OldPermic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldPermic) for more information. + oldPermic, + + /// See the [Rust documentation for `OldPersian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldPersian) for more information. + oldPersian, + + /// See the [Rust documentation for `OldSogdian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldSogdian) for more information. + oldSogdian, + + /// See the [Rust documentation for `OldSouthArabian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldSouthArabian) for more information. + oldSouthArabian, + + /// See the [Rust documentation for `OldTurkic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldTurkic) for more information. + oldTurkic, + + /// See the [Rust documentation for `OldUyghur`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.OldUyghur) for more information. + oldUyghur, + + /// See the [Rust documentation for `Oriya`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Oriya) for more information. + oriya, + + /// See the [Rust documentation for `Osage`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Osage) for more information. + osage, + + /// See the [Rust documentation for `Osmanya`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Osmanya) for more information. + osmanya, + + /// See the [Rust documentation for `PahawhHmong`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.PahawhHmong) for more information. + pahawhHmong, + + /// See the [Rust documentation for `Palmyrene`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Palmyrene) for more information. + palmyrene, + + /// See the [Rust documentation for `PauCinHau`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.PauCinHau) for more information. + pauCinHau, + + /// See the [Rust documentation for `PhagsPa`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.PhagsPa) for more information. + phagsPa, + + /// See the [Rust documentation for `Phoenician`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Phoenician) for more information. + phoenician, + + /// See the [Rust documentation for `PsalterPahlavi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.PsalterPahlavi) for more information. + psalterPahlavi, + + /// See the [Rust documentation for `Rejang`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Rejang) for more information. + rejang, + + /// See the [Rust documentation for `Runic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Runic) for more information. + runic, + + /// See the [Rust documentation for `Samaritan`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Samaritan) for more information. + samaritan, + + /// See the [Rust documentation for `Saurashtra`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Saurashtra) for more information. + saurashtra, + + /// See the [Rust documentation for `Sharada`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Sharada) for more information. + sharada, + + /// See the [Rust documentation for `Shavian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Shavian) for more information. + shavian, + + /// See the [Rust documentation for `Siddham`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Siddham) for more information. + siddham, + + /// See the [Rust documentation for `SignWriting`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.SignWriting) for more information. + signWriting, + + /// See the [Rust documentation for `Sinhala`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Sinhala) for more information. + sinhala, + + /// See the [Rust documentation for `Sogdian`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Sogdian) for more information. + sogdian, + + /// See the [Rust documentation for `SoraSompeng`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.SoraSompeng) for more information. + soraSompeng, + + /// See the [Rust documentation for `Soyombo`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Soyombo) for more information. + soyombo, + + /// See the [Rust documentation for `Sundanese`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Sundanese) for more information. + sundanese, + + /// See the [Rust documentation for `SylotiNagri`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.SylotiNagri) for more information. + sylotiNagri, + + /// See the [Rust documentation for `Syriac`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Syriac) for more information. + syriac, + + /// See the [Rust documentation for `Tagalog`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tagalog) for more information. + tagalog, + + /// See the [Rust documentation for `Tagbanwa`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tagbanwa) for more information. + tagbanwa, + + /// See the [Rust documentation for `TaiLe`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.TaiLe) for more information. + taiLe, + + /// See the [Rust documentation for `TaiTham`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.TaiTham) for more information. + taiTham, + + /// See the [Rust documentation for `TaiViet`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.TaiViet) for more information. + taiViet, + + /// See the [Rust documentation for `Takri`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Takri) for more information. + takri, + + /// See the [Rust documentation for `Tamil`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tamil) for more information. + tamil, + + /// See the [Rust documentation for `Tangsa`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tangsa) for more information. + tangsa, + + /// See the [Rust documentation for `Tangut`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tangut) for more information. + tangut, + + /// See the [Rust documentation for `Telugu`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Telugu) for more information. + telugu, + + /// See the [Rust documentation for `Thaana`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Thaana) for more information. + thaana, + + /// See the [Rust documentation for `Thai`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Thai) for more information. + thai, + + /// See the [Rust documentation for `Tibetan`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tibetan) for more information. + tibetan, + + /// See the [Rust documentation for `Tifinagh`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tifinagh) for more information. + tifinagh, + + /// See the [Rust documentation for `Tirhuta`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Tirhuta) for more information. + tirhuta, + + /// See the [Rust documentation for `Toto`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Toto) for more information. + toto, + + /// See the [Rust documentation for `Ugaritic`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Ugaritic) for more information. + ugaritic, + + /// See the [Rust documentation for `Unknown`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Unknown) for more information. + unknown, + + /// See the [Rust documentation for `Vai`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Vai) for more information. + vai, + + /// See the [Rust documentation for `Vithkuqi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Vithkuqi) for more information. + vithkuqi, + + /// See the [Rust documentation for `Wancho`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Wancho) for more information. + wancho, + + /// See the [Rust documentation for `WarangCiti`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.WarangCiti) for more information. + warangCiti, + + /// See the [Rust documentation for `Yezidi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Yezidi) for more information. + yezidi, + + /// See the [Rust documentation for `Yi`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.Yi) for more information. + yi, + + /// See the [Rust documentation for `ZanabazarSquare`](https://docs.rs/icu/latest/icu/properties/props/enum.Script.html#variant.ZanabazarSquare) for more information. + zanabazarSquare; + + int get _ffi { + switch (this) { + case adlam: + return 167; + case ahom: + return 161; + case anatolianHieroglyphs: + return 156; + case arabic: + return 2; + case armenian: + return 3; + case avestan: + return 117; + case balinese: + return 62; + case bamum: + return 130; + case bassaVah: + return 134; + case batak: + return 63; + case bengali: + return 4; + case bhaiksuki: + return 168; + case bopomofo: + return 5; + case brahmi: + return 65; + case braille: + return 46; + case buginese: + return 55; + case buhid: + return 44; + case canadianAboriginal: + return 40; + case carian: + return 104; + case caucasianAlbanian: + return 159; + case chakma: + return 118; + case cham: + return 66; + case cherokee: + return 6; + case chorasmian: + return 189; + case common: + return 0; + case coptic: + return 7; + case cuneiform: + return 101; + case cypriot: + return 47; + case cyproMinoan: + return 193; + case cyrillic: + return 8; + case deseret: + return 9; + case devanagari: + return 10; + case divesAkuru: + return 190; + case dogra: + return 178; + case duployan: + return 135; + case egyptianHieroglyphs: + return 71; + case elbasan: + return 136; + case elymaic: + return 185; + case ethiopian: + return 11; + case georgian: + return 12; + case glagolitic: + return 56; + case gothic: + return 13; + case grantha: + return 137; + case greek: + return 14; + case gujarati: + return 15; + case gunjalaGondi: + return 179; + case gurmukhi: + return 16; + case han: + return 17; + case hangul: + return 18; + case hanifiRohingya: + return 182; + case hanunoo: + return 43; + case hatran: + return 162; + case hebrew: + return 19; + case hiragana: + return 20; + case imperialAramaic: + return 116; + case inherited: + return 1; + case inscriptionalPahlavi: + return 122; + case inscriptionalParthian: + return 125; + case javanese: + return 78; + case kaithi: + return 120; + case kannada: + return 21; + case katakana: + return 22; + case kawi: + return 198; + case kayahLi: + return 79; + case kharoshthi: + return 57; + case khitanSmallScript: + return 191; + case khmer: + return 23; + case khojki: + return 157; + case khudawadi: + return 145; + case lao: + return 24; + case latin: + return 25; + case lepcha: + return 82; + case limbu: + return 48; + case linearA: + return 83; + case linearB: + return 49; + case lisu: + return 131; + case lycian: + return 107; + case lydian: + return 108; + case mahajani: + return 160; + case makasar: + return 180; + case malayalam: + return 26; + case mandaic: + return 84; + case manichaean: + return 121; + case marchen: + return 169; + case masaramGondi: + return 175; + case medefaidrin: + return 181; + case meeteiMayek: + return 115; + case mendeKikakui: + return 140; + case meroiticCursive: + return 141; + case meroiticHieroglyphs: + return 86; + case miao: + return 92; + case modi: + return 163; + case mongolian: + return 27; + case mro: + return 149; + case multani: + return 164; + case myanmar: + return 28; + case nabataean: + return 143; + case nagMundari: + return 199; + case nandinagari: + return 187; + case nastaliq: + return 200; + case newTaiLue: + return 59; + case newa: + return 170; + case nko: + return 87; + case nushu: + return 150; + case nyiakengPuachueHmong: + return 186; + case ogham: + return 29; + case olChiki: + return 109; + case oldHungarian: + return 76; + case oldItalic: + return 30; + case oldNorthArabian: + return 142; + case oldPermic: + return 89; + case oldPersian: + return 61; + case oldSogdian: + return 184; + case oldSouthArabian: + return 133; + case oldTurkic: + return 88; + case oldUyghur: + return 194; + case oriya: + return 31; + case osage: + return 171; + case osmanya: + return 50; + case pahawhHmong: + return 75; + case palmyrene: + return 144; + case pauCinHau: + return 165; + case phagsPa: + return 90; + case phoenician: + return 91; + case psalterPahlavi: + return 123; + case rejang: + return 110; + case runic: + return 32; + case samaritan: + return 126; + case saurashtra: + return 111; + case sharada: + return 151; + case shavian: + return 51; + case siddham: + return 166; + case signWriting: + return 112; + case sinhala: + return 33; + case sogdian: + return 183; + case soraSompeng: + return 152; + case soyombo: + return 176; + case sundanese: + return 113; + case sylotiNagri: + return 58; + case syriac: + return 34; + case tagalog: + return 42; + case tagbanwa: + return 45; + case taiLe: + return 52; + case taiTham: + return 106; + case taiViet: + return 127; + case takri: + return 153; + case tamil: + return 35; + case tangsa: + return 195; + case tangut: + return 154; + case telugu: + return 36; + case thaana: + return 37; + case thai: + return 38; + case tibetan: + return 39; + case tifinagh: + return 60; + case tirhuta: + return 158; + case toto: + return 196; + case ugaritic: + return 53; + case unknown: + return 103; + case vai: + return 99; + case vithkuqi: + return 197; + case wancho: + return 188; + case warangCiti: + return 146; + case yezidi: + return 192; + case yi: + return 41; + case zanabazarSquare: + return 177; + } + } + + int toInteger() { + final result = _icu4x_Script_to_integer_mv1(_ffi); + return result; + } + + static Script? fromInteger(int other) { + final result = _icu4x_Script_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return Script.values.firstWhere((v) => v._ffi == result.union.ok); + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_Script_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_Script_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint16)>(isLeaf: true, symbol: 'icu4x_Script_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_Script_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/SentenceBreak.g.dart b/ffi/capi/bindings/dart/SentenceBreak.g.dart new file mode 100644 index 00000000000..21b8d774325 --- /dev/null +++ b/ffi/capi/bindings/dart/SentenceBreak.g.dart @@ -0,0 +1,74 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.SentenceBreak.html) for more information. +enum SentenceBreak { + /// See the [Rust documentation for `Other`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Other) for more information. + other, + + /// See the [Rust documentation for `ATerm`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.ATerm) for more information. + aTerm, + + /// See the [Rust documentation for `Close`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Close) for more information. + close, + + /// See the [Rust documentation for `Format`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Format) for more information. + format, + + /// See the [Rust documentation for `Lower`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Lower) for more information. + lower, + + /// See the [Rust documentation for `Numeric`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Numeric) for more information. + numeric, + + /// See the [Rust documentation for `OLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.OLetter) for more information. + oLetter, + + /// See the [Rust documentation for `Sep`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Sep) for more information. + sep, + + /// See the [Rust documentation for `Sp`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Sp) for more information. + sp, + + /// See the [Rust documentation for `STerm`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.STerm) for more information. + sTerm, + + /// See the [Rust documentation for `Upper`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Upper) for more information. + upper, + + /// See the [Rust documentation for `CR`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.CR) for more information. + cr, + + /// See the [Rust documentation for `Extend`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.Extend) for more information. + extend, + + /// See the [Rust documentation for `LF`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.LF) for more information. + lf, + + /// See the [Rust documentation for `SContinue`](https://docs.rs/icu/latest/icu/properties/props/enum.SentenceBreak.html#variant.SContinue) for more information. + sContinue; + + int toInteger() { + final result = _icu4x_SentenceBreak_to_integer_mv1(index); + return result; + } + + static SentenceBreak? fromInteger(int other) { + final result = _icu4x_SentenceBreak_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return SentenceBreak.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_SentenceBreak_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_SentenceBreak_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_SentenceBreak_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_SentenceBreak_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/WordBreak.g.dart b/ffi/capi/bindings/dart/WordBreak.g.dart new file mode 100644 index 00000000000..aaeb736b1e5 --- /dev/null +++ b/ffi/capi/bindings/dart/WordBreak.g.dart @@ -0,0 +1,98 @@ +// generated by diplomat-tool + +part of 'lib.g.dart'; + +/// See the [Rust documentation for `WordBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.WordBreak.html) for more information. +enum WordBreak { + /// See the [Rust documentation for `Other`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.Other) for more information. + other, + + /// See the [Rust documentation for `ALetter`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.ALetter) for more information. + aLetter, + + /// See the [Rust documentation for `Format`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.Format) for more information. + format, + + /// See the [Rust documentation for `Katakana`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.Katakana) for more information. + katakana, + + /// See the [Rust documentation for `MidLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.MidLetter) for more information. + midLetter, + + /// See the [Rust documentation for `MidNum`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.MidNum) for more information. + midNum, + + /// See the [Rust documentation for `Numeric`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.Numeric) for more information. + numeric, + + /// See the [Rust documentation for `ExtendNumLet`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.ExtendNumLet) for more information. + extendNumLet, + + /// See the [Rust documentation for `CR`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.CR) for more information. + cr, + + /// See the [Rust documentation for `Extend`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.Extend) for more information. + extend, + + /// See the [Rust documentation for `LF`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.LF) for more information. + lf, + + /// See the [Rust documentation for `MidNumLet`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.MidNumLet) for more information. + midNumLet, + + /// See the [Rust documentation for `Newline`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.Newline) for more information. + newline, + + /// See the [Rust documentation for `RegionalIndicator`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.RegionalIndicator) for more information. + regionalIndicator, + + /// See the [Rust documentation for `HebrewLetter`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.HebrewLetter) for more information. + hebrewLetter, + + /// See the [Rust documentation for `SingleQuote`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.SingleQuote) for more information. + singleQuote, + + /// See the [Rust documentation for `DoubleQuote`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.DoubleQuote) for more information. + doubleQuote, + + /// See the [Rust documentation for `EBase`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.EBase) for more information. + eBase, + + /// See the [Rust documentation for `EBaseGAZ`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.EBaseGAZ) for more information. + eBaseGaz, + + /// See the [Rust documentation for `EModifier`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.EModifier) for more information. + eModifier, + + /// See the [Rust documentation for `GlueAfterZwj`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.GlueAfterZwj) for more information. + glueAfterZwj, + + /// See the [Rust documentation for `ZWJ`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.ZWJ) for more information. + zwj, + + /// See the [Rust documentation for `WSegSpace`](https://docs.rs/icu/latest/icu/properties/props/enum.WordBreak.html#variant.WSegSpace) for more information. + wSegSpace; + + int toInteger() { + final result = _icu4x_WordBreak_to_integer_mv1(index); + return result; + } + + static WordBreak? fromInteger(int other) { + final result = _icu4x_WordBreak_from_integer_mv1(other); + if (!result.isOk) { + return null; + } + return WordBreak.values[result.union.ok]; + } +} + +@meta.RecordUse() +@ffi.Native(isLeaf: true, symbol: 'icu4x_WordBreak_to_integer_mv1') +// ignore: non_constant_identifier_names +external int _icu4x_WordBreak_to_integer_mv1(int self); + +@meta.RecordUse() +@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_WordBreak_from_integer_mv1') +// ignore: non_constant_identifier_names +external _ResultInt32Void _icu4x_WordBreak_from_integer_mv1(int other); diff --git a/ffi/capi/bindings/dart/lib.g.dart b/ffi/capi/bindings/dart/lib.g.dart index f5d5957857a..291985bce8f 100644 --- a/ffi/capi/bindings/dart/lib.g.dart +++ b/ffi/capi/bindings/dart/lib.g.dart @@ -12,12 +12,14 @@ import 'package:ffi/ffi.dart' as ffi2 show Arena, calloc; import 'package:meta/meta.dart' as meta; part 'AnyCalendarKind.g.dart'; part 'Bidi.g.dart'; +part 'BidiClass.g.dart'; part 'BidiDirection.g.dart'; part 'BidiInfo.g.dart'; part 'BidiParagraph.g.dart'; part 'Calendar.g.dart'; part 'CalendarError.g.dart'; part 'CalendarParseError.g.dart'; +part 'CanonicalCombiningClass.g.dart'; part 'CanonicalCombiningClassMap.g.dart'; part 'CanonicalComposition.g.dart'; part 'CanonicalDecomposition.g.dart'; @@ -53,6 +55,7 @@ part 'DecomposingNormalizer.g.dart'; part 'DisplayNamesFallback.g.dart'; part 'DisplayNamesOptions.g.dart'; part 'DisplayNamesStyle.g.dart'; +part 'EastAsianWidth.g.dart'; part 'EmojiSetData.g.dart'; part 'ExemplarCharacters.g.dart'; part 'FixedDecimal.g.dart'; @@ -65,6 +68,7 @@ part 'FixedDecimalRoundingMode.g.dart'; part 'FixedDecimalSign.g.dart'; part 'FixedDecimalSignDisplay.g.dart'; part 'GeneralCategoryNameToMaskMapper.g.dart'; +part 'GraphemeClusterBreak.g.dart'; part 'GraphemeClusterBreakIteratorLatin1.g.dart'; part 'GraphemeClusterBreakIteratorUtf16.g.dart'; part 'GraphemeClusterBreakIteratorUtf8.g.dart'; @@ -72,11 +76,15 @@ part 'GraphemeClusterSegmenter.g.dart'; part 'GregorianDateFormatter.g.dart'; part 'GregorianDateTimeFormatter.g.dart'; part 'GregorianZonedDateTimeFormatter.g.dart'; +part 'HangulSyllableType.g.dart'; +part 'IndicSyllabicCategory.g.dart'; part 'IsoDate.g.dart'; part 'IsoDateTime.g.dart'; part 'IsoWeekday.g.dart'; +part 'JoiningType.g.dart'; part 'LanguageDisplay.g.dart'; part 'LeadingAdjustment.g.dart'; +part 'LineBreak.g.dart'; part 'LineBreakIteratorLatin1.g.dart'; part 'LineBreakIteratorUtf16.g.dart'; part 'LineBreakIteratorUtf8.g.dart'; @@ -109,10 +117,12 @@ part 'PluralRules.g.dart'; part 'PropertyValueNameToEnumMapper.g.dart'; part 'RegionDisplayNames.g.dart'; part 'ReorderedIndexMap.g.dart'; +part 'Script.g.dart'; part 'ScriptExtensionsSet.g.dart'; part 'ScriptWithExtensions.g.dart'; part 'ScriptWithExtensionsBorrowed.g.dart'; part 'SegmenterWordType.g.dart'; +part 'SentenceBreak.g.dart'; part 'SentenceBreakIteratorLatin1.g.dart'; part 'SentenceBreakIteratorUtf16.g.dart'; part 'SentenceBreakIteratorUtf8.g.dart'; @@ -133,6 +143,7 @@ part 'WeekCalculator.g.dart'; part 'WeekOf.g.dart'; part 'WeekRelativeUnit.g.dart'; part 'WeekendContainsDay.g.dart'; +part 'WordBreak.g.dart'; part 'WordBreakIteratorLatin1.g.dart'; part 'WordBreakIteratorUtf16.g.dart'; part 'WordBreakIteratorUtf8.g.dart'; diff --git a/ffi/capi/bindings/js/BidiClass.d.ts b/ffi/capi/bindings/js/BidiClass.d.ts new file mode 100644 index 00000000000..2e0912a71d7 --- /dev/null +++ b/ffi/capi/bindings/js/BidiClass.d.ts @@ -0,0 +1,41 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `BidiClass`](https://docs.rs/icu/latest/icu/properties/props/struct.BidiClass.html) for more information. +*/ +export class BidiClass { + constructor(value : BidiClass | string); + + get value() : string; + + get ffiValue() : number; + + static LeftToRight : BidiClass; + static RightToLeft : BidiClass; + static EuropeanNumber : BidiClass; + static EuropeanSeparator : BidiClass; + static EuropeanTerminator : BidiClass; + static ArabicNumber : BidiClass; + static CommonSeparator : BidiClass; + static ParagraphSeparator : BidiClass; + static SegmentSeparator : BidiClass; + static WhiteSpace : BidiClass; + static OtherNeutral : BidiClass; + static LeftToRightEmbedding : BidiClass; + static LeftToRightOverride : BidiClass; + static ArabicLetter : BidiClass; + static RightToLeftEmbedding : BidiClass; + static RightToLeftOverride : BidiClass; + static PopDirectionalFormat : BidiClass; + static NonspacingMark : BidiClass; + static BoundaryNeutral : BidiClass; + static FirstStrongIsolate : BidiClass; + static LeftToRightIsolate : BidiClass; + static RightToLeftIsolate : BidiClass; + static PopDirectionalIsolate : BidiClass; + + toInteger(): number; + + static fromInteger(other: number): BidiClass | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/BidiClass.mjs b/ffi/capi/bindings/js/BidiClass.mjs new file mode 100644 index 00000000000..a0cea5c3744 --- /dev/null +++ b/ffi/capi/bindings/js/BidiClass.mjs @@ -0,0 +1,149 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `BidiClass`](https://docs.rs/icu/latest/icu/properties/props/struct.BidiClass.html) for more information. +*/ +export class BidiClass { + #value = undefined; + + static #values = new Map([ + ["LeftToRight", 0], + ["RightToLeft", 1], + ["EuropeanNumber", 2], + ["EuropeanSeparator", 3], + ["EuropeanTerminator", 4], + ["ArabicNumber", 5], + ["CommonSeparator", 6], + ["ParagraphSeparator", 7], + ["SegmentSeparator", 8], + ["WhiteSpace", 9], + ["OtherNeutral", 10], + ["LeftToRightEmbedding", 11], + ["LeftToRightOverride", 12], + ["ArabicLetter", 13], + ["RightToLeftEmbedding", 14], + ["RightToLeftOverride", 15], + ["PopDirectionalFormat", 16], + ["NonspacingMark", 17], + ["BoundaryNeutral", 18], + ["FirstStrongIsolate", 19], + ["LeftToRightIsolate", 20], + ["RightToLeftIsolate", 21], + ["PopDirectionalIsolate", 22] + ]); + + static getAllEntries() { + return BidiClass.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return BidiClass.#objectValues[arguments[1]]; + } + + if (value instanceof BidiClass) { + return value; + } + + let intVal = BidiClass.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return BidiClass.#objectValues[intVal]; + } + + throw TypeError(value + " is not a BidiClass and does not correspond to any of its enumerator values."); + } + + get value() { + return [...BidiClass.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21), + new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22), + ]; + + static LeftToRight = BidiClass.#objectValues[0]; + static RightToLeft = BidiClass.#objectValues[1]; + static EuropeanNumber = BidiClass.#objectValues[2]; + static EuropeanSeparator = BidiClass.#objectValues[3]; + static EuropeanTerminator = BidiClass.#objectValues[4]; + static ArabicNumber = BidiClass.#objectValues[5]; + static CommonSeparator = BidiClass.#objectValues[6]; + static ParagraphSeparator = BidiClass.#objectValues[7]; + static SegmentSeparator = BidiClass.#objectValues[8]; + static WhiteSpace = BidiClass.#objectValues[9]; + static OtherNeutral = BidiClass.#objectValues[10]; + static LeftToRightEmbedding = BidiClass.#objectValues[11]; + static LeftToRightOverride = BidiClass.#objectValues[12]; + static ArabicLetter = BidiClass.#objectValues[13]; + static RightToLeftEmbedding = BidiClass.#objectValues[14]; + static RightToLeftOverride = BidiClass.#objectValues[15]; + static PopDirectionalFormat = BidiClass.#objectValues[16]; + static NonspacingMark = BidiClass.#objectValues[17]; + static BoundaryNeutral = BidiClass.#objectValues[18]; + static FirstStrongIsolate = BidiClass.#objectValues[19]; + static LeftToRightIsolate = BidiClass.#objectValues[20]; + static RightToLeftIsolate = BidiClass.#objectValues[21]; + static PopDirectionalIsolate = BidiClass.#objectValues[22]; + + toInteger() { + const result = wasm.icu4x_BidiClass_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_BidiClass_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new BidiClass(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/CanonicalCombiningClass.d.ts b/ffi/capi/bindings/js/CanonicalCombiningClass.d.ts new file mode 100644 index 00000000000..398db4a0490 --- /dev/null +++ b/ffi/capi/bindings/js/CanonicalCombiningClass.d.ts @@ -0,0 +1,76 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `CanonicalCombiningClass`](https://docs.rs/icu/latest/icu/properties/props/struct.CanonicalCombiningClass.html) for more information. +*/ +export class CanonicalCombiningClass { + constructor(value : CanonicalCombiningClass | string); + + get value() : string; + + get ffiValue() : number; + + static NotReordered : CanonicalCombiningClass; + static Overlay : CanonicalCombiningClass; + static HanReading : CanonicalCombiningClass; + static Nukta : CanonicalCombiningClass; + static KanaVoicing : CanonicalCombiningClass; + static Virama : CanonicalCombiningClass; + static Ccc10 : CanonicalCombiningClass; + static Ccc11 : CanonicalCombiningClass; + static Ccc12 : CanonicalCombiningClass; + static Ccc13 : CanonicalCombiningClass; + static Ccc14 : CanonicalCombiningClass; + static Ccc15 : CanonicalCombiningClass; + static Ccc16 : CanonicalCombiningClass; + static Ccc17 : CanonicalCombiningClass; + static Ccc18 : CanonicalCombiningClass; + static Ccc19 : CanonicalCombiningClass; + static Ccc20 : CanonicalCombiningClass; + static Ccc21 : CanonicalCombiningClass; + static Ccc22 : CanonicalCombiningClass; + static Ccc23 : CanonicalCombiningClass; + static Ccc24 : CanonicalCombiningClass; + static Ccc25 : CanonicalCombiningClass; + static Ccc26 : CanonicalCombiningClass; + static Ccc27 : CanonicalCombiningClass; + static Ccc28 : CanonicalCombiningClass; + static Ccc29 : CanonicalCombiningClass; + static Ccc30 : CanonicalCombiningClass; + static Ccc31 : CanonicalCombiningClass; + static Ccc32 : CanonicalCombiningClass; + static Ccc33 : CanonicalCombiningClass; + static Ccc34 : CanonicalCombiningClass; + static Ccc35 : CanonicalCombiningClass; + static Ccc36 : CanonicalCombiningClass; + static Ccc84 : CanonicalCombiningClass; + static Ccc91 : CanonicalCombiningClass; + static Ccc103 : CanonicalCombiningClass; + static Ccc107 : CanonicalCombiningClass; + static Ccc118 : CanonicalCombiningClass; + static Ccc122 : CanonicalCombiningClass; + static Ccc129 : CanonicalCombiningClass; + static Ccc130 : CanonicalCombiningClass; + static Ccc132 : CanonicalCombiningClass; + static Ccc133 : CanonicalCombiningClass; + static AttachedBelowLeft : CanonicalCombiningClass; + static AttachedBelow : CanonicalCombiningClass; + static AttachedAbove : CanonicalCombiningClass; + static AttachedAboveRight : CanonicalCombiningClass; + static BelowLeft : CanonicalCombiningClass; + static Below : CanonicalCombiningClass; + static BelowRight : CanonicalCombiningClass; + static Left : CanonicalCombiningClass; + static Right : CanonicalCombiningClass; + static AboveLeft : CanonicalCombiningClass; + static Above : CanonicalCombiningClass; + static AboveRight : CanonicalCombiningClass; + static DoubleBelow : CanonicalCombiningClass; + static DoubleAbove : CanonicalCombiningClass; + static IotaSubscript : CanonicalCombiningClass; + + toInteger(): number; + + static fromInteger(other: number): CanonicalCombiningClass | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/CanonicalCombiningClass.mjs b/ffi/capi/bindings/js/CanonicalCombiningClass.mjs new file mode 100644 index 00000000000..d7df36fd4a7 --- /dev/null +++ b/ffi/capi/bindings/js/CanonicalCombiningClass.mjs @@ -0,0 +1,258 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `CanonicalCombiningClass`](https://docs.rs/icu/latest/icu/properties/props/struct.CanonicalCombiningClass.html) for more information. +*/ +export class CanonicalCombiningClass { + #value = undefined; + + static #values = new Map([ + ["NotReordered", 0], + ["Overlay", 1], + ["HanReading", 6], + ["Nukta", 7], + ["KanaVoicing", 8], + ["Virama", 9], + ["Ccc10", 10], + ["Ccc11", 11], + ["Ccc12", 12], + ["Ccc13", 13], + ["Ccc14", 14], + ["Ccc15", 15], + ["Ccc16", 16], + ["Ccc17", 17], + ["Ccc18", 18], + ["Ccc19", 19], + ["Ccc20", 20], + ["Ccc21", 21], + ["Ccc22", 22], + ["Ccc23", 23], + ["Ccc24", 24], + ["Ccc25", 25], + ["Ccc26", 26], + ["Ccc27", 27], + ["Ccc28", 28], + ["Ccc29", 29], + ["Ccc30", 30], + ["Ccc31", 31], + ["Ccc32", 32], + ["Ccc33", 33], + ["Ccc34", 34], + ["Ccc35", 35], + ["Ccc36", 36], + ["Ccc84", 84], + ["Ccc91", 91], + ["Ccc103", 103], + ["Ccc107", 107], + ["Ccc118", 118], + ["Ccc122", 122], + ["Ccc129", 129], + ["Ccc130", 130], + ["Ccc132", 132], + ["Ccc133", 133], + ["AttachedBelowLeft", 200], + ["AttachedBelow", 202], + ["AttachedAbove", 214], + ["AttachedAboveRight", 216], + ["BelowLeft", 218], + ["Below", 220], + ["BelowRight", 222], + ["Left", 224], + ["Right", 226], + ["AboveLeft", 228], + ["Above", 230], + ["AboveRight", 232], + ["DoubleBelow", 233], + ["DoubleAbove", 234], + ["IotaSubscript", 240] + ]); + + static getAllEntries() { + return CanonicalCombiningClass.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return CanonicalCombiningClass.#objectValues[arguments[1]]; + } + + if (value instanceof CanonicalCombiningClass) { + return value; + } + + let intVal = CanonicalCombiningClass.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return CanonicalCombiningClass.#objectValues[intVal]; + } + + throw TypeError(value + " is not a CanonicalCombiningClass and does not correspond to any of its enumerator values."); + } + + get value() { + for (let entry of CanonicalCombiningClass.#values) { + if (entry[1] == this.#value) { + return entry[0]; + } + } + } + + get ffiValue() { + return this.#value; + } + static #objectValues = { + [0]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + [1]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + [6]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + [7]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + [8]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + [9]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + [10]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + [11]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + [12]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + [13]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + [14]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + [15]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + [16]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + [17]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + [18]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18), + [19]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19), + [20]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20), + [21]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21), + [22]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22), + [23]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 23), + [24]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 24), + [25]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 25), + [26]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 26), + [27]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 27), + [28]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 28), + [29]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 29), + [30]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 30), + [31]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 31), + [32]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 32), + [33]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 33), + [34]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 34), + [35]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 35), + [36]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 36), + [84]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 84), + [91]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 91), + [103]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 103), + [107]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 107), + [118]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 118), + [122]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 122), + [129]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 129), + [130]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 130), + [132]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 132), + [133]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 133), + [200]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 200), + [202]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 202), + [214]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 214), + [216]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 216), + [218]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 218), + [220]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 220), + [222]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 222), + [224]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 224), + [226]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 226), + [228]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 228), + [230]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 230), + [232]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 232), + [233]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 233), + [234]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 234), + [240]: new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 240), + }; + + static NotReordered = CanonicalCombiningClass.#objectValues[0]; + static Overlay = CanonicalCombiningClass.#objectValues[1]; + static HanReading = CanonicalCombiningClass.#objectValues[6]; + static Nukta = CanonicalCombiningClass.#objectValues[7]; + static KanaVoicing = CanonicalCombiningClass.#objectValues[8]; + static Virama = CanonicalCombiningClass.#objectValues[9]; + static Ccc10 = CanonicalCombiningClass.#objectValues[10]; + static Ccc11 = CanonicalCombiningClass.#objectValues[11]; + static Ccc12 = CanonicalCombiningClass.#objectValues[12]; + static Ccc13 = CanonicalCombiningClass.#objectValues[13]; + static Ccc14 = CanonicalCombiningClass.#objectValues[14]; + static Ccc15 = CanonicalCombiningClass.#objectValues[15]; + static Ccc16 = CanonicalCombiningClass.#objectValues[16]; + static Ccc17 = CanonicalCombiningClass.#objectValues[17]; + static Ccc18 = CanonicalCombiningClass.#objectValues[18]; + static Ccc19 = CanonicalCombiningClass.#objectValues[19]; + static Ccc20 = CanonicalCombiningClass.#objectValues[20]; + static Ccc21 = CanonicalCombiningClass.#objectValues[21]; + static Ccc22 = CanonicalCombiningClass.#objectValues[22]; + static Ccc23 = CanonicalCombiningClass.#objectValues[23]; + static Ccc24 = CanonicalCombiningClass.#objectValues[24]; + static Ccc25 = CanonicalCombiningClass.#objectValues[25]; + static Ccc26 = CanonicalCombiningClass.#objectValues[26]; + static Ccc27 = CanonicalCombiningClass.#objectValues[27]; + static Ccc28 = CanonicalCombiningClass.#objectValues[28]; + static Ccc29 = CanonicalCombiningClass.#objectValues[29]; + static Ccc30 = CanonicalCombiningClass.#objectValues[30]; + static Ccc31 = CanonicalCombiningClass.#objectValues[31]; + static Ccc32 = CanonicalCombiningClass.#objectValues[32]; + static Ccc33 = CanonicalCombiningClass.#objectValues[33]; + static Ccc34 = CanonicalCombiningClass.#objectValues[34]; + static Ccc35 = CanonicalCombiningClass.#objectValues[35]; + static Ccc36 = CanonicalCombiningClass.#objectValues[36]; + static Ccc84 = CanonicalCombiningClass.#objectValues[84]; + static Ccc91 = CanonicalCombiningClass.#objectValues[91]; + static Ccc103 = CanonicalCombiningClass.#objectValues[103]; + static Ccc107 = CanonicalCombiningClass.#objectValues[107]; + static Ccc118 = CanonicalCombiningClass.#objectValues[118]; + static Ccc122 = CanonicalCombiningClass.#objectValues[122]; + static Ccc129 = CanonicalCombiningClass.#objectValues[129]; + static Ccc130 = CanonicalCombiningClass.#objectValues[130]; + static Ccc132 = CanonicalCombiningClass.#objectValues[132]; + static Ccc133 = CanonicalCombiningClass.#objectValues[133]; + static AttachedBelowLeft = CanonicalCombiningClass.#objectValues[200]; + static AttachedBelow = CanonicalCombiningClass.#objectValues[202]; + static AttachedAbove = CanonicalCombiningClass.#objectValues[214]; + static AttachedAboveRight = CanonicalCombiningClass.#objectValues[216]; + static BelowLeft = CanonicalCombiningClass.#objectValues[218]; + static Below = CanonicalCombiningClass.#objectValues[220]; + static BelowRight = CanonicalCombiningClass.#objectValues[222]; + static Left = CanonicalCombiningClass.#objectValues[224]; + static Right = CanonicalCombiningClass.#objectValues[226]; + static AboveLeft = CanonicalCombiningClass.#objectValues[228]; + static Above = CanonicalCombiningClass.#objectValues[230]; + static AboveRight = CanonicalCombiningClass.#objectValues[232]; + static DoubleBelow = CanonicalCombiningClass.#objectValues[233]; + static DoubleAbove = CanonicalCombiningClass.#objectValues[234]; + static IotaSubscript = CanonicalCombiningClass.#objectValues[240]; + + toInteger() { + const result = wasm.icu4x_CanonicalCombiningClass_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_CanonicalCombiningClass_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new CanonicalCombiningClass(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/EastAsianWidth.d.ts b/ffi/capi/bindings/js/EastAsianWidth.d.ts new file mode 100644 index 00000000000..72f1e871374 --- /dev/null +++ b/ffi/capi/bindings/js/EastAsianWidth.d.ts @@ -0,0 +1,24 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/latest/icu/properties/props/struct.EastAsianWidth.html) for more information. +*/ +export class EastAsianWidth { + constructor(value : EastAsianWidth | string); + + get value() : string; + + get ffiValue() : number; + + static Neutral : EastAsianWidth; + static Ambiguous : EastAsianWidth; + static Halfwidth : EastAsianWidth; + static Fullwidth : EastAsianWidth; + static Narrow : EastAsianWidth; + static Wide : EastAsianWidth; + + toInteger(): number; + + static fromInteger(other: number): EastAsianWidth | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/EastAsianWidth.mjs b/ffi/capi/bindings/js/EastAsianWidth.mjs new file mode 100644 index 00000000000..38f60ecc9e1 --- /dev/null +++ b/ffi/capi/bindings/js/EastAsianWidth.mjs @@ -0,0 +1,98 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `EastAsianWidth`](https://docs.rs/icu/latest/icu/properties/props/struct.EastAsianWidth.html) for more information. +*/ +export class EastAsianWidth { + #value = undefined; + + static #values = new Map([ + ["Neutral", 0], + ["Ambiguous", 1], + ["Halfwidth", 2], + ["Fullwidth", 3], + ["Narrow", 4], + ["Wide", 5] + ]); + + static getAllEntries() { + return EastAsianWidth.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return EastAsianWidth.#objectValues[arguments[1]]; + } + + if (value instanceof EastAsianWidth) { + return value; + } + + let intVal = EastAsianWidth.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return EastAsianWidth.#objectValues[intVal]; + } + + throw TypeError(value + " is not a EastAsianWidth and does not correspond to any of its enumerator values."); + } + + get value() { + return [...EastAsianWidth.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + ]; + + static Neutral = EastAsianWidth.#objectValues[0]; + static Ambiguous = EastAsianWidth.#objectValues[1]; + static Halfwidth = EastAsianWidth.#objectValues[2]; + static Fullwidth = EastAsianWidth.#objectValues[3]; + static Narrow = EastAsianWidth.#objectValues[4]; + static Wide = EastAsianWidth.#objectValues[5]; + + toInteger() { + const result = wasm.icu4x_EastAsianWidth_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_EastAsianWidth_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new EastAsianWidth(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/GraphemeClusterBreak.d.ts b/ffi/capi/bindings/js/GraphemeClusterBreak.d.ts new file mode 100644 index 00000000000..598458698fa --- /dev/null +++ b/ffi/capi/bindings/js/GraphemeClusterBreak.d.ts @@ -0,0 +1,36 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.GraphemeClusterBreak.html) for more information. +*/ +export class GraphemeClusterBreak { + constructor(value : GraphemeClusterBreak | string); + + get value() : string; + + get ffiValue() : number; + + static Other : GraphemeClusterBreak; + static Control : GraphemeClusterBreak; + static Cr : GraphemeClusterBreak; + static Extend : GraphemeClusterBreak; + static L : GraphemeClusterBreak; + static Lf : GraphemeClusterBreak; + static Lv : GraphemeClusterBreak; + static Lvt : GraphemeClusterBreak; + static T : GraphemeClusterBreak; + static V : GraphemeClusterBreak; + static SpacingMark : GraphemeClusterBreak; + static Prepend : GraphemeClusterBreak; + static RegionalIndicator : GraphemeClusterBreak; + static EBase : GraphemeClusterBreak; + static EBaseGaz : GraphemeClusterBreak; + static EModifier : GraphemeClusterBreak; + static GlueAfterZwj : GraphemeClusterBreak; + static Zwj : GraphemeClusterBreak; + + toInteger(): number; + + static fromInteger(other: number): GraphemeClusterBreak | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/GraphemeClusterBreak.mjs b/ffi/capi/bindings/js/GraphemeClusterBreak.mjs new file mode 100644 index 00000000000..03c899aa173 --- /dev/null +++ b/ffi/capi/bindings/js/GraphemeClusterBreak.mjs @@ -0,0 +1,134 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `GraphemeClusterBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.GraphemeClusterBreak.html) for more information. +*/ +export class GraphemeClusterBreak { + #value = undefined; + + static #values = new Map([ + ["Other", 0], + ["Control", 1], + ["Cr", 2], + ["Extend", 3], + ["L", 4], + ["Lf", 5], + ["Lv", 6], + ["Lvt", 7], + ["T", 8], + ["V", 9], + ["SpacingMark", 10], + ["Prepend", 11], + ["RegionalIndicator", 12], + ["EBase", 13], + ["EBaseGaz", 14], + ["EModifier", 15], + ["GlueAfterZwj", 16], + ["Zwj", 17] + ]); + + static getAllEntries() { + return GraphemeClusterBreak.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return GraphemeClusterBreak.#objectValues[arguments[1]]; + } + + if (value instanceof GraphemeClusterBreak) { + return value; + } + + let intVal = GraphemeClusterBreak.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return GraphemeClusterBreak.#objectValues[intVal]; + } + + throw TypeError(value + " is not a GraphemeClusterBreak and does not correspond to any of its enumerator values."); + } + + get value() { + return [...GraphemeClusterBreak.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + ]; + + static Other = GraphemeClusterBreak.#objectValues[0]; + static Control = GraphemeClusterBreak.#objectValues[1]; + static Cr = GraphemeClusterBreak.#objectValues[2]; + static Extend = GraphemeClusterBreak.#objectValues[3]; + static L = GraphemeClusterBreak.#objectValues[4]; + static Lf = GraphemeClusterBreak.#objectValues[5]; + static Lv = GraphemeClusterBreak.#objectValues[6]; + static Lvt = GraphemeClusterBreak.#objectValues[7]; + static T = GraphemeClusterBreak.#objectValues[8]; + static V = GraphemeClusterBreak.#objectValues[9]; + static SpacingMark = GraphemeClusterBreak.#objectValues[10]; + static Prepend = GraphemeClusterBreak.#objectValues[11]; + static RegionalIndicator = GraphemeClusterBreak.#objectValues[12]; + static EBase = GraphemeClusterBreak.#objectValues[13]; + static EBaseGaz = GraphemeClusterBreak.#objectValues[14]; + static EModifier = GraphemeClusterBreak.#objectValues[15]; + static GlueAfterZwj = GraphemeClusterBreak.#objectValues[16]; + static Zwj = GraphemeClusterBreak.#objectValues[17]; + + toInteger() { + const result = wasm.icu4x_GraphemeClusterBreak_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_GraphemeClusterBreak_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new GraphemeClusterBreak(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/HangulSyllableType.d.ts b/ffi/capi/bindings/js/HangulSyllableType.d.ts new file mode 100644 index 00000000000..496e24d019f --- /dev/null +++ b/ffi/capi/bindings/js/HangulSyllableType.d.ts @@ -0,0 +1,24 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/latest/icu/properties/props/struct.HangulSyllableType.html) for more information. +*/ +export class HangulSyllableType { + constructor(value : HangulSyllableType | string); + + get value() : string; + + get ffiValue() : number; + + static NotApplicable : HangulSyllableType; + static LeadingJamo : HangulSyllableType; + static VowelJamo : HangulSyllableType; + static TrailingJamo : HangulSyllableType; + static LeadingVowelSyllable : HangulSyllableType; + static LeadingVowelTrailingSyllable : HangulSyllableType; + + toInteger(): number; + + static fromInteger(other: number): HangulSyllableType | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/HangulSyllableType.mjs b/ffi/capi/bindings/js/HangulSyllableType.mjs new file mode 100644 index 00000000000..084117a9905 --- /dev/null +++ b/ffi/capi/bindings/js/HangulSyllableType.mjs @@ -0,0 +1,98 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `HangulSyllableType`](https://docs.rs/icu/latest/icu/properties/props/struct.HangulSyllableType.html) for more information. +*/ +export class HangulSyllableType { + #value = undefined; + + static #values = new Map([ + ["NotApplicable", 0], + ["LeadingJamo", 1], + ["VowelJamo", 2], + ["TrailingJamo", 3], + ["LeadingVowelSyllable", 4], + ["LeadingVowelTrailingSyllable", 5] + ]); + + static getAllEntries() { + return HangulSyllableType.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return HangulSyllableType.#objectValues[arguments[1]]; + } + + if (value instanceof HangulSyllableType) { + return value; + } + + let intVal = HangulSyllableType.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return HangulSyllableType.#objectValues[intVal]; + } + + throw TypeError(value + " is not a HangulSyllableType and does not correspond to any of its enumerator values."); + } + + get value() { + return [...HangulSyllableType.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + ]; + + static NotApplicable = HangulSyllableType.#objectValues[0]; + static LeadingJamo = HangulSyllableType.#objectValues[1]; + static VowelJamo = HangulSyllableType.#objectValues[2]; + static TrailingJamo = HangulSyllableType.#objectValues[3]; + static LeadingVowelSyllable = HangulSyllableType.#objectValues[4]; + static LeadingVowelTrailingSyllable = HangulSyllableType.#objectValues[5]; + + toInteger() { + const result = wasm.icu4x_HangulSyllableType_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_HangulSyllableType_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new HangulSyllableType(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/IndicSyllabicCategory.d.ts b/ffi/capi/bindings/js/IndicSyllabicCategory.d.ts new file mode 100644 index 00000000000..7fa2f2ab9cf --- /dev/null +++ b/ffi/capi/bindings/js/IndicSyllabicCategory.d.ts @@ -0,0 +1,55 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/latest/icu/properties/props/struct.IndicSyllabicCategory.html) for more information. +*/ +export class IndicSyllabicCategory { + constructor(value : IndicSyllabicCategory | string); + + get value() : string; + + get ffiValue() : number; + + static Other : IndicSyllabicCategory; + static Avagraha : IndicSyllabicCategory; + static Bindu : IndicSyllabicCategory; + static BrahmiJoiningNumber : IndicSyllabicCategory; + static CantillationMark : IndicSyllabicCategory; + static Consonant : IndicSyllabicCategory; + static ConsonantDead : IndicSyllabicCategory; + static ConsonantFinal : IndicSyllabicCategory; + static ConsonantHeadLetter : IndicSyllabicCategory; + static ConsonantInitialPostfixed : IndicSyllabicCategory; + static ConsonantKiller : IndicSyllabicCategory; + static ConsonantMedial : IndicSyllabicCategory; + static ConsonantPlaceholder : IndicSyllabicCategory; + static ConsonantPrecedingRepha : IndicSyllabicCategory; + static ConsonantPrefixed : IndicSyllabicCategory; + static ConsonantSucceedingRepha : IndicSyllabicCategory; + static ConsonantSubjoined : IndicSyllabicCategory; + static ConsonantWithStacker : IndicSyllabicCategory; + static GeminationMark : IndicSyllabicCategory; + static InvisibleStacker : IndicSyllabicCategory; + static Joiner : IndicSyllabicCategory; + static ModifyingLetter : IndicSyllabicCategory; + static NonJoiner : IndicSyllabicCategory; + static Nukta : IndicSyllabicCategory; + static Number : IndicSyllabicCategory; + static NumberJoiner : IndicSyllabicCategory; + static PureKiller : IndicSyllabicCategory; + static RegisterShifter : IndicSyllabicCategory; + static SyllableModifier : IndicSyllabicCategory; + static ToneLetter : IndicSyllabicCategory; + static ToneMark : IndicSyllabicCategory; + static Virama : IndicSyllabicCategory; + static Visarga : IndicSyllabicCategory; + static Vowel : IndicSyllabicCategory; + static VowelDependent : IndicSyllabicCategory; + static VowelIndependent : IndicSyllabicCategory; + static ReorderingKiller : IndicSyllabicCategory; + + toInteger(): number; + + static fromInteger(other: number): IndicSyllabicCategory | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/IndicSyllabicCategory.mjs b/ffi/capi/bindings/js/IndicSyllabicCategory.mjs new file mode 100644 index 00000000000..794a3238c4d --- /dev/null +++ b/ffi/capi/bindings/js/IndicSyllabicCategory.mjs @@ -0,0 +1,191 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `IndicSyllabicCategory`](https://docs.rs/icu/latest/icu/properties/props/struct.IndicSyllabicCategory.html) for more information. +*/ +export class IndicSyllabicCategory { + #value = undefined; + + static #values = new Map([ + ["Other", 0], + ["Avagraha", 1], + ["Bindu", 2], + ["BrahmiJoiningNumber", 3], + ["CantillationMark", 4], + ["Consonant", 5], + ["ConsonantDead", 6], + ["ConsonantFinal", 7], + ["ConsonantHeadLetter", 8], + ["ConsonantInitialPostfixed", 9], + ["ConsonantKiller", 10], + ["ConsonantMedial", 11], + ["ConsonantPlaceholder", 12], + ["ConsonantPrecedingRepha", 13], + ["ConsonantPrefixed", 14], + ["ConsonantSucceedingRepha", 15], + ["ConsonantSubjoined", 16], + ["ConsonantWithStacker", 17], + ["GeminationMark", 18], + ["InvisibleStacker", 19], + ["Joiner", 20], + ["ModifyingLetter", 21], + ["NonJoiner", 22], + ["Nukta", 23], + ["Number", 24], + ["NumberJoiner", 25], + ["PureKiller", 26], + ["RegisterShifter", 27], + ["SyllableModifier", 28], + ["ToneLetter", 29], + ["ToneMark", 30], + ["Virama", 31], + ["Visarga", 32], + ["Vowel", 33], + ["VowelDependent", 34], + ["VowelIndependent", 35], + ["ReorderingKiller", 36] + ]); + + static getAllEntries() { + return IndicSyllabicCategory.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return IndicSyllabicCategory.#objectValues[arguments[1]]; + } + + if (value instanceof IndicSyllabicCategory) { + return value; + } + + let intVal = IndicSyllabicCategory.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return IndicSyllabicCategory.#objectValues[intVal]; + } + + throw TypeError(value + " is not a IndicSyllabicCategory and does not correspond to any of its enumerator values."); + } + + get value() { + return [...IndicSyllabicCategory.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 23), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 24), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 25), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 26), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 27), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 28), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 29), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 30), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 31), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 32), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 33), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 34), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 35), + new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 36), + ]; + + static Other = IndicSyllabicCategory.#objectValues[0]; + static Avagraha = IndicSyllabicCategory.#objectValues[1]; + static Bindu = IndicSyllabicCategory.#objectValues[2]; + static BrahmiJoiningNumber = IndicSyllabicCategory.#objectValues[3]; + static CantillationMark = IndicSyllabicCategory.#objectValues[4]; + static Consonant = IndicSyllabicCategory.#objectValues[5]; + static ConsonantDead = IndicSyllabicCategory.#objectValues[6]; + static ConsonantFinal = IndicSyllabicCategory.#objectValues[7]; + static ConsonantHeadLetter = IndicSyllabicCategory.#objectValues[8]; + static ConsonantInitialPostfixed = IndicSyllabicCategory.#objectValues[9]; + static ConsonantKiller = IndicSyllabicCategory.#objectValues[10]; + static ConsonantMedial = IndicSyllabicCategory.#objectValues[11]; + static ConsonantPlaceholder = IndicSyllabicCategory.#objectValues[12]; + static ConsonantPrecedingRepha = IndicSyllabicCategory.#objectValues[13]; + static ConsonantPrefixed = IndicSyllabicCategory.#objectValues[14]; + static ConsonantSucceedingRepha = IndicSyllabicCategory.#objectValues[15]; + static ConsonantSubjoined = IndicSyllabicCategory.#objectValues[16]; + static ConsonantWithStacker = IndicSyllabicCategory.#objectValues[17]; + static GeminationMark = IndicSyllabicCategory.#objectValues[18]; + static InvisibleStacker = IndicSyllabicCategory.#objectValues[19]; + static Joiner = IndicSyllabicCategory.#objectValues[20]; + static ModifyingLetter = IndicSyllabicCategory.#objectValues[21]; + static NonJoiner = IndicSyllabicCategory.#objectValues[22]; + static Nukta = IndicSyllabicCategory.#objectValues[23]; + static Number = IndicSyllabicCategory.#objectValues[24]; + static NumberJoiner = IndicSyllabicCategory.#objectValues[25]; + static PureKiller = IndicSyllabicCategory.#objectValues[26]; + static RegisterShifter = IndicSyllabicCategory.#objectValues[27]; + static SyllableModifier = IndicSyllabicCategory.#objectValues[28]; + static ToneLetter = IndicSyllabicCategory.#objectValues[29]; + static ToneMark = IndicSyllabicCategory.#objectValues[30]; + static Virama = IndicSyllabicCategory.#objectValues[31]; + static Visarga = IndicSyllabicCategory.#objectValues[32]; + static Vowel = IndicSyllabicCategory.#objectValues[33]; + static VowelDependent = IndicSyllabicCategory.#objectValues[34]; + static VowelIndependent = IndicSyllabicCategory.#objectValues[35]; + static ReorderingKiller = IndicSyllabicCategory.#objectValues[36]; + + toInteger() { + const result = wasm.icu4x_IndicSyllabicCategory_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_IndicSyllabicCategory_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new IndicSyllabicCategory(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/JoiningType.d.ts b/ffi/capi/bindings/js/JoiningType.d.ts new file mode 100644 index 00000000000..77afbddb309 --- /dev/null +++ b/ffi/capi/bindings/js/JoiningType.d.ts @@ -0,0 +1,24 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `JoiningType`](https://docs.rs/icu/latest/icu/properties/props/struct.JoiningType.html) for more information. +*/ +export class JoiningType { + constructor(value : JoiningType | string); + + get value() : string; + + get ffiValue() : number; + + static NonJoining : JoiningType; + static JoinCausing : JoiningType; + static DualJoining : JoiningType; + static LeftJoining : JoiningType; + static RightJoining : JoiningType; + static Transparent : JoiningType; + + toInteger(): number; + + static fromInteger(other: number): JoiningType | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/JoiningType.mjs b/ffi/capi/bindings/js/JoiningType.mjs new file mode 100644 index 00000000000..c2747dc0171 --- /dev/null +++ b/ffi/capi/bindings/js/JoiningType.mjs @@ -0,0 +1,98 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `JoiningType`](https://docs.rs/icu/latest/icu/properties/props/struct.JoiningType.html) for more information. +*/ +export class JoiningType { + #value = undefined; + + static #values = new Map([ + ["NonJoining", 0], + ["JoinCausing", 1], + ["DualJoining", 2], + ["LeftJoining", 3], + ["RightJoining", 4], + ["Transparent", 5] + ]); + + static getAllEntries() { + return JoiningType.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return JoiningType.#objectValues[arguments[1]]; + } + + if (value instanceof JoiningType) { + return value; + } + + let intVal = JoiningType.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return JoiningType.#objectValues[intVal]; + } + + throw TypeError(value + " is not a JoiningType and does not correspond to any of its enumerator values."); + } + + get value() { + return [...JoiningType.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + ]; + + static NonJoining = JoiningType.#objectValues[0]; + static JoinCausing = JoiningType.#objectValues[1]; + static DualJoining = JoiningType.#objectValues[2]; + static LeftJoining = JoiningType.#objectValues[3]; + static RightJoining = JoiningType.#objectValues[4]; + static Transparent = JoiningType.#objectValues[5]; + + toInteger() { + const result = wasm.icu4x_JoiningType_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_JoiningType_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new JoiningType(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/LineBreak.d.ts b/ffi/capi/bindings/js/LineBreak.d.ts new file mode 100644 index 00000000000..aaec3281d35 --- /dev/null +++ b/ffi/capi/bindings/js/LineBreak.d.ts @@ -0,0 +1,66 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `LineBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.LineBreak.html) for more information. +*/ +export class LineBreak { + constructor(value : LineBreak | string); + + get value() : string; + + get ffiValue() : number; + + static Unknown : LineBreak; + static Ambiguous : LineBreak; + static Alphabetic : LineBreak; + static BreakBoth : LineBreak; + static BreakAfter : LineBreak; + static BreakBefore : LineBreak; + static MandatoryBreak : LineBreak; + static ContingentBreak : LineBreak; + static ClosePunctuation : LineBreak; + static CombiningMark : LineBreak; + static CarriageReturn : LineBreak; + static Exclamation : LineBreak; + static Glue : LineBreak; + static Hyphen : LineBreak; + static Ideographic : LineBreak; + static Inseparable : LineBreak; + static InfixNumeric : LineBreak; + static LineFeed : LineBreak; + static Nonstarter : LineBreak; + static Numeric : LineBreak; + static OpenPunctuation : LineBreak; + static PostfixNumeric : LineBreak; + static PrefixNumeric : LineBreak; + static Quotation : LineBreak; + static ComplexContext : LineBreak; + static Surrogate : LineBreak; + static Space : LineBreak; + static BreakSymbols : LineBreak; + static ZwSpace : LineBreak; + static NextLine : LineBreak; + static WordJoiner : LineBreak; + static H2 : LineBreak; + static H3 : LineBreak; + static Jl : LineBreak; + static Jt : LineBreak; + static Jv : LineBreak; + static CloseParenthesis : LineBreak; + static ConditionalJapaneseStarter : LineBreak; + static HebrewLetter : LineBreak; + static RegionalIndicator : LineBreak; + static EBase : LineBreak; + static EModifier : LineBreak; + static Zwj : LineBreak; + static Aksara : LineBreak; + static AksaraPrebase : LineBreak; + static AksaraStart : LineBreak; + static ViramaFinal : LineBreak; + static Virama : LineBreak; + + toInteger(): number; + + static fromInteger(other: number): LineBreak | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/LineBreak.mjs b/ffi/capi/bindings/js/LineBreak.mjs new file mode 100644 index 00000000000..639afcee255 --- /dev/null +++ b/ffi/capi/bindings/js/LineBreak.mjs @@ -0,0 +1,224 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `LineBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.LineBreak.html) for more information. +*/ +export class LineBreak { + #value = undefined; + + static #values = new Map([ + ["Unknown", 0], + ["Ambiguous", 1], + ["Alphabetic", 2], + ["BreakBoth", 3], + ["BreakAfter", 4], + ["BreakBefore", 5], + ["MandatoryBreak", 6], + ["ContingentBreak", 7], + ["ClosePunctuation", 8], + ["CombiningMark", 9], + ["CarriageReturn", 10], + ["Exclamation", 11], + ["Glue", 12], + ["Hyphen", 13], + ["Ideographic", 14], + ["Inseparable", 15], + ["InfixNumeric", 16], + ["LineFeed", 17], + ["Nonstarter", 18], + ["Numeric", 19], + ["OpenPunctuation", 20], + ["PostfixNumeric", 21], + ["PrefixNumeric", 22], + ["Quotation", 23], + ["ComplexContext", 24], + ["Surrogate", 25], + ["Space", 26], + ["BreakSymbols", 27], + ["ZwSpace", 28], + ["NextLine", 29], + ["WordJoiner", 30], + ["H2", 31], + ["H3", 32], + ["Jl", 33], + ["Jt", 34], + ["Jv", 35], + ["CloseParenthesis", 36], + ["ConditionalJapaneseStarter", 37], + ["HebrewLetter", 38], + ["RegionalIndicator", 39], + ["EBase", 40], + ["EModifier", 41], + ["Zwj", 42], + ["Aksara", 43], + ["AksaraPrebase", 44], + ["AksaraStart", 45], + ["ViramaFinal", 46], + ["Virama", 47] + ]); + + static getAllEntries() { + return LineBreak.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return LineBreak.#objectValues[arguments[1]]; + } + + if (value instanceof LineBreak) { + return value; + } + + let intVal = LineBreak.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return LineBreak.#objectValues[intVal]; + } + + throw TypeError(value + " is not a LineBreak and does not correspond to any of its enumerator values."); + } + + get value() { + return [...LineBreak.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 23), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 24), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 25), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 26), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 27), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 28), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 29), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 30), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 31), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 32), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 33), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 34), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 35), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 36), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 37), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 38), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 39), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 40), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 41), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 42), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 43), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 44), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 45), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 46), + new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 47), + ]; + + static Unknown = LineBreak.#objectValues[0]; + static Ambiguous = LineBreak.#objectValues[1]; + static Alphabetic = LineBreak.#objectValues[2]; + static BreakBoth = LineBreak.#objectValues[3]; + static BreakAfter = LineBreak.#objectValues[4]; + static BreakBefore = LineBreak.#objectValues[5]; + static MandatoryBreak = LineBreak.#objectValues[6]; + static ContingentBreak = LineBreak.#objectValues[7]; + static ClosePunctuation = LineBreak.#objectValues[8]; + static CombiningMark = LineBreak.#objectValues[9]; + static CarriageReturn = LineBreak.#objectValues[10]; + static Exclamation = LineBreak.#objectValues[11]; + static Glue = LineBreak.#objectValues[12]; + static Hyphen = LineBreak.#objectValues[13]; + static Ideographic = LineBreak.#objectValues[14]; + static Inseparable = LineBreak.#objectValues[15]; + static InfixNumeric = LineBreak.#objectValues[16]; + static LineFeed = LineBreak.#objectValues[17]; + static Nonstarter = LineBreak.#objectValues[18]; + static Numeric = LineBreak.#objectValues[19]; + static OpenPunctuation = LineBreak.#objectValues[20]; + static PostfixNumeric = LineBreak.#objectValues[21]; + static PrefixNumeric = LineBreak.#objectValues[22]; + static Quotation = LineBreak.#objectValues[23]; + static ComplexContext = LineBreak.#objectValues[24]; + static Surrogate = LineBreak.#objectValues[25]; + static Space = LineBreak.#objectValues[26]; + static BreakSymbols = LineBreak.#objectValues[27]; + static ZwSpace = LineBreak.#objectValues[28]; + static NextLine = LineBreak.#objectValues[29]; + static WordJoiner = LineBreak.#objectValues[30]; + static H2 = LineBreak.#objectValues[31]; + static H3 = LineBreak.#objectValues[32]; + static Jl = LineBreak.#objectValues[33]; + static Jt = LineBreak.#objectValues[34]; + static Jv = LineBreak.#objectValues[35]; + static CloseParenthesis = LineBreak.#objectValues[36]; + static ConditionalJapaneseStarter = LineBreak.#objectValues[37]; + static HebrewLetter = LineBreak.#objectValues[38]; + static RegionalIndicator = LineBreak.#objectValues[39]; + static EBase = LineBreak.#objectValues[40]; + static EModifier = LineBreak.#objectValues[41]; + static Zwj = LineBreak.#objectValues[42]; + static Aksara = LineBreak.#objectValues[43]; + static AksaraPrebase = LineBreak.#objectValues[44]; + static AksaraStart = LineBreak.#objectValues[45]; + static ViramaFinal = LineBreak.#objectValues[46]; + static Virama = LineBreak.#objectValues[47]; + + toInteger() { + const result = wasm.icu4x_LineBreak_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_LineBreak_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new LineBreak(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/Script.d.ts b/ffi/capi/bindings/js/Script.d.ts new file mode 100644 index 00000000000..ca256ad4c96 --- /dev/null +++ b/ffi/capi/bindings/js/Script.d.ts @@ -0,0 +1,183 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `Script`](https://docs.rs/icu/latest/icu/properties/props/struct.Script.html) for more information. +*/ +export class Script { + constructor(value : Script | string); + + get value() : string; + + get ffiValue() : number; + + static Adlam : Script; + static Ahom : Script; + static AnatolianHieroglyphs : Script; + static Arabic : Script; + static Armenian : Script; + static Avestan : Script; + static Balinese : Script; + static Bamum : Script; + static BassaVah : Script; + static Batak : Script; + static Bengali : Script; + static Bhaiksuki : Script; + static Bopomofo : Script; + static Brahmi : Script; + static Braille : Script; + static Buginese : Script; + static Buhid : Script; + static CanadianAboriginal : Script; + static Carian : Script; + static CaucasianAlbanian : Script; + static Chakma : Script; + static Cham : Script; + static Cherokee : Script; + static Chorasmian : Script; + static Common : Script; + static Coptic : Script; + static Cuneiform : Script; + static Cypriot : Script; + static CyproMinoan : Script; + static Cyrillic : Script; + static Deseret : Script; + static Devanagari : Script; + static DivesAkuru : Script; + static Dogra : Script; + static Duployan : Script; + static EgyptianHieroglyphs : Script; + static Elbasan : Script; + static Elymaic : Script; + static Ethiopian : Script; + static Georgian : Script; + static Glagolitic : Script; + static Gothic : Script; + static Grantha : Script; + static Greek : Script; + static Gujarati : Script; + static GunjalaGondi : Script; + static Gurmukhi : Script; + static Han : Script; + static Hangul : Script; + static HanifiRohingya : Script; + static Hanunoo : Script; + static Hatran : Script; + static Hebrew : Script; + static Hiragana : Script; + static ImperialAramaic : Script; + static Inherited : Script; + static InscriptionalPahlavi : Script; + static InscriptionalParthian : Script; + static Javanese : Script; + static Kaithi : Script; + static Kannada : Script; + static Katakana : Script; + static Kawi : Script; + static KayahLi : Script; + static Kharoshthi : Script; + static KhitanSmallScript : Script; + static Khmer : Script; + static Khojki : Script; + static Khudawadi : Script; + static Lao : Script; + static Latin : Script; + static Lepcha : Script; + static Limbu : Script; + static LinearA : Script; + static LinearB : Script; + static Lisu : Script; + static Lycian : Script; + static Lydian : Script; + static Mahajani : Script; + static Makasar : Script; + static Malayalam : Script; + static Mandaic : Script; + static Manichaean : Script; + static Marchen : Script; + static MasaramGondi : Script; + static Medefaidrin : Script; + static MeeteiMayek : Script; + static MendeKikakui : Script; + static MeroiticCursive : Script; + static MeroiticHieroglyphs : Script; + static Miao : Script; + static Modi : Script; + static Mongolian : Script; + static Mro : Script; + static Multani : Script; + static Myanmar : Script; + static Nabataean : Script; + static NagMundari : Script; + static Nandinagari : Script; + static Nastaliq : Script; + static NewTaiLue : Script; + static Newa : Script; + static Nko : Script; + static Nushu : Script; + static NyiakengPuachueHmong : Script; + static Ogham : Script; + static OlChiki : Script; + static OldHungarian : Script; + static OldItalic : Script; + static OldNorthArabian : Script; + static OldPermic : Script; + static OldPersian : Script; + static OldSogdian : Script; + static OldSouthArabian : Script; + static OldTurkic : Script; + static OldUyghur : Script; + static Oriya : Script; + static Osage : Script; + static Osmanya : Script; + static PahawhHmong : Script; + static Palmyrene : Script; + static PauCinHau : Script; + static PhagsPa : Script; + static Phoenician : Script; + static PsalterPahlavi : Script; + static Rejang : Script; + static Runic : Script; + static Samaritan : Script; + static Saurashtra : Script; + static Sharada : Script; + static Shavian : Script; + static Siddham : Script; + static SignWriting : Script; + static Sinhala : Script; + static Sogdian : Script; + static SoraSompeng : Script; + static Soyombo : Script; + static Sundanese : Script; + static SylotiNagri : Script; + static Syriac : Script; + static Tagalog : Script; + static Tagbanwa : Script; + static TaiLe : Script; + static TaiTham : Script; + static TaiViet : Script; + static Takri : Script; + static Tamil : Script; + static Tangsa : Script; + static Tangut : Script; + static Telugu : Script; + static Thaana : Script; + static Thai : Script; + static Tibetan : Script; + static Tifinagh : Script; + static Tirhuta : Script; + static Toto : Script; + static Ugaritic : Script; + static Unknown : Script; + static Vai : Script; + static Vithkuqi : Script; + static Wancho : Script; + static WarangCiti : Script; + static Yezidi : Script; + static Yi : Script; + static ZanabazarSquare : Script; + + toInteger(): number; + + static fromInteger(other: number): Script | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/Script.mjs b/ffi/capi/bindings/js/Script.mjs new file mode 100644 index 00000000000..e12bb377fef --- /dev/null +++ b/ffi/capi/bindings/js/Script.mjs @@ -0,0 +1,579 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `Script`](https://docs.rs/icu/latest/icu/properties/props/struct.Script.html) for more information. +*/ +export class Script { + #value = undefined; + + static #values = new Map([ + ["Adlam", 167], + ["Ahom", 161], + ["AnatolianHieroglyphs", 156], + ["Arabic", 2], + ["Armenian", 3], + ["Avestan", 117], + ["Balinese", 62], + ["Bamum", 130], + ["BassaVah", 134], + ["Batak", 63], + ["Bengali", 4], + ["Bhaiksuki", 168], + ["Bopomofo", 5], + ["Brahmi", 65], + ["Braille", 46], + ["Buginese", 55], + ["Buhid", 44], + ["CanadianAboriginal", 40], + ["Carian", 104], + ["CaucasianAlbanian", 159], + ["Chakma", 118], + ["Cham", 66], + ["Cherokee", 6], + ["Chorasmian", 189], + ["Common", 0], + ["Coptic", 7], + ["Cuneiform", 101], + ["Cypriot", 47], + ["CyproMinoan", 193], + ["Cyrillic", 8], + ["Deseret", 9], + ["Devanagari", 10], + ["DivesAkuru", 190], + ["Dogra", 178], + ["Duployan", 135], + ["EgyptianHieroglyphs", 71], + ["Elbasan", 136], + ["Elymaic", 185], + ["Ethiopian", 11], + ["Georgian", 12], + ["Glagolitic", 56], + ["Gothic", 13], + ["Grantha", 137], + ["Greek", 14], + ["Gujarati", 15], + ["GunjalaGondi", 179], + ["Gurmukhi", 16], + ["Han", 17], + ["Hangul", 18], + ["HanifiRohingya", 182], + ["Hanunoo", 43], + ["Hatran", 162], + ["Hebrew", 19], + ["Hiragana", 20], + ["ImperialAramaic", 116], + ["Inherited", 1], + ["InscriptionalPahlavi", 122], + ["InscriptionalParthian", 125], + ["Javanese", 78], + ["Kaithi", 120], + ["Kannada", 21], + ["Katakana", 22], + ["Kawi", 198], + ["KayahLi", 79], + ["Kharoshthi", 57], + ["KhitanSmallScript", 191], + ["Khmer", 23], + ["Khojki", 157], + ["Khudawadi", 145], + ["Lao", 24], + ["Latin", 25], + ["Lepcha", 82], + ["Limbu", 48], + ["LinearA", 83], + ["LinearB", 49], + ["Lisu", 131], + ["Lycian", 107], + ["Lydian", 108], + ["Mahajani", 160], + ["Makasar", 180], + ["Malayalam", 26], + ["Mandaic", 84], + ["Manichaean", 121], + ["Marchen", 169], + ["MasaramGondi", 175], + ["Medefaidrin", 181], + ["MeeteiMayek", 115], + ["MendeKikakui", 140], + ["MeroiticCursive", 141], + ["MeroiticHieroglyphs", 86], + ["Miao", 92], + ["Modi", 163], + ["Mongolian", 27], + ["Mro", 149], + ["Multani", 164], + ["Myanmar", 28], + ["Nabataean", 143], + ["NagMundari", 199], + ["Nandinagari", 187], + ["Nastaliq", 200], + ["NewTaiLue", 59], + ["Newa", 170], + ["Nko", 87], + ["Nushu", 150], + ["NyiakengPuachueHmong", 186], + ["Ogham", 29], + ["OlChiki", 109], + ["OldHungarian", 76], + ["OldItalic", 30], + ["OldNorthArabian", 142], + ["OldPermic", 89], + ["OldPersian", 61], + ["OldSogdian", 184], + ["OldSouthArabian", 133], + ["OldTurkic", 88], + ["OldUyghur", 194], + ["Oriya", 31], + ["Osage", 171], + ["Osmanya", 50], + ["PahawhHmong", 75], + ["Palmyrene", 144], + ["PauCinHau", 165], + ["PhagsPa", 90], + ["Phoenician", 91], + ["PsalterPahlavi", 123], + ["Rejang", 110], + ["Runic", 32], + ["Samaritan", 126], + ["Saurashtra", 111], + ["Sharada", 151], + ["Shavian", 51], + ["Siddham", 166], + ["SignWriting", 112], + ["Sinhala", 33], + ["Sogdian", 183], + ["SoraSompeng", 152], + ["Soyombo", 176], + ["Sundanese", 113], + ["SylotiNagri", 58], + ["Syriac", 34], + ["Tagalog", 42], + ["Tagbanwa", 45], + ["TaiLe", 52], + ["TaiTham", 106], + ["TaiViet", 127], + ["Takri", 153], + ["Tamil", 35], + ["Tangsa", 195], + ["Tangut", 154], + ["Telugu", 36], + ["Thaana", 37], + ["Thai", 38], + ["Tibetan", 39], + ["Tifinagh", 60], + ["Tirhuta", 158], + ["Toto", 196], + ["Ugaritic", 53], + ["Unknown", 103], + ["Vai", 99], + ["Vithkuqi", 197], + ["Wancho", 188], + ["WarangCiti", 146], + ["Yezidi", 192], + ["Yi", 41], + ["ZanabazarSquare", 177] + ]); + + static getAllEntries() { + return Script.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return Script.#objectValues[arguments[1]]; + } + + if (value instanceof Script) { + return value; + } + + let intVal = Script.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return Script.#objectValues[intVal]; + } + + throw TypeError(value + " is not a Script and does not correspond to any of its enumerator values."); + } + + get value() { + for (let entry of Script.#values) { + if (entry[1] == this.#value) { + return entry[0]; + } + } + } + + get ffiValue() { + return this.#value; + } + static #objectValues = { + [167]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 167), + [161]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 161), + [156]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 156), + [2]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + [3]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + [117]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 117), + [62]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 62), + [130]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 130), + [134]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 134), + [63]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 63), + [4]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + [168]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 168), + [5]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + [65]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 65), + [46]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 46), + [55]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 55), + [44]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 44), + [40]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 40), + [104]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 104), + [159]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 159), + [118]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 118), + [66]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 66), + [6]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + [189]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 189), + [0]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + [7]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + [101]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 101), + [47]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 47), + [193]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 193), + [8]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + [9]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + [10]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + [190]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 190), + [178]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 178), + [135]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 135), + [71]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 71), + [136]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 136), + [185]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 185), + [11]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + [12]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + [56]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 56), + [13]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + [137]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 137), + [14]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + [15]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + [179]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 179), + [16]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + [17]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + [18]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18), + [182]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 182), + [43]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 43), + [162]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 162), + [19]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19), + [20]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20), + [116]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 116), + [1]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + [122]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 122), + [125]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 125), + [78]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 78), + [120]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 120), + [21]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21), + [22]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22), + [198]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 198), + [79]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 79), + [57]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 57), + [191]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 191), + [23]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 23), + [157]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 157), + [145]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 145), + [24]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 24), + [25]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 25), + [82]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 82), + [48]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 48), + [83]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 83), + [49]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 49), + [131]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 131), + [107]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 107), + [108]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 108), + [160]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 160), + [180]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 180), + [26]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 26), + [84]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 84), + [121]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 121), + [169]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 169), + [175]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 175), + [181]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 181), + [115]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 115), + [140]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 140), + [141]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 141), + [86]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 86), + [92]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 92), + [163]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 163), + [27]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 27), + [149]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 149), + [164]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 164), + [28]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 28), + [143]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 143), + [199]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 199), + [187]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 187), + [200]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 200), + [59]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 59), + [170]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 170), + [87]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 87), + [150]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 150), + [186]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 186), + [29]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 29), + [109]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 109), + [76]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 76), + [30]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 30), + [142]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 142), + [89]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 89), + [61]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 61), + [184]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 184), + [133]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 133), + [88]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 88), + [194]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 194), + [31]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 31), + [171]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 171), + [50]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 50), + [75]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 75), + [144]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 144), + [165]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 165), + [90]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 90), + [91]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 91), + [123]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 123), + [110]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 110), + [32]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 32), + [126]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 126), + [111]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 111), + [151]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 151), + [51]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 51), + [166]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 166), + [112]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 112), + [33]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 33), + [183]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 183), + [152]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 152), + [176]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 176), + [113]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 113), + [58]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 58), + [34]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 34), + [42]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 42), + [45]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 45), + [52]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 52), + [106]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 106), + [127]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 127), + [153]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 153), + [35]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 35), + [195]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 195), + [154]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 154), + [36]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 36), + [37]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 37), + [38]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 38), + [39]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 39), + [60]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 60), + [158]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 158), + [196]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 196), + [53]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 53), + [103]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 103), + [99]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 99), + [197]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 197), + [188]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 188), + [146]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 146), + [192]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 192), + [41]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 41), + [177]: new Script(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 177), + }; + + static Adlam = Script.#objectValues[167]; + static Ahom = Script.#objectValues[161]; + static AnatolianHieroglyphs = Script.#objectValues[156]; + static Arabic = Script.#objectValues[2]; + static Armenian = Script.#objectValues[3]; + static Avestan = Script.#objectValues[117]; + static Balinese = Script.#objectValues[62]; + static Bamum = Script.#objectValues[130]; + static BassaVah = Script.#objectValues[134]; + static Batak = Script.#objectValues[63]; + static Bengali = Script.#objectValues[4]; + static Bhaiksuki = Script.#objectValues[168]; + static Bopomofo = Script.#objectValues[5]; + static Brahmi = Script.#objectValues[65]; + static Braille = Script.#objectValues[46]; + static Buginese = Script.#objectValues[55]; + static Buhid = Script.#objectValues[44]; + static CanadianAboriginal = Script.#objectValues[40]; + static Carian = Script.#objectValues[104]; + static CaucasianAlbanian = Script.#objectValues[159]; + static Chakma = Script.#objectValues[118]; + static Cham = Script.#objectValues[66]; + static Cherokee = Script.#objectValues[6]; + static Chorasmian = Script.#objectValues[189]; + static Common = Script.#objectValues[0]; + static Coptic = Script.#objectValues[7]; + static Cuneiform = Script.#objectValues[101]; + static Cypriot = Script.#objectValues[47]; + static CyproMinoan = Script.#objectValues[193]; + static Cyrillic = Script.#objectValues[8]; + static Deseret = Script.#objectValues[9]; + static Devanagari = Script.#objectValues[10]; + static DivesAkuru = Script.#objectValues[190]; + static Dogra = Script.#objectValues[178]; + static Duployan = Script.#objectValues[135]; + static EgyptianHieroglyphs = Script.#objectValues[71]; + static Elbasan = Script.#objectValues[136]; + static Elymaic = Script.#objectValues[185]; + static Ethiopian = Script.#objectValues[11]; + static Georgian = Script.#objectValues[12]; + static Glagolitic = Script.#objectValues[56]; + static Gothic = Script.#objectValues[13]; + static Grantha = Script.#objectValues[137]; + static Greek = Script.#objectValues[14]; + static Gujarati = Script.#objectValues[15]; + static GunjalaGondi = Script.#objectValues[179]; + static Gurmukhi = Script.#objectValues[16]; + static Han = Script.#objectValues[17]; + static Hangul = Script.#objectValues[18]; + static HanifiRohingya = Script.#objectValues[182]; + static Hanunoo = Script.#objectValues[43]; + static Hatran = Script.#objectValues[162]; + static Hebrew = Script.#objectValues[19]; + static Hiragana = Script.#objectValues[20]; + static ImperialAramaic = Script.#objectValues[116]; + static Inherited = Script.#objectValues[1]; + static InscriptionalPahlavi = Script.#objectValues[122]; + static InscriptionalParthian = Script.#objectValues[125]; + static Javanese = Script.#objectValues[78]; + static Kaithi = Script.#objectValues[120]; + static Kannada = Script.#objectValues[21]; + static Katakana = Script.#objectValues[22]; + static Kawi = Script.#objectValues[198]; + static KayahLi = Script.#objectValues[79]; + static Kharoshthi = Script.#objectValues[57]; + static KhitanSmallScript = Script.#objectValues[191]; + static Khmer = Script.#objectValues[23]; + static Khojki = Script.#objectValues[157]; + static Khudawadi = Script.#objectValues[145]; + static Lao = Script.#objectValues[24]; + static Latin = Script.#objectValues[25]; + static Lepcha = Script.#objectValues[82]; + static Limbu = Script.#objectValues[48]; + static LinearA = Script.#objectValues[83]; + static LinearB = Script.#objectValues[49]; + static Lisu = Script.#objectValues[131]; + static Lycian = Script.#objectValues[107]; + static Lydian = Script.#objectValues[108]; + static Mahajani = Script.#objectValues[160]; + static Makasar = Script.#objectValues[180]; + static Malayalam = Script.#objectValues[26]; + static Mandaic = Script.#objectValues[84]; + static Manichaean = Script.#objectValues[121]; + static Marchen = Script.#objectValues[169]; + static MasaramGondi = Script.#objectValues[175]; + static Medefaidrin = Script.#objectValues[181]; + static MeeteiMayek = Script.#objectValues[115]; + static MendeKikakui = Script.#objectValues[140]; + static MeroiticCursive = Script.#objectValues[141]; + static MeroiticHieroglyphs = Script.#objectValues[86]; + static Miao = Script.#objectValues[92]; + static Modi = Script.#objectValues[163]; + static Mongolian = Script.#objectValues[27]; + static Mro = Script.#objectValues[149]; + static Multani = Script.#objectValues[164]; + static Myanmar = Script.#objectValues[28]; + static Nabataean = Script.#objectValues[143]; + static NagMundari = Script.#objectValues[199]; + static Nandinagari = Script.#objectValues[187]; + static Nastaliq = Script.#objectValues[200]; + static NewTaiLue = Script.#objectValues[59]; + static Newa = Script.#objectValues[170]; + static Nko = Script.#objectValues[87]; + static Nushu = Script.#objectValues[150]; + static NyiakengPuachueHmong = Script.#objectValues[186]; + static Ogham = Script.#objectValues[29]; + static OlChiki = Script.#objectValues[109]; + static OldHungarian = Script.#objectValues[76]; + static OldItalic = Script.#objectValues[30]; + static OldNorthArabian = Script.#objectValues[142]; + static OldPermic = Script.#objectValues[89]; + static OldPersian = Script.#objectValues[61]; + static OldSogdian = Script.#objectValues[184]; + static OldSouthArabian = Script.#objectValues[133]; + static OldTurkic = Script.#objectValues[88]; + static OldUyghur = Script.#objectValues[194]; + static Oriya = Script.#objectValues[31]; + static Osage = Script.#objectValues[171]; + static Osmanya = Script.#objectValues[50]; + static PahawhHmong = Script.#objectValues[75]; + static Palmyrene = Script.#objectValues[144]; + static PauCinHau = Script.#objectValues[165]; + static PhagsPa = Script.#objectValues[90]; + static Phoenician = Script.#objectValues[91]; + static PsalterPahlavi = Script.#objectValues[123]; + static Rejang = Script.#objectValues[110]; + static Runic = Script.#objectValues[32]; + static Samaritan = Script.#objectValues[126]; + static Saurashtra = Script.#objectValues[111]; + static Sharada = Script.#objectValues[151]; + static Shavian = Script.#objectValues[51]; + static Siddham = Script.#objectValues[166]; + static SignWriting = Script.#objectValues[112]; + static Sinhala = Script.#objectValues[33]; + static Sogdian = Script.#objectValues[183]; + static SoraSompeng = Script.#objectValues[152]; + static Soyombo = Script.#objectValues[176]; + static Sundanese = Script.#objectValues[113]; + static SylotiNagri = Script.#objectValues[58]; + static Syriac = Script.#objectValues[34]; + static Tagalog = Script.#objectValues[42]; + static Tagbanwa = Script.#objectValues[45]; + static TaiLe = Script.#objectValues[52]; + static TaiTham = Script.#objectValues[106]; + static TaiViet = Script.#objectValues[127]; + static Takri = Script.#objectValues[153]; + static Tamil = Script.#objectValues[35]; + static Tangsa = Script.#objectValues[195]; + static Tangut = Script.#objectValues[154]; + static Telugu = Script.#objectValues[36]; + static Thaana = Script.#objectValues[37]; + static Thai = Script.#objectValues[38]; + static Tibetan = Script.#objectValues[39]; + static Tifinagh = Script.#objectValues[60]; + static Tirhuta = Script.#objectValues[158]; + static Toto = Script.#objectValues[196]; + static Ugaritic = Script.#objectValues[53]; + static Unknown = Script.#objectValues[103]; + static Vai = Script.#objectValues[99]; + static Vithkuqi = Script.#objectValues[197]; + static Wancho = Script.#objectValues[188]; + static WarangCiti = Script.#objectValues[146]; + static Yezidi = Script.#objectValues[192]; + static Yi = Script.#objectValues[41]; + static ZanabazarSquare = Script.#objectValues[177]; + + toInteger() { + const result = wasm.icu4x_Script_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_Script_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new Script(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/SentenceBreak.d.ts b/ffi/capi/bindings/js/SentenceBreak.d.ts new file mode 100644 index 00000000000..23241dcd3c9 --- /dev/null +++ b/ffi/capi/bindings/js/SentenceBreak.d.ts @@ -0,0 +1,33 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.SentenceBreak.html) for more information. +*/ +export class SentenceBreak { + constructor(value : SentenceBreak | string); + + get value() : string; + + get ffiValue() : number; + + static Other : SentenceBreak; + static ATerm : SentenceBreak; + static Close : SentenceBreak; + static Format : SentenceBreak; + static Lower : SentenceBreak; + static Numeric : SentenceBreak; + static OLetter : SentenceBreak; + static Sep : SentenceBreak; + static Sp : SentenceBreak; + static STerm : SentenceBreak; + static Upper : SentenceBreak; + static Cr : SentenceBreak; + static Extend : SentenceBreak; + static Lf : SentenceBreak; + static SContinue : SentenceBreak; + + toInteger(): number; + + static fromInteger(other: number): SentenceBreak | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/SentenceBreak.mjs b/ffi/capi/bindings/js/SentenceBreak.mjs new file mode 100644 index 00000000000..af8a92fc723 --- /dev/null +++ b/ffi/capi/bindings/js/SentenceBreak.mjs @@ -0,0 +1,125 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `SentenceBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.SentenceBreak.html) for more information. +*/ +export class SentenceBreak { + #value = undefined; + + static #values = new Map([ + ["Other", 0], + ["ATerm", 1], + ["Close", 2], + ["Format", 3], + ["Lower", 4], + ["Numeric", 5], + ["OLetter", 6], + ["Sep", 7], + ["Sp", 8], + ["STerm", 9], + ["Upper", 10], + ["Cr", 11], + ["Extend", 12], + ["Lf", 13], + ["SContinue", 14] + ]); + + static getAllEntries() { + return SentenceBreak.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return SentenceBreak.#objectValues[arguments[1]]; + } + + if (value instanceof SentenceBreak) { + return value; + } + + let intVal = SentenceBreak.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return SentenceBreak.#objectValues[intVal]; + } + + throw TypeError(value + " is not a SentenceBreak and does not correspond to any of its enumerator values."); + } + + get value() { + return [...SentenceBreak.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + ]; + + static Other = SentenceBreak.#objectValues[0]; + static ATerm = SentenceBreak.#objectValues[1]; + static Close = SentenceBreak.#objectValues[2]; + static Format = SentenceBreak.#objectValues[3]; + static Lower = SentenceBreak.#objectValues[4]; + static Numeric = SentenceBreak.#objectValues[5]; + static OLetter = SentenceBreak.#objectValues[6]; + static Sep = SentenceBreak.#objectValues[7]; + static Sp = SentenceBreak.#objectValues[8]; + static STerm = SentenceBreak.#objectValues[9]; + static Upper = SentenceBreak.#objectValues[10]; + static Cr = SentenceBreak.#objectValues[11]; + static Extend = SentenceBreak.#objectValues[12]; + static Lf = SentenceBreak.#objectValues[13]; + static SContinue = SentenceBreak.#objectValues[14]; + + toInteger() { + const result = wasm.icu4x_SentenceBreak_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_SentenceBreak_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new SentenceBreak(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/WordBreak.d.ts b/ffi/capi/bindings/js/WordBreak.d.ts new file mode 100644 index 00000000000..1dfec3bd7b9 --- /dev/null +++ b/ffi/capi/bindings/js/WordBreak.d.ts @@ -0,0 +1,41 @@ +// generated by diplomat-tool +import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; + +// Base enumerator definition +/** See the [Rust documentation for `WordBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.WordBreak.html) for more information. +*/ +export class WordBreak { + constructor(value : WordBreak | string); + + get value() : string; + + get ffiValue() : number; + + static Other : WordBreak; + static ALetter : WordBreak; + static Format : WordBreak; + static Katakana : WordBreak; + static MidLetter : WordBreak; + static MidNum : WordBreak; + static Numeric : WordBreak; + static ExtendNumLet : WordBreak; + static Cr : WordBreak; + static Extend : WordBreak; + static Lf : WordBreak; + static MidNumLet : WordBreak; + static Newline : WordBreak; + static RegionalIndicator : WordBreak; + static HebrewLetter : WordBreak; + static SingleQuote : WordBreak; + static DoubleQuote : WordBreak; + static EBase : WordBreak; + static EBaseGaz : WordBreak; + static EModifier : WordBreak; + static GlueAfterZwj : WordBreak; + static Zwj : WordBreak; + static WSegSpace : WordBreak; + + toInteger(): number; + + static fromInteger(other: number): WordBreak | null; +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/WordBreak.mjs b/ffi/capi/bindings/js/WordBreak.mjs new file mode 100644 index 00000000000..696d40b2411 --- /dev/null +++ b/ffi/capi/bindings/js/WordBreak.mjs @@ -0,0 +1,149 @@ +// generated by diplomat-tool +import wasm from "./diplomat-wasm.mjs"; +import * as diplomatRuntime from "./diplomat-runtime.mjs"; + +// Base enumerator definition +/** See the [Rust documentation for `WordBreak`](https://docs.rs/icu/latest/icu/properties/props/struct.WordBreak.html) for more information. +*/ +export class WordBreak { + #value = undefined; + + static #values = new Map([ + ["Other", 0], + ["ALetter", 1], + ["Format", 2], + ["Katakana", 3], + ["MidLetter", 4], + ["MidNum", 5], + ["Numeric", 6], + ["ExtendNumLet", 7], + ["Cr", 8], + ["Extend", 9], + ["Lf", 10], + ["MidNumLet", 11], + ["Newline", 12], + ["RegionalIndicator", 13], + ["HebrewLetter", 14], + ["SingleQuote", 15], + ["DoubleQuote", 16], + ["EBase", 17], + ["EBaseGaz", 18], + ["EModifier", 19], + ["GlueAfterZwj", 20], + ["Zwj", 21], + ["WSegSpace", 22] + ]); + + static getAllEntries() { + return WordBreak.#values.entries(); + } + + constructor(value) { + if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { + // We pass in two internalConstructor arguments to create *new* + // instances of this type, otherwise the enums are treated as singletons. + if (arguments[1] === diplomatRuntime.internalConstructor ) { + this.#value = arguments[2]; + return; + } + return WordBreak.#objectValues[arguments[1]]; + } + + if (value instanceof WordBreak) { + return value; + } + + let intVal = WordBreak.#values.get(value); + + // Nullish check, checks for null or undefined + if (intVal == null) { + return WordBreak.#objectValues[intVal]; + } + + throw TypeError(value + " is not a WordBreak and does not correspond to any of its enumerator values."); + } + + get value() { + return [...WordBreak.#values.keys()][this.#value]; + } + + get ffiValue() { + return this.#value; + } + static #objectValues = [ + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 9), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 10), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 11), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 12), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 13), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 14), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 15), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 16), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 17), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 18), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 19), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 20), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 21), + new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 22), + ]; + + static Other = WordBreak.#objectValues[0]; + static ALetter = WordBreak.#objectValues[1]; + static Format = WordBreak.#objectValues[2]; + static Katakana = WordBreak.#objectValues[3]; + static MidLetter = WordBreak.#objectValues[4]; + static MidNum = WordBreak.#objectValues[5]; + static Numeric = WordBreak.#objectValues[6]; + static ExtendNumLet = WordBreak.#objectValues[7]; + static Cr = WordBreak.#objectValues[8]; + static Extend = WordBreak.#objectValues[9]; + static Lf = WordBreak.#objectValues[10]; + static MidNumLet = WordBreak.#objectValues[11]; + static Newline = WordBreak.#objectValues[12]; + static RegionalIndicator = WordBreak.#objectValues[13]; + static HebrewLetter = WordBreak.#objectValues[14]; + static SingleQuote = WordBreak.#objectValues[15]; + static DoubleQuote = WordBreak.#objectValues[16]; + static EBase = WordBreak.#objectValues[17]; + static EBaseGaz = WordBreak.#objectValues[18]; + static EModifier = WordBreak.#objectValues[19]; + static GlueAfterZwj = WordBreak.#objectValues[20]; + static Zwj = WordBreak.#objectValues[21]; + static WSegSpace = WordBreak.#objectValues[22]; + + toInteger() { + const result = wasm.icu4x_WordBreak_to_integer_mv1(this.ffiValue); + + try { + return result; + } + + finally {} + } + + static fromInteger(other) { + const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); + + const result = wasm.icu4x_WordBreak_from_integer_mv1(diplomatReceive.buffer, other); + + try { + if (!diplomatReceive.resultFlag) { + return null; + } + return new WordBreak(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); + } + + finally { + diplomatReceive.free(); + } + } +} \ No newline at end of file diff --git a/ffi/capi/bindings/js/index.d.ts b/ffi/capi/bindings/js/index.d.ts index 2829e1f9954..fb53ab0d1f5 100644 --- a/ffi/capi/bindings/js/index.d.ts +++ b/ffi/capi/bindings/js/index.d.ts @@ -250,6 +250,28 @@ export { LocaleDirection } from "./LocaleDirection" export { PluralCategory } from "./PluralCategory" +export { BidiClass } from "./BidiClass" + +export { CanonicalCombiningClass } from "./CanonicalCombiningClass" + +export { EastAsianWidth } from "./EastAsianWidth" + +export { GraphemeClusterBreak } from "./GraphemeClusterBreak" + +export { HangulSyllableType } from "./HangulSyllableType" + +export { IndicSyllabicCategory } from "./IndicSyllabicCategory" + +export { JoiningType } from "./JoiningType" + +export { LineBreak } from "./LineBreak" + +export { Script } from "./Script" + +export { SentenceBreak } from "./SentenceBreak" + +export { WordBreak } from "./WordBreak" + export { LineBreakStrictness } from "./LineBreakStrictness" export { LineBreakWordOption } from "./LineBreakWordOption" diff --git a/ffi/capi/bindings/js/index.mjs b/ffi/capi/bindings/js/index.mjs index 15e1f45cb8a..6813012b13d 100644 --- a/ffi/capi/bindings/js/index.mjs +++ b/ffi/capi/bindings/js/index.mjs @@ -248,6 +248,28 @@ export { LocaleDirection } from "./LocaleDirection.mjs" export { PluralCategory } from "./PluralCategory.mjs" +export { BidiClass } from "./BidiClass.mjs" + +export { CanonicalCombiningClass } from "./CanonicalCombiningClass.mjs" + +export { EastAsianWidth } from "./EastAsianWidth.mjs" + +export { GraphemeClusterBreak } from "./GraphemeClusterBreak.mjs" + +export { HangulSyllableType } from "./HangulSyllableType.mjs" + +export { IndicSyllabicCategory } from "./IndicSyllabicCategory.mjs" + +export { JoiningType } from "./JoiningType.mjs" + +export { LineBreak } from "./LineBreak.mjs" + +export { Script } from "./Script.mjs" + +export { SentenceBreak } from "./SentenceBreak.mjs" + +export { WordBreak } from "./WordBreak.mjs" + export { LineBreakStrictness } from "./LineBreakStrictness.mjs" export { LineBreakWordOption } from "./LineBreakWordOption.mjs" diff --git a/ffi/capi/src/lib.rs b/ffi/capi/src/lib.rs index 00fcc69214c..c239a012bca 100644 --- a/ffi/capi/src/lib.rs +++ b/ffi/capi/src/lib.rs @@ -105,6 +105,8 @@ pub mod normalizer_properties; #[cfg(feature = "plurals")] pub mod pluralrules; #[cfg(feature = "properties")] +pub mod properties_enums; +#[cfg(feature = "properties")] pub mod properties_iter; #[cfg(feature = "properties")] pub mod properties_maps; diff --git a/ffi/capi/src/properties_enums.rs b/ffi/capi/src/properties_enums.rs new file mode 100644 index 00000000000..e351e14753b --- /dev/null +++ b/ffi/capi/src/properties_enums.rs @@ -0,0 +1,1663 @@ +// This file is part of ICU4X. For terms of use, please see the file +// called LICENSE at the top level of the ICU4X source tree +// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + +#[diplomat::bridge] +#[diplomat::abi_rename = "icu4x_{0}_mv1"] +#[diplomat::attr(auto, namespace = "icu4x")] +pub mod ffi { + #[diplomat::rust_link(icu::properties::props::BidiClass, Struct)] + #[diplomat::enum_convert(icu_properties::props::BidiClass, needs_wildcard)] + pub enum BidiClass { + #[diplomat::rust_link(icu::properties::props::BidiClass::LeftToRight, EnumVariant)] + LeftToRight = 0, + #[diplomat::rust_link(icu::properties::props::BidiClass::RightToLeft, EnumVariant)] + RightToLeft = 1, + #[diplomat::rust_link(icu::properties::props::BidiClass::EuropeanNumber, EnumVariant)] + EuropeanNumber = 2, + #[diplomat::rust_link(icu::properties::props::BidiClass::EuropeanSeparator, EnumVariant)] + EuropeanSeparator = 3, + #[diplomat::rust_link(icu::properties::props::BidiClass::EuropeanTerminator, EnumVariant)] + EuropeanTerminator = 4, + #[diplomat::rust_link(icu::properties::props::BidiClass::ArabicNumber, EnumVariant)] + ArabicNumber = 5, + #[diplomat::rust_link(icu::properties::props::BidiClass::CommonSeparator, EnumVariant)] + CommonSeparator = 6, + #[diplomat::rust_link(icu::properties::props::BidiClass::ParagraphSeparator, EnumVariant)] + ParagraphSeparator = 7, + #[diplomat::rust_link(icu::properties::props::BidiClass::SegmentSeparator, EnumVariant)] + SegmentSeparator = 8, + #[diplomat::rust_link(icu::properties::props::BidiClass::WhiteSpace, EnumVariant)] + WhiteSpace = 9, + #[diplomat::rust_link(icu::properties::props::BidiClass::OtherNeutral, EnumVariant)] + OtherNeutral = 10, + #[diplomat::rust_link( + icu::properties::props::BidiClass::LeftToRightEmbedding, + EnumVariant + )] + LeftToRightEmbedding = 11, + #[diplomat::rust_link(icu::properties::props::BidiClass::LeftToRightOverride, EnumVariant)] + LeftToRightOverride = 12, + #[diplomat::rust_link(icu::properties::props::BidiClass::ArabicLetter, EnumVariant)] + ArabicLetter = 13, + #[diplomat::rust_link( + icu::properties::props::BidiClass::RightToLeftEmbedding, + EnumVariant + )] + RightToLeftEmbedding = 14, + #[diplomat::rust_link(icu::properties::props::BidiClass::RightToLeftOverride, EnumVariant)] + RightToLeftOverride = 15, + #[diplomat::rust_link( + icu::properties::props::BidiClass::PopDirectionalFormat, + EnumVariant + )] + PopDirectionalFormat = 16, + #[diplomat::rust_link(icu::properties::props::BidiClass::NonspacingMark, EnumVariant)] + NonspacingMark = 17, + #[diplomat::rust_link(icu::properties::props::BidiClass::BoundaryNeutral, EnumVariant)] + BoundaryNeutral = 18, + #[diplomat::rust_link(icu::properties::props::BidiClass::FirstStrongIsolate, EnumVariant)] + FirstStrongIsolate = 19, + #[diplomat::rust_link(icu::properties::props::BidiClass::LeftToRightIsolate, EnumVariant)] + LeftToRightIsolate = 20, + #[diplomat::rust_link(icu::properties::props::BidiClass::RightToLeftIsolate, EnumVariant)] + RightToLeftIsolate = 21, + #[diplomat::rust_link( + icu::properties::props::BidiClass::PopDirectionalIsolate, + EnumVariant + )] + PopDirectionalIsolate = 22, + } + + impl BidiClass { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::LeftToRight, + 1 => Self::RightToLeft, + 2 => Self::EuropeanNumber, + 3 => Self::EuropeanSeparator, + 4 => Self::EuropeanTerminator, + 5 => Self::ArabicNumber, + 6 => Self::CommonSeparator, + 7 => Self::ParagraphSeparator, + 8 => Self::SegmentSeparator, + 9 => Self::WhiteSpace, + 10 => Self::OtherNeutral, + 11 => Self::LeftToRightEmbedding, + 12 => Self::LeftToRightOverride, + 13 => Self::ArabicLetter, + 14 => Self::RightToLeftEmbedding, + 15 => Self::RightToLeftOverride, + 16 => Self::PopDirectionalFormat, + 17 => Self::NonspacingMark, + 18 => Self::BoundaryNeutral, + 19 => Self::FirstStrongIsolate, + 20 => Self::LeftToRightIsolate, + 21 => Self::RightToLeftIsolate, + 22 => Self::PopDirectionalIsolate, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::Script, Struct)] + #[diplomat::enum_convert(icu_properties::props::Script, needs_wildcard)] + pub enum Script { + #[diplomat::rust_link(icu::properties::props::Script::Adlam, EnumVariant)] + Adlam = 167, + #[diplomat::rust_link(icu::properties::props::Script::Ahom, EnumVariant)] + Ahom = 161, + #[diplomat::rust_link(icu::properties::props::Script::AnatolianHieroglyphs, EnumVariant)] + AnatolianHieroglyphs = 156, + #[diplomat::rust_link(icu::properties::props::Script::Arabic, EnumVariant)] + Arabic = 2, + #[diplomat::rust_link(icu::properties::props::Script::Armenian, EnumVariant)] + Armenian = 3, + #[diplomat::rust_link(icu::properties::props::Script::Avestan, EnumVariant)] + Avestan = 117, + #[diplomat::rust_link(icu::properties::props::Script::Balinese, EnumVariant)] + Balinese = 62, + #[diplomat::rust_link(icu::properties::props::Script::Bamum, EnumVariant)] + Bamum = 130, + #[diplomat::rust_link(icu::properties::props::Script::BassaVah, EnumVariant)] + BassaVah = 134, + #[diplomat::rust_link(icu::properties::props::Script::Batak, EnumVariant)] + Batak = 63, + #[diplomat::rust_link(icu::properties::props::Script::Bengali, EnumVariant)] + Bengali = 4, + #[diplomat::rust_link(icu::properties::props::Script::Bhaiksuki, EnumVariant)] + Bhaiksuki = 168, + #[diplomat::rust_link(icu::properties::props::Script::Bopomofo, EnumVariant)] + Bopomofo = 5, + #[diplomat::rust_link(icu::properties::props::Script::Brahmi, EnumVariant)] + Brahmi = 65, + #[diplomat::rust_link(icu::properties::props::Script::Braille, EnumVariant)] + Braille = 46, + #[diplomat::rust_link(icu::properties::props::Script::Buginese, EnumVariant)] + Buginese = 55, + #[diplomat::rust_link(icu::properties::props::Script::Buhid, EnumVariant)] + Buhid = 44, + #[diplomat::rust_link(icu::properties::props::Script::CanadianAboriginal, EnumVariant)] + CanadianAboriginal = 40, + #[diplomat::rust_link(icu::properties::props::Script::Carian, EnumVariant)] + Carian = 104, + #[diplomat::rust_link(icu::properties::props::Script::CaucasianAlbanian, EnumVariant)] + CaucasianAlbanian = 159, + #[diplomat::rust_link(icu::properties::props::Script::Chakma, EnumVariant)] + Chakma = 118, + #[diplomat::rust_link(icu::properties::props::Script::Cham, EnumVariant)] + Cham = 66, + #[diplomat::rust_link(icu::properties::props::Script::Cherokee, EnumVariant)] + Cherokee = 6, + #[diplomat::rust_link(icu::properties::props::Script::Chorasmian, EnumVariant)] + Chorasmian = 189, + #[diplomat::rust_link(icu::properties::props::Script::Common, EnumVariant)] + Common = 0, + #[diplomat::rust_link(icu::properties::props::Script::Coptic, EnumVariant)] + Coptic = 7, + #[diplomat::rust_link(icu::properties::props::Script::Cuneiform, EnumVariant)] + Cuneiform = 101, + #[diplomat::rust_link(icu::properties::props::Script::Cypriot, EnumVariant)] + Cypriot = 47, + #[diplomat::rust_link(icu::properties::props::Script::CyproMinoan, EnumVariant)] + CyproMinoan = 193, + #[diplomat::rust_link(icu::properties::props::Script::Cyrillic, EnumVariant)] + Cyrillic = 8, + #[diplomat::rust_link(icu::properties::props::Script::Deseret, EnumVariant)] + Deseret = 9, + #[diplomat::rust_link(icu::properties::props::Script::Devanagari, EnumVariant)] + Devanagari = 10, + #[diplomat::rust_link(icu::properties::props::Script::DivesAkuru, EnumVariant)] + DivesAkuru = 190, + #[diplomat::rust_link(icu::properties::props::Script::Dogra, EnumVariant)] + Dogra = 178, + #[diplomat::rust_link(icu::properties::props::Script::Duployan, EnumVariant)] + Duployan = 135, + #[diplomat::rust_link(icu::properties::props::Script::EgyptianHieroglyphs, EnumVariant)] + EgyptianHieroglyphs = 71, + #[diplomat::rust_link(icu::properties::props::Script::Elbasan, EnumVariant)] + Elbasan = 136, + #[diplomat::rust_link(icu::properties::props::Script::Elymaic, EnumVariant)] + Elymaic = 185, + #[diplomat::rust_link(icu::properties::props::Script::Ethiopian, EnumVariant)] + Ethiopian = 11, + #[diplomat::rust_link(icu::properties::props::Script::Georgian, EnumVariant)] + Georgian = 12, + #[diplomat::rust_link(icu::properties::props::Script::Glagolitic, EnumVariant)] + Glagolitic = 56, + #[diplomat::rust_link(icu::properties::props::Script::Gothic, EnumVariant)] + Gothic = 13, + #[diplomat::rust_link(icu::properties::props::Script::Grantha, EnumVariant)] + Grantha = 137, + #[diplomat::rust_link(icu::properties::props::Script::Greek, EnumVariant)] + Greek = 14, + #[diplomat::rust_link(icu::properties::props::Script::Gujarati, EnumVariant)] + Gujarati = 15, + #[diplomat::rust_link(icu::properties::props::Script::GunjalaGondi, EnumVariant)] + GunjalaGondi = 179, + #[diplomat::rust_link(icu::properties::props::Script::Gurmukhi, EnumVariant)] + Gurmukhi = 16, + #[diplomat::rust_link(icu::properties::props::Script::Han, EnumVariant)] + Han = 17, + #[diplomat::rust_link(icu::properties::props::Script::Hangul, EnumVariant)] + Hangul = 18, + #[diplomat::rust_link(icu::properties::props::Script::HanifiRohingya, EnumVariant)] + HanifiRohingya = 182, + #[diplomat::rust_link(icu::properties::props::Script::Hanunoo, EnumVariant)] + Hanunoo = 43, + #[diplomat::rust_link(icu::properties::props::Script::Hatran, EnumVariant)] + Hatran = 162, + #[diplomat::rust_link(icu::properties::props::Script::Hebrew, EnumVariant)] + Hebrew = 19, + #[diplomat::rust_link(icu::properties::props::Script::Hiragana, EnumVariant)] + Hiragana = 20, + #[diplomat::rust_link(icu::properties::props::Script::ImperialAramaic, EnumVariant)] + ImperialAramaic = 116, + #[diplomat::rust_link(icu::properties::props::Script::Inherited, EnumVariant)] + Inherited = 1, + #[diplomat::rust_link(icu::properties::props::Script::InscriptionalPahlavi, EnumVariant)] + InscriptionalPahlavi = 122, + #[diplomat::rust_link(icu::properties::props::Script::InscriptionalParthian, EnumVariant)] + InscriptionalParthian = 125, + #[diplomat::rust_link(icu::properties::props::Script::Javanese, EnumVariant)] + Javanese = 78, + #[diplomat::rust_link(icu::properties::props::Script::Kaithi, EnumVariant)] + Kaithi = 120, + #[diplomat::rust_link(icu::properties::props::Script::Kannada, EnumVariant)] + Kannada = 21, + #[diplomat::rust_link(icu::properties::props::Script::Katakana, EnumVariant)] + Katakana = 22, + #[diplomat::rust_link(icu::properties::props::Script::Kawi, EnumVariant)] + Kawi = 198, + #[diplomat::rust_link(icu::properties::props::Script::KayahLi, EnumVariant)] + KayahLi = 79, + #[diplomat::rust_link(icu::properties::props::Script::Kharoshthi, EnumVariant)] + Kharoshthi = 57, + #[diplomat::rust_link(icu::properties::props::Script::KhitanSmallScript, EnumVariant)] + KhitanSmallScript = 191, + #[diplomat::rust_link(icu::properties::props::Script::Khmer, EnumVariant)] + Khmer = 23, + #[diplomat::rust_link(icu::properties::props::Script::Khojki, EnumVariant)] + Khojki = 157, + #[diplomat::rust_link(icu::properties::props::Script::Khudawadi, EnumVariant)] + Khudawadi = 145, + #[diplomat::rust_link(icu::properties::props::Script::Lao, EnumVariant)] + Lao = 24, + #[diplomat::rust_link(icu::properties::props::Script::Latin, EnumVariant)] + Latin = 25, + #[diplomat::rust_link(icu::properties::props::Script::Lepcha, EnumVariant)] + Lepcha = 82, + #[diplomat::rust_link(icu::properties::props::Script::Limbu, EnumVariant)] + Limbu = 48, + #[diplomat::rust_link(icu::properties::props::Script::LinearA, EnumVariant)] + LinearA = 83, + #[diplomat::rust_link(icu::properties::props::Script::LinearB, EnumVariant)] + LinearB = 49, + #[diplomat::rust_link(icu::properties::props::Script::Lisu, EnumVariant)] + Lisu = 131, + #[diplomat::rust_link(icu::properties::props::Script::Lycian, EnumVariant)] + Lycian = 107, + #[diplomat::rust_link(icu::properties::props::Script::Lydian, EnumVariant)] + Lydian = 108, + #[diplomat::rust_link(icu::properties::props::Script::Mahajani, EnumVariant)] + Mahajani = 160, + #[diplomat::rust_link(icu::properties::props::Script::Makasar, EnumVariant)] + Makasar = 180, + #[diplomat::rust_link(icu::properties::props::Script::Malayalam, EnumVariant)] + Malayalam = 26, + #[diplomat::rust_link(icu::properties::props::Script::Mandaic, EnumVariant)] + Mandaic = 84, + #[diplomat::rust_link(icu::properties::props::Script::Manichaean, EnumVariant)] + Manichaean = 121, + #[diplomat::rust_link(icu::properties::props::Script::Marchen, EnumVariant)] + Marchen = 169, + #[diplomat::rust_link(icu::properties::props::Script::MasaramGondi, EnumVariant)] + MasaramGondi = 175, + #[diplomat::rust_link(icu::properties::props::Script::Medefaidrin, EnumVariant)] + Medefaidrin = 181, + #[diplomat::rust_link(icu::properties::props::Script::MeeteiMayek, EnumVariant)] + MeeteiMayek = 115, + #[diplomat::rust_link(icu::properties::props::Script::MendeKikakui, EnumVariant)] + MendeKikakui = 140, + #[diplomat::rust_link(icu::properties::props::Script::MeroiticCursive, EnumVariant)] + MeroiticCursive = 141, + #[diplomat::rust_link(icu::properties::props::Script::MeroiticHieroglyphs, EnumVariant)] + MeroiticHieroglyphs = 86, + #[diplomat::rust_link(icu::properties::props::Script::Miao, EnumVariant)] + Miao = 92, + #[diplomat::rust_link(icu::properties::props::Script::Modi, EnumVariant)] + Modi = 163, + #[diplomat::rust_link(icu::properties::props::Script::Mongolian, EnumVariant)] + Mongolian = 27, + #[diplomat::rust_link(icu::properties::props::Script::Mro, EnumVariant)] + Mro = 149, + #[diplomat::rust_link(icu::properties::props::Script::Multani, EnumVariant)] + Multani = 164, + #[diplomat::rust_link(icu::properties::props::Script::Myanmar, EnumVariant)] + Myanmar = 28, + #[diplomat::rust_link(icu::properties::props::Script::Nabataean, EnumVariant)] + Nabataean = 143, + #[diplomat::rust_link(icu::properties::props::Script::NagMundari, EnumVariant)] + NagMundari = 199, + #[diplomat::rust_link(icu::properties::props::Script::Nandinagari, EnumVariant)] + Nandinagari = 187, + #[diplomat::rust_link(icu::properties::props::Script::Nastaliq, EnumVariant)] + Nastaliq = 200, + #[diplomat::rust_link(icu::properties::props::Script::NewTaiLue, EnumVariant)] + NewTaiLue = 59, + #[diplomat::rust_link(icu::properties::props::Script::Newa, EnumVariant)] + Newa = 170, + #[diplomat::rust_link(icu::properties::props::Script::Nko, EnumVariant)] + Nko = 87, + #[diplomat::rust_link(icu::properties::props::Script::Nushu, EnumVariant)] + Nushu = 150, + #[diplomat::rust_link(icu::properties::props::Script::NyiakengPuachueHmong, EnumVariant)] + NyiakengPuachueHmong = 186, + #[diplomat::rust_link(icu::properties::props::Script::Ogham, EnumVariant)] + Ogham = 29, + #[diplomat::rust_link(icu::properties::props::Script::OlChiki, EnumVariant)] + OlChiki = 109, + #[diplomat::rust_link(icu::properties::props::Script::OldHungarian, EnumVariant)] + OldHungarian = 76, + #[diplomat::rust_link(icu::properties::props::Script::OldItalic, EnumVariant)] + OldItalic = 30, + #[diplomat::rust_link(icu::properties::props::Script::OldNorthArabian, EnumVariant)] + OldNorthArabian = 142, + #[diplomat::rust_link(icu::properties::props::Script::OldPermic, EnumVariant)] + OldPermic = 89, + #[diplomat::rust_link(icu::properties::props::Script::OldPersian, EnumVariant)] + OldPersian = 61, + #[diplomat::rust_link(icu::properties::props::Script::OldSogdian, EnumVariant)] + OldSogdian = 184, + #[diplomat::rust_link(icu::properties::props::Script::OldSouthArabian, EnumVariant)] + OldSouthArabian = 133, + #[diplomat::rust_link(icu::properties::props::Script::OldTurkic, EnumVariant)] + OldTurkic = 88, + #[diplomat::rust_link(icu::properties::props::Script::OldUyghur, EnumVariant)] + OldUyghur = 194, + #[diplomat::rust_link(icu::properties::props::Script::Oriya, EnumVariant)] + Oriya = 31, + #[diplomat::rust_link(icu::properties::props::Script::Osage, EnumVariant)] + Osage = 171, + #[diplomat::rust_link(icu::properties::props::Script::Osmanya, EnumVariant)] + Osmanya = 50, + #[diplomat::rust_link(icu::properties::props::Script::PahawhHmong, EnumVariant)] + PahawhHmong = 75, + #[diplomat::rust_link(icu::properties::props::Script::Palmyrene, EnumVariant)] + Palmyrene = 144, + #[diplomat::rust_link(icu::properties::props::Script::PauCinHau, EnumVariant)] + PauCinHau = 165, + #[diplomat::rust_link(icu::properties::props::Script::PhagsPa, EnumVariant)] + PhagsPa = 90, + #[diplomat::rust_link(icu::properties::props::Script::Phoenician, EnumVariant)] + Phoenician = 91, + #[diplomat::rust_link(icu::properties::props::Script::PsalterPahlavi, EnumVariant)] + PsalterPahlavi = 123, + #[diplomat::rust_link(icu::properties::props::Script::Rejang, EnumVariant)] + Rejang = 110, + #[diplomat::rust_link(icu::properties::props::Script::Runic, EnumVariant)] + Runic = 32, + #[diplomat::rust_link(icu::properties::props::Script::Samaritan, EnumVariant)] + Samaritan = 126, + #[diplomat::rust_link(icu::properties::props::Script::Saurashtra, EnumVariant)] + Saurashtra = 111, + #[diplomat::rust_link(icu::properties::props::Script::Sharada, EnumVariant)] + Sharada = 151, + #[diplomat::rust_link(icu::properties::props::Script::Shavian, EnumVariant)] + Shavian = 51, + #[diplomat::rust_link(icu::properties::props::Script::Siddham, EnumVariant)] + Siddham = 166, + #[diplomat::rust_link(icu::properties::props::Script::SignWriting, EnumVariant)] + SignWriting = 112, + #[diplomat::rust_link(icu::properties::props::Script::Sinhala, EnumVariant)] + Sinhala = 33, + #[diplomat::rust_link(icu::properties::props::Script::Sogdian, EnumVariant)] + Sogdian = 183, + #[diplomat::rust_link(icu::properties::props::Script::SoraSompeng, EnumVariant)] + SoraSompeng = 152, + #[diplomat::rust_link(icu::properties::props::Script::Soyombo, EnumVariant)] + Soyombo = 176, + #[diplomat::rust_link(icu::properties::props::Script::Sundanese, EnumVariant)] + Sundanese = 113, + #[diplomat::rust_link(icu::properties::props::Script::SylotiNagri, EnumVariant)] + SylotiNagri = 58, + #[diplomat::rust_link(icu::properties::props::Script::Syriac, EnumVariant)] + Syriac = 34, + #[diplomat::rust_link(icu::properties::props::Script::Tagalog, EnumVariant)] + Tagalog = 42, + #[diplomat::rust_link(icu::properties::props::Script::Tagbanwa, EnumVariant)] + Tagbanwa = 45, + #[diplomat::rust_link(icu::properties::props::Script::TaiLe, EnumVariant)] + TaiLe = 52, + #[diplomat::rust_link(icu::properties::props::Script::TaiTham, EnumVariant)] + TaiTham = 106, + #[diplomat::rust_link(icu::properties::props::Script::TaiViet, EnumVariant)] + TaiViet = 127, + #[diplomat::rust_link(icu::properties::props::Script::Takri, EnumVariant)] + Takri = 153, + #[diplomat::rust_link(icu::properties::props::Script::Tamil, EnumVariant)] + Tamil = 35, + #[diplomat::rust_link(icu::properties::props::Script::Tangsa, EnumVariant)] + Tangsa = 195, + #[diplomat::rust_link(icu::properties::props::Script::Tangut, EnumVariant)] + Tangut = 154, + #[diplomat::rust_link(icu::properties::props::Script::Telugu, EnumVariant)] + Telugu = 36, + #[diplomat::rust_link(icu::properties::props::Script::Thaana, EnumVariant)] + Thaana = 37, + #[diplomat::rust_link(icu::properties::props::Script::Thai, EnumVariant)] + Thai = 38, + #[diplomat::rust_link(icu::properties::props::Script::Tibetan, EnumVariant)] + Tibetan = 39, + #[diplomat::rust_link(icu::properties::props::Script::Tifinagh, EnumVariant)] + Tifinagh = 60, + #[diplomat::rust_link(icu::properties::props::Script::Tirhuta, EnumVariant)] + Tirhuta = 158, + #[diplomat::rust_link(icu::properties::props::Script::Toto, EnumVariant)] + Toto = 196, + #[diplomat::rust_link(icu::properties::props::Script::Ugaritic, EnumVariant)] + Ugaritic = 53, + #[diplomat::rust_link(icu::properties::props::Script::Unknown, EnumVariant)] + Unknown = 103, + #[diplomat::rust_link(icu::properties::props::Script::Vai, EnumVariant)] + Vai = 99, + #[diplomat::rust_link(icu::properties::props::Script::Vithkuqi, EnumVariant)] + Vithkuqi = 197, + #[diplomat::rust_link(icu::properties::props::Script::Wancho, EnumVariant)] + Wancho = 188, + #[diplomat::rust_link(icu::properties::props::Script::WarangCiti, EnumVariant)] + WarangCiti = 146, + #[diplomat::rust_link(icu::properties::props::Script::Yezidi, EnumVariant)] + Yezidi = 192, + #[diplomat::rust_link(icu::properties::props::Script::Yi, EnumVariant)] + Yi = 41, + #[diplomat::rust_link(icu::properties::props::Script::ZanabazarSquare, EnumVariant)] + ZanabazarSquare = 177, + } + + impl Script { + pub fn to_integer(self) -> u16 { + self as u16 + } + pub fn from_integer(other: u16) -> Option { + Some(match other { + 167 => Self::Adlam, + 161 => Self::Ahom, + 156 => Self::AnatolianHieroglyphs, + 2 => Self::Arabic, + 3 => Self::Armenian, + 117 => Self::Avestan, + 62 => Self::Balinese, + 130 => Self::Bamum, + 134 => Self::BassaVah, + 63 => Self::Batak, + 4 => Self::Bengali, + 168 => Self::Bhaiksuki, + 5 => Self::Bopomofo, + 65 => Self::Brahmi, + 46 => Self::Braille, + 55 => Self::Buginese, + 44 => Self::Buhid, + 40 => Self::CanadianAboriginal, + 104 => Self::Carian, + 159 => Self::CaucasianAlbanian, + 118 => Self::Chakma, + 66 => Self::Cham, + 6 => Self::Cherokee, + 189 => Self::Chorasmian, + 0 => Self::Common, + 7 => Self::Coptic, + 101 => Self::Cuneiform, + 47 => Self::Cypriot, + 193 => Self::CyproMinoan, + 8 => Self::Cyrillic, + 9 => Self::Deseret, + 10 => Self::Devanagari, + 190 => Self::DivesAkuru, + 178 => Self::Dogra, + 135 => Self::Duployan, + 71 => Self::EgyptianHieroglyphs, + 136 => Self::Elbasan, + 185 => Self::Elymaic, + 11 => Self::Ethiopian, + 12 => Self::Georgian, + 56 => Self::Glagolitic, + 13 => Self::Gothic, + 137 => Self::Grantha, + 14 => Self::Greek, + 15 => Self::Gujarati, + 179 => Self::GunjalaGondi, + 16 => Self::Gurmukhi, + 17 => Self::Han, + 18 => Self::Hangul, + 182 => Self::HanifiRohingya, + 43 => Self::Hanunoo, + 162 => Self::Hatran, + 19 => Self::Hebrew, + 20 => Self::Hiragana, + 116 => Self::ImperialAramaic, + 1 => Self::Inherited, + 122 => Self::InscriptionalPahlavi, + 125 => Self::InscriptionalParthian, + 78 => Self::Javanese, + 120 => Self::Kaithi, + 21 => Self::Kannada, + 22 => Self::Katakana, + 198 => Self::Kawi, + 79 => Self::KayahLi, + 57 => Self::Kharoshthi, + 191 => Self::KhitanSmallScript, + 23 => Self::Khmer, + 157 => Self::Khojki, + 145 => Self::Khudawadi, + 24 => Self::Lao, + 25 => Self::Latin, + 82 => Self::Lepcha, + 48 => Self::Limbu, + 83 => Self::LinearA, + 49 => Self::LinearB, + 131 => Self::Lisu, + 107 => Self::Lycian, + 108 => Self::Lydian, + 160 => Self::Mahajani, + 180 => Self::Makasar, + 26 => Self::Malayalam, + 84 => Self::Mandaic, + 121 => Self::Manichaean, + 169 => Self::Marchen, + 175 => Self::MasaramGondi, + 181 => Self::Medefaidrin, + 115 => Self::MeeteiMayek, + 140 => Self::MendeKikakui, + 141 => Self::MeroiticCursive, + 86 => Self::MeroiticHieroglyphs, + 92 => Self::Miao, + 163 => Self::Modi, + 27 => Self::Mongolian, + 149 => Self::Mro, + 164 => Self::Multani, + 28 => Self::Myanmar, + 143 => Self::Nabataean, + 199 => Self::NagMundari, + 187 => Self::Nandinagari, + 200 => Self::Nastaliq, + 59 => Self::NewTaiLue, + 170 => Self::Newa, + 87 => Self::Nko, + 150 => Self::Nushu, + 186 => Self::NyiakengPuachueHmong, + 29 => Self::Ogham, + 109 => Self::OlChiki, + 76 => Self::OldHungarian, + 30 => Self::OldItalic, + 142 => Self::OldNorthArabian, + 89 => Self::OldPermic, + 61 => Self::OldPersian, + 184 => Self::OldSogdian, + 133 => Self::OldSouthArabian, + 88 => Self::OldTurkic, + 194 => Self::OldUyghur, + 31 => Self::Oriya, + 171 => Self::Osage, + 50 => Self::Osmanya, + 75 => Self::PahawhHmong, + 144 => Self::Palmyrene, + 165 => Self::PauCinHau, + 90 => Self::PhagsPa, + 91 => Self::Phoenician, + 123 => Self::PsalterPahlavi, + 110 => Self::Rejang, + 32 => Self::Runic, + 126 => Self::Samaritan, + 111 => Self::Saurashtra, + 151 => Self::Sharada, + 51 => Self::Shavian, + 166 => Self::Siddham, + 112 => Self::SignWriting, + 33 => Self::Sinhala, + 183 => Self::Sogdian, + 152 => Self::SoraSompeng, + 176 => Self::Soyombo, + 113 => Self::Sundanese, + 58 => Self::SylotiNagri, + 34 => Self::Syriac, + 42 => Self::Tagalog, + 45 => Self::Tagbanwa, + 52 => Self::TaiLe, + 106 => Self::TaiTham, + 127 => Self::TaiViet, + 153 => Self::Takri, + 35 => Self::Tamil, + 195 => Self::Tangsa, + 154 => Self::Tangut, + 36 => Self::Telugu, + 37 => Self::Thaana, + 38 => Self::Thai, + 39 => Self::Tibetan, + 60 => Self::Tifinagh, + 158 => Self::Tirhuta, + 196 => Self::Toto, + 53 => Self::Ugaritic, + 103 => Self::Unknown, + 99 => Self::Vai, + 197 => Self::Vithkuqi, + 188 => Self::Wancho, + 146 => Self::WarangCiti, + 192 => Self::Yezidi, + 41 => Self::Yi, + 177 => Self::ZanabazarSquare, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::HangulSyllableType, Struct)] + #[diplomat::enum_convert(icu_properties::props::HangulSyllableType, needs_wildcard)] + pub enum HangulSyllableType { + #[diplomat::rust_link( + icu::properties::props::HangulSyllableType::NotApplicable, + EnumVariant + )] + NotApplicable = 0, + #[diplomat::rust_link( + icu::properties::props::HangulSyllableType::LeadingJamo, + EnumVariant + )] + LeadingJamo = 1, + #[diplomat::rust_link(icu::properties::props::HangulSyllableType::VowelJamo, EnumVariant)] + VowelJamo = 2, + #[diplomat::rust_link( + icu::properties::props::HangulSyllableType::TrailingJamo, + EnumVariant + )] + TrailingJamo = 3, + #[diplomat::rust_link( + icu::properties::props::HangulSyllableType::LeadingVowelSyllable, + EnumVariant + )] + LeadingVowelSyllable = 4, + #[diplomat::rust_link( + icu::properties::props::HangulSyllableType::LeadingVowelTrailingSyllable, + EnumVariant + )] + LeadingVowelTrailingSyllable = 5, + } + + impl HangulSyllableType { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::NotApplicable, + 1 => Self::LeadingJamo, + 2 => Self::VowelJamo, + 3 => Self::TrailingJamo, + 4 => Self::LeadingVowelSyllable, + 5 => Self::LeadingVowelTrailingSyllable, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::EastAsianWidth, Struct)] + #[diplomat::enum_convert(icu_properties::props::EastAsianWidth, needs_wildcard)] + pub enum EastAsianWidth { + #[diplomat::rust_link(icu::properties::props::EastAsianWidth::Neutral, EnumVariant)] + Neutral = 0, + #[diplomat::rust_link(icu::properties::props::EastAsianWidth::Ambiguous, EnumVariant)] + Ambiguous = 1, + #[diplomat::rust_link(icu::properties::props::EastAsianWidth::Halfwidth, EnumVariant)] + Halfwidth = 2, + #[diplomat::rust_link(icu::properties::props::EastAsianWidth::Fullwidth, EnumVariant)] + Fullwidth = 3, + #[diplomat::rust_link(icu::properties::props::EastAsianWidth::Narrow, EnumVariant)] + Narrow = 4, + #[diplomat::rust_link(icu::properties::props::EastAsianWidth::Wide, EnumVariant)] + Wide = 5, + } + + impl EastAsianWidth { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::Neutral, + 1 => Self::Ambiguous, + 2 => Self::Halfwidth, + 3 => Self::Fullwidth, + 4 => Self::Narrow, + 5 => Self::Wide, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::LineBreak, Struct)] + #[diplomat::enum_convert(icu_properties::props::LineBreak, needs_wildcard)] + pub enum LineBreak { + #[diplomat::rust_link(icu::props::LineBreak::Unknown, EnumVariant)] + Unknown = 0, + #[diplomat::rust_link(icu::props::LineBreak::Ambiguous, EnumVariant)] + Ambiguous = 1, + #[diplomat::rust_link(icu::props::LineBreak::Alphabetic, EnumVariant)] + Alphabetic = 2, + #[diplomat::rust_link(icu::props::LineBreak::BreakBoth, EnumVariant)] + BreakBoth = 3, + #[diplomat::rust_link(icu::props::LineBreak::BreakAfter, EnumVariant)] + BreakAfter = 4, + #[diplomat::rust_link(icu::props::LineBreak::BreakBefore, EnumVariant)] + BreakBefore = 5, + #[diplomat::rust_link(icu::props::LineBreak::MandatoryBreak, EnumVariant)] + MandatoryBreak = 6, + #[diplomat::rust_link(icu::props::LineBreak::ContingentBreak, EnumVariant)] + ContingentBreak = 7, + #[diplomat::rust_link(icu::props::LineBreak::ClosePunctuation, EnumVariant)] + ClosePunctuation = 8, + #[diplomat::rust_link(icu::props::LineBreak::CombiningMark, EnumVariant)] + CombiningMark = 9, + #[diplomat::rust_link(icu::props::LineBreak::CarriageReturn, EnumVariant)] + CarriageReturn = 10, + #[diplomat::rust_link(icu::props::LineBreak::Exclamation, EnumVariant)] + Exclamation = 11, + #[diplomat::rust_link(icu::props::LineBreak::Glue, EnumVariant)] + Glue = 12, + #[diplomat::rust_link(icu::props::LineBreak::Hyphen, EnumVariant)] + Hyphen = 13, + #[diplomat::rust_link(icu::props::LineBreak::Ideographic, EnumVariant)] + Ideographic = 14, + #[diplomat::rust_link(icu::props::LineBreak::Inseparable, EnumVariant)] + Inseparable = 15, + #[diplomat::rust_link(icu::props::LineBreak::InfixNumeric, EnumVariant)] + InfixNumeric = 16, + #[diplomat::rust_link(icu::props::LineBreak::LineFeed, EnumVariant)] + LineFeed = 17, + #[diplomat::rust_link(icu::props::LineBreak::Nonstarter, EnumVariant)] + Nonstarter = 18, + #[diplomat::rust_link(icu::props::LineBreak::Numeric, EnumVariant)] + Numeric = 19, + #[diplomat::rust_link(icu::props::LineBreak::OpenPunctuation, EnumVariant)] + OpenPunctuation = 20, + #[diplomat::rust_link(icu::props::LineBreak::PostfixNumeric, EnumVariant)] + PostfixNumeric = 21, + #[diplomat::rust_link(icu::props::LineBreak::PrefixNumeric, EnumVariant)] + PrefixNumeric = 22, + #[diplomat::rust_link(icu::props::LineBreak::Quotation, EnumVariant)] + Quotation = 23, + #[diplomat::rust_link(icu::props::LineBreak::ComplexContext, EnumVariant)] + ComplexContext = 24, + #[diplomat::rust_link(icu::props::LineBreak::Surrogate, EnumVariant)] + Surrogate = 25, + #[diplomat::rust_link(icu::props::LineBreak::Space, EnumVariant)] + Space = 26, + #[diplomat::rust_link(icu::props::LineBreak::BreakSymbols, EnumVariant)] + BreakSymbols = 27, + #[diplomat::rust_link(icu::props::LineBreak::ZWSpace, EnumVariant)] + ZWSpace = 28, + #[diplomat::rust_link(icu::props::LineBreak::NextLine, EnumVariant)] + NextLine = 29, + #[diplomat::rust_link(icu::props::LineBreak::WordJoiner, EnumVariant)] + WordJoiner = 30, + #[diplomat::rust_link(icu::props::LineBreak::H2, EnumVariant)] + H2 = 31, + #[diplomat::rust_link(icu::props::LineBreak::H3, EnumVariant)] + H3 = 32, + #[diplomat::rust_link(icu::props::LineBreak::JL, EnumVariant)] + JL = 33, + #[diplomat::rust_link(icu::props::LineBreak::JT, EnumVariant)] + JT = 34, + #[diplomat::rust_link(icu::props::LineBreak::JV, EnumVariant)] + JV = 35, + #[diplomat::rust_link(icu::props::LineBreak::CloseParenthesis, EnumVariant)] + CloseParenthesis = 36, + #[diplomat::rust_link(icu::props::LineBreak::ConditionalJapaneseStarter, EnumVariant)] + ConditionalJapaneseStarter = 37, + #[diplomat::rust_link(icu::props::LineBreak::HebrewLetter, EnumVariant)] + HebrewLetter = 38, + #[diplomat::rust_link(icu::props::LineBreak::RegionalIndicator, EnumVariant)] + RegionalIndicator = 39, + #[diplomat::rust_link(icu::props::LineBreak::EBase, EnumVariant)] + EBase = 40, + #[diplomat::rust_link(icu::props::LineBreak::EModifier, EnumVariant)] + EModifier = 41, + #[diplomat::rust_link(icu::props::LineBreak::ZWJ, EnumVariant)] + ZWJ = 42, + #[diplomat::rust_link(icu::props::LineBreak::Aksara, EnumVariant)] + Aksara = 43, + #[diplomat::rust_link(icu::props::LineBreak::AksaraPrebase, EnumVariant)] + AksaraPrebase = 44, + #[diplomat::rust_link(icu::props::LineBreak::AksaraStart, EnumVariant)] + AksaraStart = 45, + #[diplomat::rust_link(icu::props::LineBreak::ViramaFinal, EnumVariant)] + ViramaFinal = 46, + #[diplomat::rust_link(icu::props::LineBreak::Virama, EnumVariant)] + Virama = 47, + } + + impl LineBreak { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::Unknown, + 1 => Self::Ambiguous, + 2 => Self::Alphabetic, + 3 => Self::BreakBoth, + 4 => Self::BreakAfter, + 5 => Self::BreakBefore, + 6 => Self::MandatoryBreak, + 7 => Self::ContingentBreak, + 8 => Self::ClosePunctuation, + 9 => Self::CombiningMark, + 10 => Self::CarriageReturn, + 11 => Self::Exclamation, + 12 => Self::Glue, + 13 => Self::Hyphen, + 14 => Self::Ideographic, + 15 => Self::Inseparable, + 16 => Self::InfixNumeric, + 17 => Self::LineFeed, + 18 => Self::Nonstarter, + 19 => Self::Numeric, + 20 => Self::OpenPunctuation, + 21 => Self::PostfixNumeric, + 22 => Self::PrefixNumeric, + 23 => Self::Quotation, + 24 => Self::ComplexContext, + 25 => Self::Surrogate, + 26 => Self::Space, + 27 => Self::BreakSymbols, + 28 => Self::ZWSpace, + 29 => Self::NextLine, + 30 => Self::WordJoiner, + 31 => Self::H2, + 32 => Self::H3, + 33 => Self::JL, + 34 => Self::JT, + 35 => Self::JV, + 36 => Self::CloseParenthesis, + 37 => Self::ConditionalJapaneseStarter, + 38 => Self::HebrewLetter, + 39 => Self::RegionalIndicator, + 40 => Self::EBase, + 41 => Self::EModifier, + 42 => Self::ZWJ, + 43 => Self::Aksara, + 44 => Self::AksaraPrebase, + 45 => Self::AksaraStart, + 46 => Self::ViramaFinal, + 47 => Self::Virama, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::GraphemeClusterBreak, Struct)] + #[diplomat::enum_convert(icu_properties::props::GraphemeClusterBreak, needs_wildcard)] + pub enum GraphemeClusterBreak { + #[diplomat::rust_link(icu::properties::props::LineBreak::Other, EnumVariant)] + Other = 0, + #[diplomat::rust_link(icu::properties::props::LineBreak::Control, EnumVariant)] + Control = 1, + #[diplomat::rust_link(icu::properties::props::LineBreak::CR, EnumVariant)] + CR = 2, + #[diplomat::rust_link(icu::properties::props::LineBreak::Extend, EnumVariant)] + Extend = 3, + #[diplomat::rust_link(icu::properties::props::LineBreak::L, EnumVariant)] + L = 4, + #[diplomat::rust_link(icu::properties::props::LineBreak::LF, EnumVariant)] + LF = 5, + #[diplomat::rust_link(icu::properties::props::LineBreak::LV, EnumVariant)] + LV = 6, + #[diplomat::rust_link(icu::properties::props::LineBreak::LVT, EnumVariant)] + LVT = 7, + #[diplomat::rust_link(icu::properties::props::LineBreak::T, EnumVariant)] + T = 8, + #[diplomat::rust_link(icu::properties::props::LineBreak::V, EnumVariant)] + V = 9, + #[diplomat::rust_link(icu::properties::props::LineBreak::SpacingMark, EnumVariant)] + SpacingMark = 10, + #[diplomat::rust_link(icu::properties::props::LineBreak::Prepend, EnumVariant)] + Prepend = 11, + #[diplomat::rust_link(icu::properties::props::LineBreak::RegionalIndicator, EnumVariant)] + RegionalIndicator = 12, + #[diplomat::rust_link(icu::properties::props::LineBreak::EBase, EnumVariant)] + EBase = 13, + #[diplomat::rust_link(icu::properties::props::LineBreak::EBaseGAZ, EnumVariant)] + EBaseGAZ = 14, + #[diplomat::rust_link(icu::properties::props::LineBreak::EModifier, EnumVariant)] + EModifier = 15, + #[diplomat::rust_link(icu::properties::props::LineBreak::GlueAfterZwj, EnumVariant)] + GlueAfterZwj = 16, + #[diplomat::rust_link(icu::properties::props::LineBreak::ZWJ, EnumVariant)] + ZWJ = 17, + } + + impl GraphemeClusterBreak { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::Other, + 1 => Self::Control, + 2 => Self::CR, + 3 => Self::Extend, + 4 => Self::L, + 5 => Self::LF, + 6 => Self::LV, + 7 => Self::LVT, + 8 => Self::T, + 9 => Self::V, + 10 => Self::SpacingMark, + 11 => Self::Prepend, + 12 => Self::RegionalIndicator, + 13 => Self::EBase, + 14 => Self::EBaseGAZ, + 15 => Self::EModifier, + 16 => Self::GlueAfterZwj, + 17 => Self::ZWJ, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::WordBreak, Struct)] + #[diplomat::enum_convert(icu_properties::props::WordBreak, needs_wildcard)] + pub enum WordBreak { + #[diplomat::rust_link(icu::properties::props::WordBreak::Other, EnumVariant)] + Other = 0, + #[diplomat::rust_link(icu::properties::props::WordBreak::ALetter, EnumVariant)] + ALetter = 1, + #[diplomat::rust_link(icu::properties::props::WordBreak::Format, EnumVariant)] + Format = 2, + #[diplomat::rust_link(icu::properties::props::WordBreak::Katakana, EnumVariant)] + Katakana = 3, + #[diplomat::rust_link(icu::properties::props::WordBreak::MidLetter, EnumVariant)] + MidLetter = 4, + #[diplomat::rust_link(icu::properties::props::WordBreak::MidNum, EnumVariant)] + MidNum = 5, + #[diplomat::rust_link(icu::properties::props::WordBreak::Numeric, EnumVariant)] + Numeric = 6, + #[diplomat::rust_link(icu::properties::props::WordBreak::ExtendNumLet, EnumVariant)] + ExtendNumLet = 7, + #[diplomat::rust_link(icu::properties::props::WordBreak::CR, EnumVariant)] + CR = 8, + #[diplomat::rust_link(icu::properties::props::WordBreak::Extend, EnumVariant)] + Extend = 9, + #[diplomat::rust_link(icu::properties::props::WordBreak::LF, EnumVariant)] + LF = 10, + #[diplomat::rust_link(icu::properties::props::WordBreak::MidNumLet, EnumVariant)] + MidNumLet = 11, + #[diplomat::rust_link(icu::properties::props::WordBreak::Newline, EnumVariant)] + Newline = 12, + #[diplomat::rust_link(icu::properties::props::WordBreak::RegionalIndicator, EnumVariant)] + RegionalIndicator = 13, + #[diplomat::rust_link(icu::properties::props::WordBreak::HebrewLetter, EnumVariant)] + HebrewLetter = 14, + #[diplomat::rust_link(icu::properties::props::WordBreak::SingleQuote, EnumVariant)] + SingleQuote = 15, + #[diplomat::rust_link(icu::properties::props::WordBreak::DoubleQuote, EnumVariant)] + DoubleQuote = 16, + #[diplomat::rust_link(icu::properties::props::WordBreak::EBase, EnumVariant)] + EBase = 17, + #[diplomat::rust_link(icu::properties::props::WordBreak::EBaseGAZ, EnumVariant)] + EBaseGAZ = 18, + #[diplomat::rust_link(icu::properties::props::WordBreak::EModifier, EnumVariant)] + EModifier = 19, + #[diplomat::rust_link(icu::properties::props::WordBreak::GlueAfterZwj, EnumVariant)] + GlueAfterZwj = 20, + #[diplomat::rust_link(icu::properties::props::WordBreak::ZWJ, EnumVariant)] + ZWJ = 21, + #[diplomat::rust_link(icu::properties::props::WordBreak::WSegSpace, EnumVariant)] + WSegSpace = 22, + } + + impl WordBreak { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::Other, + 1 => Self::ALetter, + 2 => Self::Format, + 3 => Self::Katakana, + 4 => Self::MidLetter, + 5 => Self::MidNum, + 6 => Self::Numeric, + 7 => Self::ExtendNumLet, + 8 => Self::CR, + 9 => Self::Extend, + 10 => Self::LF, + 11 => Self::MidNumLet, + 12 => Self::Newline, + 13 => Self::RegionalIndicator, + 14 => Self::HebrewLetter, + 15 => Self::SingleQuote, + 16 => Self::DoubleQuote, + 17 => Self::EBase, + 18 => Self::EBaseGAZ, + 19 => Self::EModifier, + 20 => Self::GlueAfterZwj, + 21 => Self::ZWJ, + 22 => Self::WSegSpace, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::SentenceBreak, Struct)] + #[diplomat::enum_convert(icu_properties::props::SentenceBreak, needs_wildcard)] + pub enum SentenceBreak { + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Other, EnumVariant)] + Other = 0, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::ATerm, EnumVariant)] + ATerm = 1, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Close, EnumVariant)] + Close = 2, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Format, EnumVariant)] + Format = 3, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Lower, EnumVariant)] + Lower = 4, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Numeric, EnumVariant)] + Numeric = 5, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::OLetter, EnumVariant)] + OLetter = 6, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Sep, EnumVariant)] + Sep = 7, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Sp, EnumVariant)] + Sp = 8, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::STerm, EnumVariant)] + STerm = 9, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Upper, EnumVariant)] + Upper = 10, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::CR, EnumVariant)] + CR = 11, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::Extend, EnumVariant)] + Extend = 12, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::LF, EnumVariant)] + LF = 13, + #[diplomat::rust_link(icu::properties::props::SentenceBreak::SContinue, EnumVariant)] + SContinue = 14, + } + + impl SentenceBreak { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::Other, + 1 => Self::ATerm, + 2 => Self::Close, + 3 => Self::Format, + 4 => Self::Lower, + 5 => Self::Numeric, + 6 => Self::OLetter, + 7 => Self::Sep, + 8 => Self::Sp, + 9 => Self::STerm, + 10 => Self::Upper, + 11 => Self::CR, + 12 => Self::Extend, + 13 => Self::LF, + 14 => Self::SContinue, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass, Struct)] + #[diplomat::enum_convert(icu_properties::props::CanonicalCombiningClass, needs_wildcard)] + pub enum CanonicalCombiningClass { + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::NotReordered, + EnumVariant + )] + NotReordered = 0, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::Overlay, + EnumVariant + )] + Overlay = 1, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::HanReading, + EnumVariant + )] + HanReading = 6, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::Nukta, EnumVariant)] + Nukta = 7, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::KanaVoicing, + EnumVariant + )] + KanaVoicing = 8, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::Virama, + EnumVariant + )] + Virama = 9, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC10, EnumVariant)] + CCC10 = 10, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC11, EnumVariant)] + CCC11 = 11, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC12, EnumVariant)] + CCC12 = 12, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC13, EnumVariant)] + CCC13 = 13, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC14, EnumVariant)] + CCC14 = 14, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC15, EnumVariant)] + CCC15 = 15, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC16, EnumVariant)] + CCC16 = 16, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC17, EnumVariant)] + CCC17 = 17, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC18, EnumVariant)] + CCC18 = 18, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC19, EnumVariant)] + CCC19 = 19, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC20, EnumVariant)] + CCC20 = 20, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC21, EnumVariant)] + CCC21 = 21, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC22, EnumVariant)] + CCC22 = 22, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC23, EnumVariant)] + CCC23 = 23, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC24, EnumVariant)] + CCC24 = 24, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC25, EnumVariant)] + CCC25 = 25, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC26, EnumVariant)] + CCC26 = 26, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC27, EnumVariant)] + CCC27 = 27, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC28, EnumVariant)] + CCC28 = 28, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC29, EnumVariant)] + CCC29 = 29, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC30, EnumVariant)] + CCC30 = 30, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC31, EnumVariant)] + CCC31 = 31, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC32, EnumVariant)] + CCC32 = 32, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC33, EnumVariant)] + CCC33 = 33, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC34, EnumVariant)] + CCC34 = 34, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC35, EnumVariant)] + CCC35 = 35, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC36, EnumVariant)] + CCC36 = 36, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC84, EnumVariant)] + CCC84 = 84, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::CCC91, EnumVariant)] + CCC91 = 91, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC103, + EnumVariant + )] + CCC103 = 103, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC107, + EnumVariant + )] + CCC107 = 107, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC118, + EnumVariant + )] + CCC118 = 118, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC122, + EnumVariant + )] + CCC122 = 122, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC129, + EnumVariant + )] + CCC129 = 129, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC130, + EnumVariant + )] + CCC130 = 130, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC132, + EnumVariant + )] + CCC132 = 132, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::CCC133, + EnumVariant + )] + CCC133 = 133, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::AttachedBelowLeft, + EnumVariant + )] + AttachedBelowLeft = 200, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::AttachedBelow, + EnumVariant + )] + AttachedBelow = 202, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::AttachedAbove, + EnumVariant + )] + AttachedAbove = 214, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::AttachedAboveRight, + EnumVariant + )] + AttachedAboveRight = 216, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::BelowLeft, + EnumVariant + )] + BelowLeft = 218, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::Below, EnumVariant)] + Below = 220, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::BelowRight, + EnumVariant + )] + BelowRight = 222, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::Left, EnumVariant)] + Left = 224, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::Right, EnumVariant)] + Right = 226, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::AboveLeft, + EnumVariant + )] + AboveLeft = 228, + #[diplomat::rust_link(icu::properties::props::CanonicalCombiningClass::Above, EnumVariant)] + Above = 230, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::AboveRight, + EnumVariant + )] + AboveRight = 232, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::DoubleBelow, + EnumVariant + )] + DoubleBelow = 233, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::DoubleAbove, + EnumVariant + )] + DoubleAbove = 234, + #[diplomat::rust_link( + icu::properties::props::CanonicalCombiningClass::IotaSubscript, + EnumVariant + )] + IotaSubscript = 240, + } + + impl CanonicalCombiningClass { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::NotReordered, + 1 => Self::Overlay, + 6 => Self::HanReading, + 7 => Self::Nukta, + 8 => Self::KanaVoicing, + 9 => Self::Virama, + 10 => Self::CCC10, + 11 => Self::CCC11, + 12 => Self::CCC12, + 13 => Self::CCC13, + 14 => Self::CCC14, + 15 => Self::CCC15, + 16 => Self::CCC16, + 17 => Self::CCC17, + 18 => Self::CCC18, + 19 => Self::CCC19, + 20 => Self::CCC20, + 21 => Self::CCC21, + 22 => Self::CCC22, + 23 => Self::CCC23, + 24 => Self::CCC24, + 25 => Self::CCC25, + 26 => Self::CCC26, + 27 => Self::CCC27, + 28 => Self::CCC28, + 29 => Self::CCC29, + 30 => Self::CCC30, + 31 => Self::CCC31, + 32 => Self::CCC32, + 33 => Self::CCC33, + 34 => Self::CCC34, + 35 => Self::CCC35, + 36 => Self::CCC36, + 84 => Self::CCC84, + 91 => Self::CCC91, + 103 => Self::CCC103, + 107 => Self::CCC107, + 118 => Self::CCC118, + 122 => Self::CCC122, + 129 => Self::CCC129, + 130 => Self::CCC130, + 132 => Self::CCC132, + 133 => Self::CCC133, + 200 => Self::AttachedBelowLeft, + 202 => Self::AttachedBelow, + 214 => Self::AttachedAbove, + 216 => Self::AttachedAboveRight, + 218 => Self::BelowLeft, + 220 => Self::Below, + 222 => Self::BelowRight, + 224 => Self::Left, + 226 => Self::Right, + 228 => Self::AboveLeft, + 230 => Self::Above, + 232 => Self::AboveRight, + 233 => Self::DoubleBelow, + 234 => Self::DoubleAbove, + 240 => Self::IotaSubscript, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory, Struct)] + #[diplomat::enum_convert(icu_properties::props::IndicSyllabicCategory, needs_wildcard)] + pub enum IndicSyllabicCategory { + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Other, EnumVariant)] + Other = 0, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::Avagraha, + EnumVariant + )] + Avagraha = 1, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Bindu, EnumVariant)] + Bindu = 2, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::BrahmiJoiningNumber, + EnumVariant + )] + BrahmiJoiningNumber = 3, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::CantillationMark, + EnumVariant + )] + CantillationMark = 4, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::Consonant, + EnumVariant + )] + Consonant = 5, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantDead, + EnumVariant + )] + ConsonantDead = 6, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantFinal, + EnumVariant + )] + ConsonantFinal = 7, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantHeadLetter, + EnumVariant + )] + ConsonantHeadLetter = 8, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantInitialPostfixed, + EnumVariant + )] + ConsonantInitialPostfixed = 9, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantKiller, + EnumVariant + )] + ConsonantKiller = 10, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantMedial, + EnumVariant + )] + ConsonantMedial = 11, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantPlaceholder, + EnumVariant + )] + ConsonantPlaceholder = 12, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantPrecedingRepha, + EnumVariant + )] + ConsonantPrecedingRepha = 13, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantPrefixed, + EnumVariant + )] + ConsonantPrefixed = 14, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantSucceedingRepha, + EnumVariant + )] + ConsonantSucceedingRepha = 15, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantSubjoined, + EnumVariant + )] + ConsonantSubjoined = 16, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ConsonantWithStacker, + EnumVariant + )] + ConsonantWithStacker = 17, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::GeminationMark, + EnumVariant + )] + GeminationMark = 18, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::InvisibleStacker, + EnumVariant + )] + InvisibleStacker = 19, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Joiner, EnumVariant)] + Joiner = 20, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ModifyingLetter, + EnumVariant + )] + ModifyingLetter = 21, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::NonJoiner, + EnumVariant + )] + NonJoiner = 22, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Nukta, EnumVariant)] + Nukta = 23, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Number, EnumVariant)] + Number = 24, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::NumberJoiner, + EnumVariant + )] + NumberJoiner = 25, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::PureKiller, + EnumVariant + )] + PureKiller = 26, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::RegisterShifter, + EnumVariant + )] + RegisterShifter = 27, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::SyllableModifier, + EnumVariant + )] + SyllableModifier = 28, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ToneLetter, + EnumVariant + )] + ToneLetter = 29, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ToneMark, + EnumVariant + )] + ToneMark = 30, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Virama, EnumVariant)] + Virama = 31, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Visarga, EnumVariant)] + Visarga = 32, + #[diplomat::rust_link(icu::properties::props::IndicSyllabicCategory::Vowel, EnumVariant)] + Vowel = 33, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::VowelDependent, + EnumVariant + )] + VowelDependent = 34, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::VowelIndependent, + EnumVariant + )] + VowelIndependent = 35, + #[diplomat::rust_link( + icu::properties::props::IndicSyllabicCategory::ReorderingKiller, + EnumVariant + )] + ReorderingKiller = 36, + } + + impl IndicSyllabicCategory { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::Other, + 1 => Self::Avagraha, + 2 => Self::Bindu, + 3 => Self::BrahmiJoiningNumber, + 4 => Self::CantillationMark, + 5 => Self::Consonant, + 6 => Self::ConsonantDead, + 7 => Self::ConsonantFinal, + 8 => Self::ConsonantHeadLetter, + 9 => Self::ConsonantInitialPostfixed, + 10 => Self::ConsonantKiller, + 11 => Self::ConsonantMedial, + 12 => Self::ConsonantPlaceholder, + 13 => Self::ConsonantPrecedingRepha, + 14 => Self::ConsonantPrefixed, + 15 => Self::ConsonantSucceedingRepha, + 16 => Self::ConsonantSubjoined, + 17 => Self::ConsonantWithStacker, + 18 => Self::GeminationMark, + 19 => Self::InvisibleStacker, + 20 => Self::Joiner, + 21 => Self::ModifyingLetter, + 22 => Self::NonJoiner, + 23 => Self::Nukta, + 24 => Self::Number, + 25 => Self::NumberJoiner, + 26 => Self::PureKiller, + 27 => Self::RegisterShifter, + 28 => Self::SyllableModifier, + 29 => Self::ToneLetter, + 30 => Self::ToneMark, + 31 => Self::Virama, + 32 => Self::Visarga, + 33 => Self::Vowel, + 34 => Self::VowelDependent, + 35 => Self::VowelIndependent, + 36 => Self::ReorderingKiller, + _ => return None, + }) + } + } + + #[diplomat::rust_link(icu::properties::props::JoiningType, Struct)] + #[diplomat::enum_convert(icu_properties::props::JoiningType, needs_wildcard)] + pub enum JoiningType { + #[diplomat::rust_link(icu::properties::props::JoiningType::NonJoining, EnumVariant)] + NonJoining = 0, + #[diplomat::rust_link(icu::properties::props::JoiningType::JoinCausing, EnumVariant)] + JoinCausing = 1, + #[diplomat::rust_link(icu::properties::props::JoiningType::DualJoining, EnumVariant)] + DualJoining = 2, + #[diplomat::rust_link(icu::properties::props::JoiningType::LeftJoining, EnumVariant)] + LeftJoining = 3, + #[diplomat::rust_link(icu::properties::props::JoiningType::RightJoining, EnumVariant)] + RightJoining = 4, + #[diplomat::rust_link(icu::properties::props::JoiningType::Transparent, EnumVariant)] + Transparent = 5, + } + + impl JoiningType { + pub fn to_integer(self) -> u8 { + self as u8 + } + pub fn from_integer(other: u8) -> Option { + Some(match other { + 0 => Self::NonJoining, + 1 => Self::JoinCausing, + 2 => Self::DualJoining, + 3 => Self::LeftJoining, + 4 => Self::RightJoining, + 5 => Self::Transparent, + _ => return None, + }) + } + } +} + +#[cfg(test)] +mod test { + use super::ffi::*; + use icu_properties::props; + + #[test] + fn test_all_cases_covered() { + for prop in props::BidiClass::ALL_VALUES { + let ffi_prop = BidiClass::from_integer(prop.0) + .expect("Found BidiClass value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::BidiClass::from(ffi_prop)); + } + + for prop in props::Script::ALL_VALUES { + let ffi_prop = + Script::from_integer(prop.0).expect("Found Script value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::Script::from(ffi_prop)); + } + + for prop in props::HangulSyllableType::ALL_VALUES { + let ffi_prop = HangulSyllableType::from_integer(prop.0) + .expect("Found HangulSyllableType value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::HangulSyllableType::from(ffi_prop)); + } + for prop in props::EastAsianWidth::ALL_VALUES { + let ffi_prop = EastAsianWidth::from_integer(prop.0) + .expect("Found EastAsianWidth value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::EastAsianWidth::from(ffi_prop)); + } + for prop in props::LineBreak::ALL_VALUES { + let ffi_prop = LineBreak::from_integer(prop.0) + .expect("Found LineBreak value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::LineBreak::from(ffi_prop)); + } + for prop in props::GraphemeClusterBreak::ALL_VALUES { + let ffi_prop = GraphemeClusterBreak::from_integer(prop.0) + .expect("Found GraphemeClusterBreak value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::GraphemeClusterBreak::from(ffi_prop)); + } + for prop in props::WordBreak::ALL_VALUES { + let ffi_prop = WordBreak::from_integer(prop.0) + .expect("Found WordBreak value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::WordBreak::from(ffi_prop)); + } + for prop in props::SentenceBreak::ALL_VALUES { + let ffi_prop = SentenceBreak::from_integer(prop.0) + .expect("Found SentenceBreak value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::SentenceBreak::from(ffi_prop)); + } + for prop in props::CanonicalCombiningClass::ALL_VALUES { + let ffi_prop = CanonicalCombiningClass::from_integer(prop.0) + .expect("Found CanonicalCombiningClass value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::CanonicalCombiningClass::from(ffi_prop)); + } + for prop in props::IndicSyllabicCategory::ALL_VALUES { + let ffi_prop = IndicSyllabicCategory::from_integer(prop.0) + .expect("Found IndicSyllabicCategory value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::IndicSyllabicCategory::from(ffi_prop)); + } + for prop in props::JoiningType::ALL_VALUES { + let ffi_prop = JoiningType::from_integer(prop.0) + .expect("Found JoiningType value not supported in ffi"); + assert_eq!(prop.0, ffi_prop.to_integer()); + assert_eq!(*prop, props::JoiningType::from(ffi_prop)); + } + } +}