1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibUnicode: Generate era, month, weekday and day period calendar symbols

The parsing in parse_calendar_symbols() might be a bit more verbose than
it really needs to be, but it is to ensure the symbols are generated in
a known order that we can control with enumerations.
This commit is contained in:
Timothy Flynn 2021-12-06 12:22:39 -05:00 committed by Linus Groh
parent 26f9666191
commit 2bbf8aa24c
3 changed files with 355 additions and 6 deletions

View file

@ -140,4 +140,40 @@ Vector<CalendarPattern> get_calendar_available_formats([[maybe_unused]] StringVi
#endif
}
Optional<StringView> get_calendar_era_symbol([[maybe_unused]] StringView locale, [[maybe_unused]] StringView calendar, [[maybe_unused]] CalendarPatternStyle style, [[maybe_unused]] Unicode::Era value)
{
#if ENABLE_UNICODE_DATA
return Detail::get_calendar_era_symbol(locale, calendar, style, value);
#else
return {};
#endif
}
Optional<StringView> get_calendar_month_symbol([[maybe_unused]] StringView locale, [[maybe_unused]] StringView calendar, [[maybe_unused]] CalendarPatternStyle style, [[maybe_unused]] Unicode::Month value)
{
#if ENABLE_UNICODE_DATA
return Detail::get_calendar_month_symbol(locale, calendar, style, value);
#else
return {};
#endif
}
Optional<StringView> get_calendar_weekday_symbol([[maybe_unused]] StringView locale, [[maybe_unused]] StringView calendar, [[maybe_unused]] CalendarPatternStyle style, [[maybe_unused]] Unicode::Weekday value)
{
#if ENABLE_UNICODE_DATA
return Detail::get_calendar_weekday_symbol(locale, calendar, style, value);
#else
return {};
#endif
}
Optional<StringView> get_calendar_day_period_symbol([[maybe_unused]] StringView locale, [[maybe_unused]] StringView calendar, [[maybe_unused]] CalendarPatternStyle style, [[maybe_unused]] Unicode::DayPeriod value)
{
#if ENABLE_UNICODE_DATA
return Detail::get_calendar_day_period_symbol(locale, calendar, style, value);
#else
return {};
#endif
}
}