CharacterTypes.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
  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/Span.h>
  10. #include <AK/String.h>
  11. #include <AK/Types.h>
  12. #include <LibUnicode/Forward.h>
  13. namespace Unicode {
  14. Optional<String> code_point_display_name(u32 code_point);
  15. Optional<StringView> code_point_abbreviation(u32 code_point);
  16. u32 canonical_combining_class(u32 code_point);
  17. Span<SpecialCasing const* const> special_case_mapping(u32 code_point);
  18. // Note: The single code point case conversions only perform simple case folding.
  19. // Use the full-string transformations for full case folding.
  20. u32 to_unicode_lowercase(u32 code_point);
  21. u32 to_unicode_uppercase(u32 code_point);
  22. String to_unicode_lowercase_full(StringView, Optional<StringView> locale = {});
  23. String to_unicode_uppercase_full(StringView, Optional<StringView> locale = {});
  24. Optional<GeneralCategory> general_category_from_string(StringView);
  25. bool code_point_has_general_category(u32 code_point, GeneralCategory general_category);
  26. Optional<Property> property_from_string(StringView);
  27. bool code_point_has_property(u32 code_point, Property property);
  28. bool is_ecma262_property(Property);
  29. Optional<Script> script_from_string(StringView);
  30. bool code_point_has_script(u32 code_point, Script script);
  31. bool code_point_has_script_extension(u32 code_point, Script script);
  32. bool code_point_has_grapheme_break_property(u32 code_point, GraphemeBreakProperty property);
  33. bool code_point_has_word_break_property(u32 code_point, WordBreakProperty property);
  34. bool code_point_has_sentence_break_property(u32 code_point, SentenceBreakProperty property);
  35. }