Ladybird: Add a utility to create a QString from an AK::String

This commit is contained in:
Timothy Flynn 2023-03-13 17:30:31 -04:00 committed by Linus Groh
parent fc15968418
commit b4d3fea002
Notes: sideshowbarker 2024-07-17 03:18:29 +09:00
2 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,12 @@ QString qstring_from_ak_deprecated_string(AK::DeprecatedString const& ak_depreca
return QString::fromUtf8(ak_deprecated_string.characters(), ak_deprecated_string.length());
}
QString qstring_from_ak_string(String const& ak_string)
{
auto view = ak_string.bytes_as_string_view();
return QString::fromUtf8(view.characters_without_null_termination(), view.length());
}
void platform_init()
{
#ifdef AK_OS_ANDROID

View File

@ -13,6 +13,7 @@
AK::DeprecatedString ak_deprecated_string_from_qstring(QString const&);
ErrorOr<String> ak_string_from_qstring(QString const&);
QString qstring_from_ak_deprecated_string(AK::DeprecatedString const&);
QString qstring_from_ak_string(String const&);
void platform_init();
extern DeprecatedString s_serenity_resource_root;