mirror of
https://github.com/dolphin-emu/dolphin
synced 2024-11-21 21:04:05 -05:00
672be6a8cf
Should save a lot of deep copies.
24 lines
499 B
C++
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
|