CharacterTypes.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Forward.h>
  8. #include <AK/Optional.h>
  9. #include <AK/String.h>
  10. #include <AK/Types.h>
  11. #include <LibUnicode/Forward.h>
  12. namespace Unicode {
  13. // Note: The single code point case conversions only perform simple case folding.
  14. // Use the full-string transformations for full case folding.
  15. u32 to_unicode_lowercase(u32 code_point);
  16. u32 to_unicode_uppercase(u32 code_point);
  17. String to_unicode_lowercase_full(StringView, Optional<StringView> locale = {});
  18. String to_unicode_uppercase_full(StringView, Optional<StringView> locale = {});
  19. Optional<GeneralCategory> general_category_from_string(StringView);
  20. bool code_point_has_general_category(u32 code_point, GeneralCategory general_category);
  21. Optional<Property> property_from_string(StringView);
  22. bool code_point_has_property(u32 code_point, Property property);
  23. bool is_ecma262_property(Property);
  24. Optional<Script> script_from_string(StringView);
  25. bool code_point_has_script(u32 code_point, Script script);
  26. bool code_point_has_script_extension(u32 code_point, Script script);
  27. }