/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include AK::ByteString ak_byte_string_from_qstring(QString const&); AK::ByteString ak_byte_string_from_qbytearray(QByteArray const&); String ak_string_from_qstring(QString const&); QString qstring_from_ak_string(StringView); Utf16String utf16_string_from_qstring(QString const&); QString qstring_from_utf16_string(Utf16View const&); QString vqformatted(StringView, AK::TypeErasedFormatParams&); template QString qformatted(CheckedFormatString&& format, Parameters const&... parameters) { AK::VariadicFormatParams variadic_format_parameters { parameters... }; return vqformatted(format.view(), variadic_format_parameters); } QByteArray qbytearray_from_ak_string(StringView); Optional ak_url_from_qstring(QString const&); URL::URL ak_url_from_qurl(QUrl const&); namespace AK { template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, QString const& value) { Utf16View view { reinterpret_cast(value.utf16()), static_cast(value.size()) }; return Formatter::format(builder, view); } }; }