1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

LibUnicode: Add a method to check if a code point could start an emoji

This commit is contained in:
Timothy Flynn 2023-02-23 08:33:22 -05:00 committed by Linus Groh
parent 8c38d46c1a
commit 1484d3d9f5
4 changed files with 163 additions and 2 deletions

View file

@ -1,11 +1,12 @@
/*
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
* Copyright (c) 2022-2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <AK/Optional.h>
#include <AK/StringView.h>
#include <AK/Types.h>
@ -46,6 +47,9 @@ Optional<Emoji> find_emoji_for_code_points(u32 const (&code_points)[Size])
return find_emoji_for_code_points(ReadonlySpan<u32> { code_points });
}
bool could_be_start_of_emoji_sequence(Utf8CodePointIterator const&);
bool could_be_start_of_emoji_sequence(Utf32CodePointIterator const&);
constexpr StringView emoji_group_to_string(EmojiGroup group)
{
switch (group) {