2021-07-25 19:10:51 +00:00
|
|
|
/*
|
2024-06-19 20:39:30 +00:00
|
|
|
* Copyright (c) 2021-2024, Tim Flynn <trflynn89@serenityos.org>
|
2021-07-25 19:10:51 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-07-27 17:46:08 +00:00
|
|
|
#include <AK/Forward.h>
|
2021-09-05 18:39:20 +00:00
|
|
|
#include <AK/Optional.h>
|
2024-06-19 20:39:30 +00:00
|
|
|
#include <AK/StringView.h>
|
2021-07-25 19:10:51 +00:00
|
|
|
#include <AK/Types.h>
|
2021-07-29 01:45:09 +00:00
|
|
|
#include <LibUnicode/Forward.h>
|
2021-07-25 19:10:51 +00:00
|
|
|
|
|
|
|
namespace Unicode {
|
|
|
|
|
2021-11-10 23:55:02 +00:00
|
|
|
Optional<GeneralCategory> general_category_from_string(StringView);
|
2021-07-31 20:38:24 +00:00
|
|
|
bool code_point_has_general_category(u32 code_point, GeneralCategory general_category);
|
|
|
|
|
2024-10-21 20:29:16 +00:00
|
|
|
bool code_point_is_printable(u32 code_point);
|
2024-06-21 15:24:00 +00:00
|
|
|
bool code_point_has_control_general_category(u32 code_point);
|
2024-10-08 21:15:55 +00:00
|
|
|
bool code_point_has_letter_general_category(u32 code_point);
|
|
|
|
bool code_point_has_number_general_category(u32 code_point);
|
2024-09-05 16:07:59 +00:00
|
|
|
bool code_point_has_punctuation_general_category(u32 code_point);
|
|
|
|
bool code_point_has_separator_general_category(u32 code_point);
|
2024-06-21 15:24:00 +00:00
|
|
|
bool code_point_has_space_separator_general_category(u32 code_point);
|
2024-10-08 21:15:55 +00:00
|
|
|
bool code_point_has_symbol_general_category(u32 code_point);
|
2024-06-21 15:24:00 +00:00
|
|
|
|
2021-11-10 23:55:02 +00:00
|
|
|
Optional<Property> property_from_string(StringView);
|
2021-07-29 01:45:09 +00:00
|
|
|
bool code_point_has_property(u32 code_point, Property property);
|
2024-06-21 14:39:40 +00:00
|
|
|
|
|
|
|
bool code_point_has_emoji_property(u32 code_point);
|
|
|
|
bool code_point_has_emoji_modifier_base_property(u32 code_point);
|
|
|
|
bool code_point_has_emoji_presentation_property(u32 code_point);
|
|
|
|
bool code_point_has_identifier_start_property(u32 code_point);
|
|
|
|
bool code_point_has_identifier_continue_property(u32 code_point);
|
|
|
|
bool code_point_has_regional_indicator_property(u32 code_point);
|
|
|
|
bool code_point_has_variation_selector_property(u32 code_point);
|
2024-11-03 22:13:56 +00:00
|
|
|
bool code_point_has_white_space_property(u32 code_point);
|
2024-06-21 14:39:40 +00:00
|
|
|
|
2021-07-29 18:18:51 +00:00
|
|
|
bool is_ecma262_property(Property);
|
2021-07-29 01:45:09 +00:00
|
|
|
|
2021-11-10 23:55:02 +00:00
|
|
|
Optional<Script> script_from_string(StringView);
|
2021-08-03 21:11:19 +00:00
|
|
|
bool code_point_has_script(u32 code_point, Script script);
|
2021-08-04 11:05:30 +00:00
|
|
|
bool code_point_has_script_extension(u32 code_point, Script script);
|
2021-08-03 21:11:19 +00:00
|
|
|
|
2024-06-21 19:28:54 +00:00
|
|
|
enum class BidiClass {
|
|
|
|
ArabicNumber, // AN
|
|
|
|
BlockSeparator, // B
|
|
|
|
BoundaryNeutral, // BN
|
|
|
|
CommonNumberSeparator, // CS
|
|
|
|
DirNonSpacingMark, // NSM
|
|
|
|
EuropeanNumber, // EN
|
|
|
|
EuropeanNumberSeparator, // ES
|
|
|
|
EuropeanNumberTerminator, // ET
|
|
|
|
FirstStrongIsolate, // FSI
|
|
|
|
LeftToRight, // L
|
|
|
|
LeftToRightEmbedding, // LRE
|
|
|
|
LeftToRightIsolate, // LRI
|
|
|
|
LeftToRightOverride, // LRO
|
|
|
|
OtherNeutral, // ON
|
|
|
|
PopDirectionalFormat, // PDF
|
|
|
|
PopDirectionalIsolate, // PDI
|
|
|
|
RightToLeft, // R
|
|
|
|
RightToLeftArabic, // AL
|
|
|
|
RightToLeftEmbedding, // RLE
|
|
|
|
RightToLeftIsolate, // RLI
|
|
|
|
RightToLeftOverride, // RLO
|
|
|
|
SegmentSeparator, // S
|
|
|
|
WhiteSpaceNeutral, // WS
|
|
|
|
};
|
|
|
|
|
|
|
|
BidiClass bidirectional_class(u32 code_point);
|
2023-08-12 20:00:58 +00:00
|
|
|
|
2021-07-25 19:10:51 +00:00
|
|
|
}
|