use crate::unicode::ucd::property_names;
#[derive(Clone, Copy)]
pub struct PropertyName {
pub full: &'static str,
pub abbr: &'static str,
}
pub trait UnicodeProperty {
fn property_value_name(&self) -> PropertyName;
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum BinaryProperty {
Y,
N,
}
impl From<bool> for BinaryProperty {
fn from(val: bool) -> Self {
match val {
true => BinaryProperty::Y,
false => BinaryProperty::N,
}
}
}
impl UnicodeProperty for BinaryProperty {
fn property_value_name(&self) -> PropertyName {
property_names::binary_property_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum Gc {
Cc,
Cf,
Cn,
Co,
Cs,
Ll,
Lm,
Lo,
Lt,
Lu,
Mc,
Me,
Mn,
Nd,
Nl,
No,
Pc,
Pd,
Pe,
Pf,
Pi,
Po,
Ps,
Sc,
Sk,
Sm,
So,
Zl,
Zp,
Zs,
}
impl UnicodeProperty for Gc {
fn property_value_name(&self) -> PropertyName {
property_names::gc_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum Hst {
L,
LV,
LVT,
NA,
T,
V,
}
impl UnicodeProperty for Hst {
fn property_value_name(&self) -> PropertyName {
property_names::hst_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum Gcb {
CN,
CR,
EB,
EBG,
EM,
EX,
GAZ,
L,
LF,
LV,
LVT,
PP,
RI,
SM,
T,
V,
XX,
ZWJ,
}
impl UnicodeProperty for Gcb {
fn property_value_name(&self) -> PropertyName {
property_names::gcb_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum Bc {
AL,
AN,
B,
BN,
CS,
EN,
ES,
ET,
FSI,
L,
LRE,
LRI,
LRO,
NSM,
ON,
PDF,
PDI,
R,
RLE,
RLI,
RLO,
S,
WS,
}
impl UnicodeProperty for Bc {
fn property_value_name(&self) -> PropertyName {
property_names::bc_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum Ccc {
NR = 0,
OV = 1,
HANR = 6,
NK = 7,
KV = 8,
VR = 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,
ATBL = 200,
ATB = 202,
ATA = 214,
ATAR = 216,
BL = 218,
B = 220,
BR = 222,
L = 224,
R = 226,
AL = 228,
A = 230,
AR = 232,
DB = 233,
DA = 234,
IS = 240,
}
impl UnicodeProperty for Ccc {
fn property_value_name(&self) -> PropertyName {
property_names::ccc_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u8)]
pub enum Dt {
Can,
Com,
Enc,
Fin,
Font,
Fra,
Init,
Iso,
Med,
Nar,
Nb,
None,
Sml,
Sqr,
Sub,
Sup,
Vert,
Wide,
}
impl UnicodeProperty for Dt {
fn property_value_name(&self) -> PropertyName {
property_names::dt_name(*self)
}
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[repr(u16)]
pub enum Blk {
Adlam,
AegeanNumbers,
Ahom,
Alchemical,
AlphabeticPf,
AnatolianHieroglyphs,
AncientGreekMusic,
AncientGreekNumbers,
AncientSymbols,
Arabic,
ArabicExtA,
ArabicMath,
ArabicPfA,
ArabicPfB,
ArabicSup,
Armenian,
Arrows,
Ascii,
Avestan,
Balinese,
Bamum,
BamumSup,
BassaVah,
Batak,
Bengali,
Bhaiksuki,
BlockElements,
Bopomofo,
BopomofoExt,
BoxDrawing,
Brahmi,
Braille,
Buginese,
Buhid,
ByzantineMusic,
Carian,
CaucasianAlbanian,
Chakma,
Cham,
Cherokee,
CherokeeSup,
ChessSymbols,
Chorasmian,
Cjk,
CjkCompat,
CjkCompatForms,
CjkCompatIdeographs,
CjkCompatIdeographsSup,
CjkExtA,
CjkExtB,
CjkExtC,
CjkExtD,
CjkExtE,
CjkExtF,
CjkExtG,
CjkRadicalsSup,
CjkStrokes,
CjkSymbols,
CompatJamo,
ControlPictures,
Coptic,
CopticEpactNumbers,
CountingRod,
Cuneiform,
CuneiformNumbers,
CurrencySymbols,
CypriotSyllabary,
Cyrillic,
CyrillicExtA,
CyrillicExtB,
CyrillicExtC,
CyrillicSup,
Deseret,
Devanagari,
DevanagariExt,
Diacriticals,
DiacriticalsExt,
DiacriticalsForSymbols,
DiacriticalsSup,
Dingbats,
DivesAkuru,
Dogra,
Domino,
Duployan,
EarlyDynasticCuneiform,
EgyptianHieroglyphFormatControls,
EgyptianHieroglyphs,
Elbasan,
Elymaic,
Emoticons,
EnclosedAlphanum,
EnclosedAlphanumSup,
EnclosedCjk,
EnclosedIdeographicSup,
Ethiopic,
EthiopicExt,
EthiopicExtA,
EthiopicSup,
GeometricShapes,
GeometricShapesExt,
Georgian,
GeorgianExt,
GeorgianSup,
Glagolitic,
GlagoliticSup,
Gothic,
Grantha,
Greek,
GreekExt,
Gujarati,
GunjalaGondi,
Gurmukhi,
HalfAndFullForms,
HalfMarks,
Hangul,
HanifiRohingya,
Hanunoo,
Hatran,
Hebrew,
HighPuSurrogates,
HighSurrogates,
Hiragana,
Idc,
IdeographicSymbols,
ImperialAramaic,
IndicNumberForms,
IndicSiyaqNumbers,
InscriptionalPahlavi,
InscriptionalParthian,
IpaExt,
Jamo,
JamoExtA,
JamoExtB,
Javanese,
Kaithi,
KanaExtA,
KanaSup,
Kanbun,
Kangxi,
Kannada,
Katakana,
KatakanaExt,
KayahLi,
Kharoshthi,
KhitanSmallScript,
Khmer,
KhmerSymbols,
Khojki,
Khudawadi,
Lao,
Latin1Sup,
LatinExtA,
LatinExtAdditional,
LatinExtB,
LatinExtC,
LatinExtD,
LatinExtE,
Lepcha,
LetterlikeSymbols,
Limbu,
LinearA,
LinearBIdeograms,
LinearBSyllabary,
Lisu,
LisuSup,
LowSurrogates,
Lycian,
Lydian,
Mahajani,
Mahjong,
Makasar,
Malayalam,
Mandaic,
Manichaean,
Marchen,
MasaramGondi,
MathAlphanum,
MathOperators,
MayanNumerals,
Medefaidrin,
MeeteiMayek,
MeeteiMayekExt,
MendeKikakui,
MeroiticCursive,
MeroiticHieroglyphs,
Miao,
MiscArrows,
MiscMathSymbolsA,
MiscMathSymbolsB,
MiscPictographs,
MiscSymbols,
MiscTechnical,
Modi,
ModifierLetters,
ModifierToneLetters,
Mongolian,
MongolianSup,
Mro,
Multani,
Music,
Myanmar,
MyanmarExtA,
MyanmarExtB,
Nabataean,
Nandinagari,
Nb,
NewTaiLue,
Newa,
Nko,
NumberForms,
Nushu,
NyiakengPuachueHmong,
Ocr,
Ogham,
OlChiki,
OldHungarian,
OldItalic,
OldNorthArabian,
OldPermic,
OldPersian,
OldSogdian,
OldSouthArabian,
OldTurkic,
Oriya,
OrnamentalDingbats,
Osage,
Osmanya,
OttomanSiyaqNumbers,
PahawhHmong,
Palmyrene,
PauCinHau,
PhagsPa,
Phaistos,
Phoenician,
PhoneticExt,
PhoneticExtSup,
PlayingCards,
PsalterPahlavi,
Pua,
Punctuation,
Rejang,
Rumi,
Runic,
Samaritan,
Saurashtra,
Sharada,
Shavian,
ShorthandFormatControls,
Siddham,
Sinhala,
SinhalaArchaicNumbers,
SmallForms,
SmallKanaExt,
Sogdian,
SoraSompeng,
Soyombo,
Specials,
Sundanese,
SundaneseSup,
SupArrowsA,
SupArrowsB,
SupArrowsC,
SupMathOperators,
SupPuaA,
SupPuaB,
SupPunctuation,
SupSymbolsAndPictographs,
SuperAndSub,
SuttonSignwriting,
SylotiNagri,
SymbolsAndPictographsExtA,
SymbolsForLegacyComputing,
Syriac,
SyriacSup,
Tagalog,
Tagbanwa,
Tags,
TaiLe,
TaiTham,
TaiViet,
TaiXuanJing,
Takri,
Tamil,
TamilSup,
Tangut,
TangutComponents,
TangutSup,
Telugu,
Thaana,
Thai,
Tibetan,
Tifinagh,
Tirhuta,
TransportAndMap,
Ucas,
UcasExt,
Ugaritic,
Vai,
VedicExt,
VerticalForms,
Vs,
VsSup,
Wancho,
WarangCiti,
Yezidi,
YiRadicals,
YiSyllables,
Yijing,
ZanabazarSquare,
}
impl UnicodeProperty for Blk {
fn property_value_name(&self) -> PropertyName {
property_names::blk_name(*self)
}
}