mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
LibUnicode: Parse and generate standard percentage formatting rules
This commit is contained in:
parent
4317a1b552
commit
feb8c22a62
4 changed files with 48 additions and 5 deletions
|
@ -19,6 +19,7 @@ enum class ListPatternType : u8;
|
|||
enum class Locale : u16;
|
||||
enum class Property : u8;
|
||||
enum class Script : u8;
|
||||
enum class StandardNumberFormatType : u8;
|
||||
enum class Territory : u8;
|
||||
enum class WordBreakProperty : u8;
|
||||
|
||||
|
|
|
@ -821,6 +821,15 @@ Vector<NumberFormat> get_compact_number_system_formats([[maybe_unused]] StringVi
|
|||
#endif
|
||||
}
|
||||
|
||||
Optional<NumberFormat> get_standard_number_system_format([[maybe_unused]] StringView locale, [[maybe_unused]] StringView system, [[maybe_unused]] StandardNumberFormatType type)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
return Detail::get_standard_number_system_format(locale, system, type);
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
}
|
||||
|
||||
Optional<ListPatterns> get_locale_list_patterns([[maybe_unused]] StringView locale, [[maybe_unused]] StringView type, [[maybe_unused]] StringView style)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
|
|
|
@ -78,6 +78,10 @@ struct LocaleID {
|
|||
Vector<String> private_use_extensions {};
|
||||
};
|
||||
|
||||
enum class StandardNumberFormatType : u8 {
|
||||
Percent,
|
||||
};
|
||||
|
||||
enum class CompactNumberFormatType : u8 {
|
||||
DecimalLong,
|
||||
DecimalShort,
|
||||
|
@ -163,6 +167,7 @@ Optional<StringView> get_locale_script_mapping(StringView locale, StringView scr
|
|||
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency);
|
||||
Vector<StringView> get_locale_key_mapping(StringView locale, StringView keyword);
|
||||
Optional<StringView> get_number_system_symbol(StringView locale, StringView system, StringView symbol);
|
||||
Optional<NumberFormat> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);
|
||||
Vector<NumberFormat> get_compact_number_system_formats(StringView locale, StringView system, CompactNumberFormatType type);
|
||||
Optional<ListPatterns> get_locale_list_patterns(StringView locale, StringView type, StringView style);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue