mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
PPCSymbolDB: GetDescription by std::string_view
Should save a lot of deep copies.
This commit is contained in:
23
Source/Core/DolphinQt/QtUtils/FromStdString.h
Normal file
23
Source/Core/DolphinQt/QtUtils/FromStdString.h
Normal file
@ -0,0 +1,23 @@
|
||||
// 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
|
Reference in New Issue
Block a user