dolphin/Source/Core/DolphinQt/QtUtils/FromStdString.h
mitaclaw 672be6a8cf PPCSymbolDB: GetDescription by std::string_view
Should save a lot of deep copies.
2024-04-13 00:19:01 -07:00

24 lines
499 B
C++

// Copyright 2024 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QString>
#include <string_view>
namespace QtUtils
{
inline QString FromStdString(std::string_view s)
{
return QString::fromUtf8(s.data(), s.size());
}
inline QString FromStdString(std::u8string_view s)
{
return QString::fromUtf8(s.data(), s.size());
}
inline QString FromStdString(std::u16string_view s)
{
return QString::fromUtf16(s.data(), s.size());
}
} // namespace QtUtils