summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibLocale/PluralRules.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-09-02 12:11:30 -0400
committerTim Flynn <trflynn89@pm.me>2022-09-05 14:37:16 -0400
commit43a3471298c429530aaf8c8cf2e2c3563079a9e4 (patch)
tree72a8c7adde28e2aa529e4810919f4421122ddb5b /Userland/Libraries/LibLocale/PluralRules.cpp
parentff48220dcae7109de994a727bea24a25a6649412 (diff)
downloadserenity-43a3471298c429530aaf8c8cf2e2c3563079a9e4.zip
LibLocale: Move locale source files to the LibLocale folder
These are still included in LibUnicode, but this updates their location and the include paths of other files which include them.
Diffstat (limited to 'Userland/Libraries/LibLocale/PluralRules.cpp')
-rw-r--r--Userland/Libraries/LibLocale/PluralRules.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/Userland/Libraries/LibLocale/PluralRules.cpp b/Userland/Libraries/LibLocale/PluralRules.cpp
new file mode 100644
index 0000000000..1f56f6cbe7
--- /dev/null
+++ b/Userland/Libraries/LibLocale/PluralRules.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibLocale/PluralRules.h>
+
+namespace Locale {
+
+PluralForm plural_form_from_string(StringView plural_form)
+{
+ if (plural_form == "cardinal"sv)
+ return PluralForm::Cardinal;
+ if (plural_form == "ordinal"sv)
+ return PluralForm::Ordinal;
+ VERIFY_NOT_REACHED();
+}
+
+StringView plural_form_to_string(PluralForm plural_form)
+{
+ switch (plural_form) {
+ case PluralForm::Cardinal:
+ return "cardinal"sv;
+ case PluralForm::Ordinal:
+ return "ordinal"sv;
+ default:
+ VERIFY_NOT_REACHED();
+ }
+}
+
+PluralCategory __attribute__((weak)) determine_plural_category(StringView, PluralForm, PluralOperands)
+{
+ return PluralCategory::Other;
+}
+
+Span<PluralCategory const> __attribute__((weak)) available_plural_categories(StringView, PluralForm)
+{
+ static constexpr Array<PluralCategory, 1> categories { { PluralCategory::Other } };
+ return categories.span();
+}
+
+PluralCategory __attribute__((weak)) determine_plural_range(StringView, PluralCategory, PluralCategory)
+{
+ return PluralCategory::Other;
+}
+
+}