summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Blob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-06-21 20:41:50 +0200
committerJosJuice <josjuice@gmail.com>2020-06-21 20:47:23 +0200
commitd494e0230c2ebfd580bb66b2a741d19ef830d658 (patch)
treeedd701dfdd98be00f0971dc747eea0dcbe5f7c71 /Source/Core/DiscIO/Blob.cpp
parent99822518994d62def4e336f6746d6a2e2d108fb2 (diff)
Show file format details in game properties
Diffstat (limited to 'Source/Core/DiscIO/Blob.cpp')
-rw-r--r--Source/Core/DiscIO/Blob.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp
index 50146c9c91..e24c52f181 100644
--- a/Source/Core/DiscIO/Blob.cpp
+++ b/Source/Core/DiscIO/Blob.cpp
@@ -12,6 +12,7 @@
#include "Common/CDUtils.h"
#include "Common/CommonTypes.h"
#include "Common/File.h"
+#include "Common/MsgHandler.h"
#include "DiscIO/Blob.h"
#include "DiscIO/CISOBlob.h"
@@ -25,6 +26,35 @@
namespace DiscIO
{
+std::string GetName(BlobType blob_type, bool translate)
+{
+ const auto translate_str = [translate](const std::string& str) {
+ return translate ? Common::GetStringT(str.c_str()) : str;
+ };
+
+ switch (blob_type)
+ {
+ case BlobType::PLAIN:
+ return "ISO";
+ case BlobType::DIRECTORY:
+ return translate_str("Directory");
+ case BlobType::GCZ:
+ return "GCZ";
+ case BlobType::CISO:
+ return "CISO";
+ case BlobType::WBFS:
+ return "WBFS";
+ case BlobType::TGC:
+ return "TGC";
+ case BlobType::WIA:
+ return "WIA";
+ case BlobType::RVZ:
+ return "RVZ";
+ default:
+ return "";
+ }
+}
+
void SectorReader::SetSectorSize(int blocksize)
{
m_block_size = std::max(blocksize, 0);