DiscIO: Move DecodeString to Volume.cpp

This had to be in the header back when it was templated, but 083faa8b
made it not templated.
This commit is contained in:
JosJuice
2026-02-23 20:39:27 +01:00
parent d58e7ca932
commit 1d74321212
2 changed files with 10 additions and 12 deletions

View File

@@ -3,10 +3,12 @@
#include "DiscIO/Volume.h"
#include <cstring>
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <type_traits>
#include <utility>
@@ -34,6 +36,13 @@ const IOS::ES::TicketReader Volume::INVALID_TICKET{};
const IOS::ES::TMDReader Volume::INVALID_TMD{};
const std::vector<u8> Volume::INVALID_CERT_CHAIN{};
std::string Volume::DecodeString(std::span<const char> data) const
{
// strnlen to trim null bytes
std::string string(data.data(), strnlen(data.data(), data.size()));
return GetRegion() == Region::NTSC_J ? SHIFTJISToUTF8(string) : CP1252ToUTF8(string);
}
template <typename T>
static void AddToSyncHash(Common::SHA1::Context* context, const T& data)
{