diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp index 0c202e10aa..47c5db0a9c 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeDateTimeFormat.cpp @@ -1598,7 +1598,7 @@ static void generate_unicode_locale_implementation(Core::File& file, UnicodeLoca #include #include -namespace Unicode::Detail { +namespace Unicode { )~~~"); locale_data.unique_strings.generate(generator); @@ -1608,32 +1608,32 @@ template static void convert_calendar_fields(SourceType const& source, TargetType& target) { if (source.era != -1) - target.era = static_cast(source.era); + target.era = static_cast(source.era); if (source.year != -1) - target.year = static_cast(source.year); + target.year = static_cast(source.year); if (source.month != -1) - target.month = static_cast(source.month); + target.month = static_cast(source.month); if (source.weekday != -1) - target.weekday = static_cast(source.weekday); + target.weekday = static_cast(source.weekday); if (source.day != -1) - target.day = static_cast(source.day); + target.day = static_cast(source.day); if (source.day_period != -1) - target.day_period = static_cast(source.day_period); + target.day_period = static_cast(source.day_period); if (source.hour != -1) - target.hour = static_cast(source.hour); + target.hour = static_cast(source.hour); if (source.minute != -1) - target.minute = static_cast(source.minute); + target.minute = static_cast(source.minute); if (source.second != -1) - target.second = static_cast(source.second); + target.second = static_cast(source.second); if (source.fractional_second_digits != -1) target.fractional_second_digits = static_cast(source.fractional_second_digits); if (source.time_zone_name != -1) - target.time_zone_name = static_cast(source.time_zone_name); + target.time_zone_name = static_cast(source.time_zone_name); } -struct CalendarPattern { - Unicode::CalendarPattern to_unicode_calendar_pattern() const { - Unicode::CalendarPattern calendar_pattern {}; +struct CalendarPatternImpl { + CalendarPattern to_unicode_calendar_pattern() const { + CalendarPattern calendar_pattern {}; calendar_pattern.skeleton = s_string_list[skeleton]; calendar_pattern.pattern = s_string_list[pattern]; @@ -1661,12 +1661,12 @@ struct CalendarPattern { i8 time_zone_name { -1 }; }; -struct CalendarRangePattern { - Unicode::CalendarRangePattern to_unicode_calendar_range_pattern() const { - Unicode::CalendarRangePattern calendar_range_pattern {}; +struct CalendarRangePatternImpl { + CalendarRangePattern to_unicode_calendar_range_pattern() const { + CalendarRangePattern calendar_range_pattern {}; if (field != -1) - calendar_range_pattern.field = static_cast(field); + calendar_range_pattern.field = static_cast(field); calendar_range_pattern.start_range = s_string_list[start_range]; calendar_range_pattern.separator = s_string_list[separator]; calendar_range_pattern.end_range = s_string_list[end_range]; @@ -1695,15 +1695,15 @@ struct CalendarRangePattern { }; )~~~"); - locale_data.unique_patterns.generate(generator, "CalendarPattern"sv, "s_calendar_patterns"sv, 10); + locale_data.unique_patterns.generate(generator, "CalendarPatternImpl"sv, "s_calendar_patterns"sv, 10); locale_data.unique_pattern_lists.generate(generator, s_calendar_pattern_index_type, "s_calendar_pattern_lists"sv); - locale_data.unique_range_patterns.generate(generator, "CalendarRangePattern"sv, "s_calendar_range_patterns"sv, 10); + locale_data.unique_range_patterns.generate(generator, "CalendarRangePatternImpl"sv, "s_calendar_range_patterns"sv, 10); locale_data.unique_range_pattern_lists.generate(generator, s_calendar_range_pattern_index_type, "s_calendar_range_pattern_lists"sv); generator.append(R"~~~( -struct CalendarFormat { - Unicode::CalendarFormat to_unicode_calendar_format() const { - Unicode::CalendarFormat calendar_format {}; +struct CalendarFormatImpl { + CalendarFormat to_unicode_calendar_format() const { + CalendarFormat calendar_format {}; calendar_format.full_format = s_calendar_patterns[full_format].to_unicode_calendar_pattern(); calendar_format.long_format = s_calendar_patterns[long_format].to_unicode_calendar_pattern(); @@ -1754,7 +1754,7 @@ struct DayPeriodData { }; )~~~"); - locale_data.unique_formats.generate(generator, "CalendarFormat"sv, "s_calendar_formats"sv, 10); + locale_data.unique_formats.generate(generator, "CalendarFormatImpl"sv, "s_calendar_formats"sv, 10); locale_data.unique_symbol_lists.generate(generator, s_string_index_type, "s_symbol_lists"sv); locale_data.unique_calendar_symbols.generate(generator, "CalendarSymbols"sv, "s_calendar_symbols"sv, 10); locale_data.unique_calendar_symbols_lists.generate(generator, s_calendar_symbols_index_type, "s_calendar_symbol_lists"sv); @@ -1833,8 +1833,7 @@ static constexpr Array<@type@, @size@> @name@ { {)~~~"); append_from_string("TimeZone"sv, "time_zone"sv, locale_data.time_zones); generator.append(R"~~~( -Vector get_regional_hour_cycles(StringView region) asm("unicode_get_regional_hour_cycles"); -Vector get_regional_hour_cycles(StringView region) +Vector get_regional_hour_cycles(StringView region) { auto region_value = hour_cycle_region_from_string(region); if (!region_value.has_value()) @@ -1845,11 +1844,11 @@ Vector get_regional_hour_cycles(StringView region) auto regional_hour_cycles_index = s_hour_cycles.at(region_index); auto const& regional_hour_cycles = s_hour_cycle_lists.at(regional_hour_cycles_index); - Vector hour_cycles; + Vector hour_cycles; hour_cycles.ensure_capacity(regional_hour_cycles.size()); for (auto hour_cycle : regional_hour_cycles) - hour_cycles.unchecked_append(static_cast(hour_cycle)); + hour_cycles.unchecked_append(static_cast(hour_cycle)); return hour_cycles; } @@ -1873,8 +1872,7 @@ static CalendarData const* find_calendar_data(StringView locale, StringView cale return &s_calendars[calendar_index]; } -Optional get_calendar_date_format(StringView locale, StringView calendar) asm("unicode_get_calendar_date_format"); -Optional get_calendar_date_format(StringView locale, StringView calendar) +Optional get_calendar_date_format(StringView locale, StringView calendar) { if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& formats = s_calendar_formats.at(data->date_formats); @@ -1883,8 +1881,7 @@ Optional get_calendar_date_format(StringView locale, St return {}; } -Optional get_calendar_time_format(StringView locale, StringView calendar) asm("unicode_get_calendar_time_format"); -Optional get_calendar_time_format(StringView locale, StringView calendar) +Optional get_calendar_time_format(StringView locale, StringView calendar) { if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& formats = s_calendar_formats.at(data->time_formats); @@ -1893,8 +1890,7 @@ Optional get_calendar_time_format(StringView locale, St return {}; } -Optional get_calendar_date_time_format(StringView locale, StringView calendar) asm("unicode_get_calendar_date_time_format"); -Optional get_calendar_date_time_format(StringView locale, StringView calendar) +Optional get_calendar_date_time_format(StringView locale, StringView calendar) { if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& formats = s_calendar_formats.at(data->date_time_formats); @@ -1903,10 +1899,9 @@ Optional get_calendar_date_time_format(StringView local return {}; } -Vector get_calendar_available_formats(StringView locale, StringView calendar) asm("unicode_get_calendar_available_formats"); -Vector get_calendar_available_formats(StringView locale, StringView calendar) +Vector get_calendar_available_formats(StringView locale, StringView calendar) { - Vector result {}; + Vector result {}; if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& available_formats = s_calendar_pattern_lists.at(data->available_formats); @@ -1919,8 +1914,7 @@ Vector get_calendar_available_formats(StringView local return result; } -Optional get_calendar_default_range_format(StringView locale, StringView calendar) asm("unicode_get_calendar_default_range_format"); -Optional get_calendar_default_range_format(StringView locale, StringView calendar) +Optional get_calendar_default_range_format(StringView locale, StringView calendar) { if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& pattern = s_calendar_range_patterns[data->default_range_format]; @@ -1930,10 +1924,9 @@ Optional get_calendar_default_range_format(String return {}; } -Vector get_calendar_range_formats(StringView locale, StringView calendar, StringView skeleton) asm("unicode_get_calendar_range_formats"); -Vector get_calendar_range_formats(StringView locale, StringView calendar, StringView skeleton) +Vector get_calendar_range_formats(StringView locale, StringView calendar, StringView skeleton) { - Vector result {}; + Vector result {}; if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& range_formats = s_calendar_range_pattern_lists.at(data->range_formats); @@ -1949,10 +1942,9 @@ Vector get_calendar_range_formats(StringView loca return result; } -Vector get_calendar_range12_formats(StringView locale, StringView calendar, StringView skeleton) asm("unicode_get_calendar_range12_formats"); -Vector get_calendar_range12_formats(StringView locale, StringView calendar, StringView skeleton) +Vector get_calendar_range12_formats(StringView locale, StringView calendar, StringView skeleton) { - Vector result {}; + Vector result {}; if (auto const* data = find_calendar_data(locale, calendar); data != nullptr) { auto const& range12_formats = s_calendar_range_pattern_lists.at(data->range12_formats); @@ -1999,7 +1991,6 @@ static Span<@string_index_type@ const> find_calendar_symbols(StringView locale, return {}; } -Optional get_calendar_era_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Era value) asm("unicode_get_calendar_era_symbol"); Optional get_calendar_era_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Era value) { auto symbols = find_calendar_symbols(locale, calendar, CalendarSymbol::Era, style); @@ -2010,7 +2001,6 @@ Optional get_calendar_era_symbol(StringView locale, StringView calen return {}; } -Optional get_calendar_month_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Month value) asm("unicode_get_calendar_month_symbol"); Optional get_calendar_month_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Month value) { auto symbols = find_calendar_symbols(locale, calendar, CalendarSymbol::Month, style); @@ -2021,7 +2011,6 @@ Optional get_calendar_month_symbol(StringView locale, StringView cal return {}; } -Optional get_calendar_weekday_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Weekday value) asm("unicode_get_calendar_weekday_symbol"); Optional get_calendar_weekday_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Weekday value) { auto symbols = find_calendar_symbols(locale, calendar, CalendarSymbol::Weekday, style); @@ -2032,7 +2021,6 @@ Optional get_calendar_weekday_symbol(StringView locale, StringView c return {}; } -Optional get_calendar_day_period_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, DayPeriod value) asm("unicode_get_calendar_day_period_symbol"); Optional get_calendar_day_period_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, DayPeriod value) { auto symbols = find_calendar_symbols(locale, calendar, CalendarSymbol::DayPeriod, style); @@ -2043,7 +2031,6 @@ Optional get_calendar_day_period_symbol(StringView locale, StringVie return {}; } -Optional get_calendar_day_period_symbol_for_hour(StringView locale, StringView calendar, CalendarPatternStyle style, u8 hour) asm("unicode_get_calendar_day_period_symbol_for_hour"); Optional get_calendar_day_period_symbol_for_hour(StringView locale, StringView calendar, CalendarPatternStyle style, u8 hour) { auto locale_value = locale_from_string(locale); @@ -2059,16 +2046,16 @@ Optional get_calendar_day_period_symbol_for_hour(StringView locale, auto const& day_period = s_day_periods[day_period_index]; if ((day_period.begin <= hour) && (hour < day_period.end)) { - auto period = static_cast(day_period.day_period); - return Detail::get_calendar_day_period_symbol(locale, calendar, style, period); + auto period = static_cast(day_period.day_period); + return get_calendar_day_period_symbol(locale, calendar, style, period); } } // Fallback to fixed periods if the locale does not have flexible day periods. // TR-35 states that the meaning of AM and PM does not change with locale. if (hour < 12) - return Detail::get_calendar_day_period_symbol(locale, calendar, style, Unicode::DayPeriod::AM); - return Detail::get_calendar_day_period_symbol(locale, calendar, style, Unicode::DayPeriod::PM); + return get_calendar_day_period_symbol(locale, calendar, style, DayPeriod::AM); + return get_calendar_day_period_symbol(locale, calendar, style, DayPeriod::PM); } static TimeZoneFormat const* find_time_zone_formats(StringView locale) @@ -2103,7 +2090,6 @@ static TimeZoneData const* find_time_zone_data(StringView locale, StringView tim return &s_time_zones[time_zone_index]; } -Optional get_time_zone_name(StringView locale, StringView time_zone, CalendarPatternStyle style) asm("unicode_get_time_zone_name"); Optional get_time_zone_name(StringView locale, StringView time_zone, CalendarPatternStyle style) { // FIXME: This becomes more complicated when time zones other than UTC are supported. We will need to know the GMT offset diff --git a/Userland/Libraries/LibUnicode/DateTimeFormat.cpp b/Userland/Libraries/LibUnicode/DateTimeFormat.cpp index e91599aa52..c6542430a1 100644 --- a/Userland/Libraries/LibUnicode/DateTimeFormat.cpp +++ b/Userland/Libraries/LibUnicode/DateTimeFormat.cpp @@ -8,7 +8,6 @@ #include #include #include -#include namespace Unicode { @@ -90,15 +89,18 @@ StringView calendar_pattern_style_to_string(CalendarPatternStyle style) } } -// https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table -Vector get_regional_hour_cycles(StringView locale) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); +Optional __attribute__((weak)) calendar_from_string(StringView) { return {}; } +Optional __attribute__((weak)) hour_cycle_region_from_string(StringView) { return {}; } +Optional __attribute__((weak)) time_zone_from_string(StringView) { return {}; } +Vector __attribute__((weak)) get_regional_hour_cycles(StringView) { return {}; } - if (auto hour_cycles = symbols.get_regional_hour_cycles(locale); !hour_cycles.is_empty()) +// https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table +Vector get_locale_hour_cycles(StringView locale) +{ + if (auto hour_cycles = get_regional_hour_cycles(locale); !hour_cycles.is_empty()) return hour_cycles; - auto return_default_hour_cycles = [&]() { return symbols.get_regional_hour_cycles("001"sv); }; + auto return_default_hour_cycles = [&]() { return get_regional_hour_cycles("001"sv); }; auto language = parse_unicode_language_id(locale); if (!language.has_value()) @@ -109,7 +111,7 @@ Vector get_regional_hour_cycles(StringView locale) if (!language.has_value() || !language->region.has_value()) return return_default_hour_cycles(); - if (auto hour_cycles = symbols.get_regional_hour_cycles(*language->region); !hour_cycles.is_empty()) + if (auto hour_cycles = get_regional_hour_cycles(*language->region); !hour_cycles.is_empty()) return hour_cycles; return return_default_hour_cycles(); @@ -117,7 +119,7 @@ Vector get_regional_hour_cycles(StringView locale) Optional get_default_regional_hour_cycle(StringView locale) { - if (auto hour_cycles = get_regional_hour_cycles(locale); !hour_cycles.is_empty()) + if (auto hour_cycles = get_locale_hour_cycles(locale); !hour_cycles.is_empty()) return hour_cycles.first(); return {}; } @@ -163,80 +165,33 @@ String combine_skeletons(StringView first, StringView second) return builder.build(); } +Optional __attribute__((weak)) get_calendar_date_format(StringView, StringView) { return {}; } +Optional __attribute__((weak)) get_calendar_time_format(StringView, StringView) { return {}; } +Optional __attribute__((weak)) get_calendar_date_time_format(StringView, StringView) { return {}; } + Optional get_calendar_format(StringView locale, StringView calendar, CalendarFormatType type) { - static auto const& symbols = Detail::Symbols::ensure_loaded(); - switch (type) { case CalendarFormatType::Date: - return symbols.get_calendar_date_format(locale, calendar); + return get_calendar_date_format(locale, calendar); case CalendarFormatType::Time: - return symbols.get_calendar_time_format(locale, calendar); + return get_calendar_time_format(locale, calendar); case CalendarFormatType::DateTime: - return symbols.get_calendar_date_time_format(locale, calendar); + return get_calendar_date_time_format(locale, calendar); default: VERIFY_NOT_REACHED(); } } -Vector get_calendar_available_formats(StringView locale, StringView calendar) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_available_formats(locale, calendar); -} - -Optional get_calendar_default_range_format(StringView locale, StringView calendar) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_default_range_format(locale, calendar); -} - -Vector get_calendar_range_formats(StringView locale, StringView calendar, StringView skeleton) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_range_formats(locale, calendar, skeleton); -} - -Vector get_calendar_range12_formats(StringView locale, StringView calendar, StringView skeleton) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_range12_formats(locale, calendar, skeleton); -} - -Optional get_calendar_era_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Era value) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_era_symbol(locale, calendar, style, value); -} - -Optional get_calendar_month_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Month value) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_month_symbol(locale, calendar, style, value); -} - -Optional get_calendar_weekday_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Weekday value) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_weekday_symbol(locale, calendar, style, value); -} - -Optional get_calendar_day_period_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::DayPeriod value) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_day_period_symbol(locale, calendar, style, value); -} - -Optional get_calendar_day_period_symbol_for_hour(StringView locale, StringView calendar, CalendarPatternStyle style, u8 hour) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_calendar_day_period_symbol_for_hour(locale, calendar, style, hour); -} - -Optional get_time_zone_name(StringView locale, StringView time_zone, CalendarPatternStyle style) -{ - static auto const& symbols = Detail::Symbols::ensure_loaded(); - return symbols.get_time_zone_name(locale, time_zone, style); -} +Vector __attribute__((weak)) get_calendar_available_formats(StringView, StringView) { return {}; } +Optional __attribute__((weak)) get_calendar_default_range_format(StringView, StringView) { return {}; } +Vector __attribute__((weak)) get_calendar_range_formats(StringView, StringView, StringView) { return {}; } +Vector __attribute__((weak)) get_calendar_range12_formats(StringView, StringView, StringView) { return {}; } +Optional __attribute__((weak)) get_calendar_era_symbol(StringView, StringView, CalendarPatternStyle, Era) { return {}; } +Optional __attribute__((weak)) get_calendar_month_symbol(StringView, StringView, CalendarPatternStyle, Month) { return {}; } +Optional __attribute__((weak)) get_calendar_weekday_symbol(StringView, StringView, CalendarPatternStyle, Weekday) { return {}; } +Optional __attribute__((weak)) get_calendar_day_period_symbol(StringView, StringView, CalendarPatternStyle, DayPeriod) { return {}; } +Optional __attribute__((weak)) get_calendar_day_period_symbol_for_hour(StringView, StringView, CalendarPatternStyle, u8) { return {}; } +Optional __attribute__((weak)) get_time_zone_name(StringView, StringView, CalendarPatternStyle) { return {}; } } diff --git a/Userland/Libraries/LibUnicode/DateTimeFormat.h b/Userland/Libraries/LibUnicode/DateTimeFormat.h index f1466e631c..1a909ca671 100644 --- a/Userland/Libraries/LibUnicode/DateTimeFormat.h +++ b/Userland/Libraries/LibUnicode/DateTimeFormat.h @@ -168,21 +168,35 @@ enum class CalendarSymbol : u8 { HourCycle hour_cycle_from_string(StringView hour_cycle); StringView hour_cycle_to_string(HourCycle hour_cycle); + CalendarPatternStyle calendar_pattern_style_from_string(StringView style); StringView calendar_pattern_style_to_string(CalendarPatternStyle style); -Vector get_regional_hour_cycles(StringView locale); + +Optional calendar_from_string(StringView calendar); +Optional hour_cycle_region_from_string(StringView hour_cycle_region); +Optional time_zone_from_string(StringView time_zone); + +Vector get_regional_hour_cycles(StringView region); +Vector get_locale_hour_cycles(StringView locale); Optional get_default_regional_hour_cycle(StringView locale); + String combine_skeletons(StringView first, StringView second); + +Optional get_calendar_date_format(StringView locale, StringView calendar); +Optional get_calendar_time_format(StringView locale, StringView calendar); +Optional get_calendar_date_time_format(StringView locale, StringView calendar); Optional get_calendar_format(StringView locale, StringView calendar, CalendarFormatType type); Vector get_calendar_available_formats(StringView locale, StringView calendar); Optional get_calendar_default_range_format(StringView locale, StringView calendar); Vector get_calendar_range_formats(StringView locale, StringView calendar, StringView skeleton); Vector get_calendar_range12_formats(StringView locale, StringView calendar, StringView skeleton); + Optional get_calendar_era_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Era value); Optional get_calendar_month_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Month value); Optional get_calendar_weekday_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Weekday value); Optional get_calendar_day_period_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::DayPeriod value); Optional get_calendar_day_period_symbol_for_hour(StringView locale, StringView calendar, CalendarPatternStyle style, u8 hour); + Optional get_time_zone_name(StringView locale, StringView time_zone, CalendarPatternStyle style); } diff --git a/Userland/Libraries/LibUnicode/Locale.cpp b/Userland/Libraries/LibUnicode/Locale.cpp index ed3e17a4c3..e603e21b0b 100644 --- a/Userland/Libraries/LibUnicode/Locale.cpp +++ b/Userland/Libraries/LibUnicode/Locale.cpp @@ -789,7 +789,7 @@ Optional get_locale_currency_mapping(StringView locale, StringView c Vector get_locale_key_mapping(StringView locale, StringView keyword) { if (keyword == "hc"sv) { - auto hour_cycles = get_regional_hour_cycles(locale); + auto hour_cycles = get_locale_hour_cycles(locale); Vector values; values.ensure_capacity(hour_cycles.size()); diff --git a/Userland/Libraries/LibUnicode/UnicodeSymbols.cpp b/Userland/Libraries/LibUnicode/UnicodeSymbols.cpp index 7c89d3d18f..3befd13432 100644 --- a/Userland/Libraries/LibUnicode/UnicodeSymbols.cpp +++ b/Userland/Libraries/LibUnicode/UnicodeSymbols.cpp @@ -15,7 +15,6 @@ # endif #else # include -# include # include #endif @@ -111,21 +110,6 @@ Symbols const& Symbols::ensure_loaded() load_symbol(symbols.add_likely_subtags, "unicode_add_likely_subtags"); load_symbol(symbols.resolve_most_likely_territory, "unicode_resolve_most_likely_territory"); - load_symbol(symbols.get_regional_hour_cycles, "unicode_get_regional_hour_cycles"); - load_symbol(symbols.get_calendar_date_format, "unicode_get_calendar_date_format"); - load_symbol(symbols.get_calendar_time_format, "unicode_get_calendar_time_format"); - load_symbol(symbols.get_calendar_date_time_format, "unicode_get_calendar_date_time_format"); - load_symbol(symbols.get_calendar_available_formats, "unicode_get_calendar_available_formats"); - load_symbol(symbols.get_calendar_default_range_format, "unicode_get_calendar_default_range_format"); - load_symbol(symbols.get_calendar_range_formats, "unicode_get_calendar_range_formats"); - load_symbol(symbols.get_calendar_range12_formats, "unicode_get_calendar_range12_formats"); - load_symbol(symbols.get_calendar_era_symbol, "unicode_get_calendar_era_symbol"); - load_symbol(symbols.get_calendar_month_symbol, "unicode_get_calendar_month_symbol"); - load_symbol(symbols.get_calendar_weekday_symbol, "unicode_get_calendar_weekday_symbol"); - load_symbol(symbols.get_calendar_day_period_symbol, "unicode_get_calendar_day_period_symbol"); - load_symbol(symbols.get_calendar_day_period_symbol_for_hour, "unicode_get_calendar_day_period_symbol_for_hour"); - load_symbol(symbols.get_time_zone_name, "unicode_get_time_zone_name"); - initialized = true; return symbols; } diff --git a/Userland/Libraries/LibUnicode/UnicodeSymbols.h b/Userland/Libraries/LibUnicode/UnicodeSymbols.h index 2efd04e0b8..4e1e2d2b70 100644 --- a/Userland/Libraries/LibUnicode/UnicodeSymbols.h +++ b/Userland/Libraries/LibUnicode/UnicodeSymbols.h @@ -64,27 +64,6 @@ struct Symbols { Optional (*add_likely_subtags)(LanguageID const&); Optional (*resolve_most_likely_territory)(LanguageID const&); - // Loaded from UnicodeDateTimeFormat.cpp: - - Vector (*get_regional_hour_cycles)(StringView) { nullptr }; - - Optional (*get_calendar_date_format)(StringView, StringView) { nullptr }; - Optional (*get_calendar_time_format)(StringView, StringView) { nullptr }; - Optional (*get_calendar_date_time_format)(StringView, StringView) { nullptr }; - Vector (*get_calendar_available_formats)(StringView, StringView) { nullptr }; - - Optional (*get_calendar_default_range_format)(StringView, StringView) { nullptr }; - Vector (*get_calendar_range_formats)(StringView, StringView, StringView) { nullptr }; - Vector (*get_calendar_range12_formats)(StringView, StringView, StringView) { nullptr }; - - Optional (*get_calendar_era_symbol)(StringView, StringView, CalendarPatternStyle, Era) { nullptr }; - Optional (*get_calendar_month_symbol)(StringView, StringView, CalendarPatternStyle, Month) { nullptr }; - Optional (*get_calendar_weekday_symbol)(StringView, StringView, CalendarPatternStyle, Weekday) { nullptr }; - Optional (*get_calendar_day_period_symbol)(StringView, StringView, CalendarPatternStyle, DayPeriod) { nullptr }; - Optional (*get_calendar_day_period_symbol_for_hour)(StringView, StringView, CalendarPatternStyle, u8) { nullptr }; - - Optional (*get_time_zone_name)(StringView, StringView, CalendarPatternStyle) { nullptr }; - private: Symbols() = default; };