mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
391beef707
This will help a lot with developing chromes for different UI frameworks where we can see which helper classes and processes are really using Qt vs just using it to get at helper data. As a bonus, remove Qt dependency from WebDriver.
28 lines
823 B
C++
28 lines
823 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "StringUtils.h"
|
|
|
|
AK::DeprecatedString ak_deprecated_string_from_qstring(QString const& qstring)
|
|
{
|
|
return AK::DeprecatedString(qstring.toUtf8().data());
|
|
}
|
|
|
|
ErrorOr<String> ak_string_from_qstring(QString const& qstring)
|
|
{
|
|
return String::from_utf8(StringView(qstring.toUtf8().data(), qstring.size()));
|
|
}
|
|
|
|
QString qstring_from_ak_deprecated_string(AK::DeprecatedString const& ak_deprecated_string)
|
|
{
|
|
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());
|
|
}
|