PluralRules.h 711 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/String.h>
  8. #include <AK/StringView.h>
  9. #include <LibJS/Runtime/Intl/NumberFormat.h>
  10. #include <LibJS/Runtime/Object.h>
  11. namespace JS::Intl {
  12. class PluralRules final : public NumberFormatBase {
  13. JS_OBJECT(PluralRules, NumberFormatBase);
  14. public:
  15. enum class Type {
  16. Cardinal,
  17. Ordinal,
  18. };
  19. PluralRules(Object& prototype);
  20. virtual ~PluralRules() override = default;
  21. Type type() const { return m_type; }
  22. StringView type_string() const;
  23. void set_type(StringView type);
  24. private:
  25. Type m_type { Type::Cardinal }; // [[Type]]
  26. };
  27. }