@@ -2363,3 +2363,95 @@ impl_value_getter! {
2363
2363
pub fn get_enum_to_long_name_mapper( ) / enum_to_long_name_mapper( ) -> PropertyEnumToValueNameLinearMapper / PropertyEnumToValueNameLinearMapperBorrowed ;
2364
2364
}
2365
2365
}
2366
+ /// Enumerated property Joining_Type.
2367
+ /// See Section 9.2, Arabic Cursive Joining in The Unicode Standard for the summary of
2368
+ /// each property value.
2369
+ ///
2370
+ /// The numeric value is compatible with `UJoiningType` in ICU4C.
2371
+ #[ derive( Copy , Clone , Debug , Eq , PartialEq , Ord , PartialOrd ) ]
2372
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
2373
+ #[ cfg_attr( feature = "datagen" , derive( databake:: Bake ) ) ]
2374
+ #[ cfg_attr( feature = "datagen" , databake( path = icu_properties) ) ]
2375
+ #[ allow( clippy:: exhaustive_structs) ] // newtype
2376
+ #[ repr( transparent) ]
2377
+ #[ zerovec:: make_ule( JoiningTypeULE ) ]
2378
+ pub struct JoiningType ( pub u8 ) ;
2379
+
2380
+ #[ allow( missing_docs) ] // These constants don't need individual documentation.
2381
+ #[ allow( non_upper_case_globals) ]
2382
+ impl JoiningType {
2383
+ pub const NonJoining : JoiningType = JoiningType ( 0 ) ; // name="U"
2384
+ pub const JoinCausing : JoiningType = JoiningType ( 1 ) ; // name="C"
2385
+ pub const DualJoining : JoiningType = JoiningType ( 2 ) ; // name="D"
2386
+ pub const LeftJoining : JoiningType = JoiningType ( 3 ) ; // name="L"
2387
+ pub const RightJoining : JoiningType = JoiningType ( 4 ) ; // name="R"
2388
+ pub const Transparent : JoiningType = JoiningType ( 5 ) ; // name="T"
2389
+ }
2390
+
2391
+ impl_value_getter ! {
2392
+ markers: JoiningTypeNameToValueV1Marker / SINGLETON_PROPNAMES_FROM_JT_V1 , JoiningTypeValueToShortNameV1Marker / SINGLETON_PROPNAMES_TO_SHORT_LINEAR_JT_V1 , JoiningTypeValueToLongNameV1Marker / SINGLETON_PROPNAMES_TO_LONG_LINEAR_JT_V1 ;
2393
+ impl JoiningType {
2394
+ /// Return a [`PropertyValueNameToEnumMapper`], capable of looking up values
2395
+ /// from strings for the `Joining_Type` enumerated property.
2396
+ ///
2397
+ /// ✨ *Enabled with the `compiled_data` Cargo feature.*
2398
+ ///
2399
+ /// [📚 Help choosing a constructor](icu_provider::constructors)
2400
+ ///
2401
+ /// # Example
2402
+ ///
2403
+ /// ```
2404
+ /// use icu::properties::JoiningType;
2405
+ ///
2406
+ /// let lookup = JoiningType::name_to_enum_mapper();
2407
+ /// // short name for value
2408
+ /// assert_eq!(lookup.get_strict("T"), Some(JoiningType::Transparent));
2409
+ /// assert_eq!(lookup.get_strict("D"), Some(JoiningType::DualJoining));
2410
+ /// // long name for value
2411
+ /// assert_eq!(lookup.get_strict("Join_Causing"), Some(JoiningType::JoinCausing));
2412
+ /// assert_eq!(lookup.get_strict("Non_Joining"), Some(JoiningType::NonJoining));
2413
+ /// // name has incorrect casing
2414
+ /// assert_eq!(lookup.get_strict("LEFT_JOINING"), None);
2415
+ /// // loose matching of name
2416
+ /// assert_eq!(lookup.get_loose("LEFT_JOINING"), Some(JoiningType::LeftJoining));
2417
+ /// // fake property
2418
+ /// assert_eq!(lookup.get_strict("Inner_Joining"), None);
2419
+ /// ```
2420
+ pub fn get_name_to_enum_mapper( ) / name_to_enum_mapper( ) ;
2421
+ /// Return a [`PropertyEnumToValueNameLinearMapper`], capable of looking up short names
2422
+ /// for values of the `Joining_Type` enumerated property.
2423
+ ///
2424
+ /// ✨ *Enabled with the `compiled_data` Cargo feature.*
2425
+ ///
2426
+ /// [📚 Help choosing a constructor](icu_provider::constructors)
2427
+ ///
2428
+ /// # Example
2429
+ ///
2430
+ /// ```
2431
+ /// use icu::properties::JoiningType;
2432
+ ///
2433
+ /// let lookup = JoiningType::enum_to_short_name_mapper();
2434
+ /// assert_eq!(lookup.get(JoiningType::JoinCausing), Some("C"));
2435
+ /// assert_eq!(lookup.get(JoiningType::LeftJoining), Some("L"));
2436
+ /// ```
2437
+ pub fn get_enum_to_short_name_mapper( ) / enum_to_short_name_mapper( ) -> PropertyEnumToValueNameLinearMapper / PropertyEnumToValueNameLinearMapperBorrowed ;
2438
+ /// Return a [`PropertyEnumToValueNameLinearMapper`], capable of looking up long names
2439
+ /// for values of the `Joining_Type` enumerated property.
2440
+ ///
2441
+ /// ✨ *Enabled with the `compiled_data` Cargo feature.*
2442
+ ///
2443
+ /// [📚 Help choosing a constructor](icu_provider::constructors)
2444
+ ///
2445
+ /// # Example
2446
+ ///
2447
+ /// ```
2448
+ /// use icu::properties::JoiningType;
2449
+ ///
2450
+ /// let lookup = JoiningType::enum_to_long_name_mapper();
2451
+ /// assert_eq!(lookup.get(JoiningType::Transparent), Some("Transparent"));
2452
+ /// assert_eq!(lookup.get(JoiningType::NonJoining), Some("Non_Joining"));
2453
+ /// assert_eq!(lookup.get(JoiningType::RightJoining), Some("Right_Joining"));
2454
+ /// ```
2455
+ pub fn get_enum_to_long_name_mapper( ) / enum_to_long_name_mapper( ) -> PropertyEnumToValueNameLinearMapper / PropertyEnumToValueNameLinearMapperBorrowed ;
2456
+ }
2457
+ }
0 commit comments