/* * Copyright (c) 2021, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace Unicode { struct CodePointRange { u32 first { 0 }; u32 last { 0 }; }; struct BlockName { CodePointRange code_point_range {}; StringView display_name; }; Optional code_point_display_name(u32 code_point); Optional code_point_block_display_name(u32 code_point); Optional code_point_abbreviation(u32 code_point); Span block_display_names(); u32 canonical_combining_class(u32 code_point); Span special_case_mapping(u32 code_point); // Note: The single code point case conversions only perform simple case folding. // Use the full-string transformations for full case folding. u32 to_unicode_lowercase(u32 code_point); u32 to_unicode_uppercase(u32 code_point); String to_unicode_lowercase_full(StringView, Optional locale = {}); String to_unicode_uppercase_full(StringView, Optional locale = {}); Optional general_category_from_string(StringView); bool code_point_has_general_category(u32 code_point, GeneralCategory general_category); Optional property_from_string(StringView); bool code_point_has_property(u32 code_point, Property property); bool is_ecma262_property(Property); Optional