summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Blob.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2020-06-25 11:00:49 +0100
committerGitHub <noreply@github.com>2020-06-25 11:00:49 +0100
commit26ed3b318c604281d9397cdb923cd43380cbbe76 (patch)
treeca45960fe36a98fdb6454c3f67968ee10218a84b /Source/Core/DiscIO/Blob.cpp
parenta1a107dc08e8b36f908ac901273f082bb3e00612 (diff)
parentd494e0230c2ebfd580bb66b2a741d19ef830d658 (diff)
Merge pull request #8891 from JosJuice/file-details
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);