mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
AK+LibJS+LibRegex: Define an alias for UTF-16 string data storage
Instead of writing out "Vector<u16, 1>" everywhere, let's have a name for it.
This commit is contained in:
parent
39bda0073e
commit
425c168ded
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/trflynn89
Commit: 425c168ded
Pull-request: https://github.com/SerenityOS/serenity/pull/16895
Reviewed-by: https://github.com/linusg
10 changed files with 37 additions and 34 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -16,10 +16,12 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
Vector<u16, 1> utf8_to_utf16(StringView);
|
||||
Vector<u16, 1> utf8_to_utf16(Utf8View const&);
|
||||
Vector<u16, 1> utf32_to_utf16(Utf32View const&);
|
||||
void code_point_to_utf16(Vector<u16, 1>&, u32);
|
||||
using Utf16Data = Vector<u16, 1>;
|
||||
|
||||
Utf16Data utf8_to_utf16(StringView);
|
||||
Utf16Data utf8_to_utf16(Utf8View const&);
|
||||
Utf16Data utf32_to_utf16(Utf32View const&);
|
||||
void code_point_to_utf16(Utf16Data&, u32);
|
||||
|
||||
class Utf16View;
|
||||
|
||||
|
@ -126,5 +128,6 @@ struct AK::Formatter<AK::Utf16View> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Utf16Data;
|
||||
using AK::Utf16View;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue