mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
Ladybird: Add a utility to create a QString from an AK::String
This commit is contained in:
parent
fc15968418
commit
b4d3fea002
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue