summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DiscExtractor.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2019-04-11 16:39:49 +0200
committerGitHub <noreply@github.com>2019-04-11 16:39:49 +0200
commitd5ed3cbd88b9cd473b4de5fbbf576ab18db2ab37 (patch)
tree3ccba3b1e0c4e4e285ec6069f83c0efebb6ee253 /Source/Core/DiscIO/DiscExtractor.cpp
parent372b8552ce7c94c026e2309c0b9089440bdae672 (diff)
parent8709b21ac30f5da5c32ef056b6562a37345b5f82 (diff)
Merge pull request #7922 from JosJuice/verify-disc
Add a Verify tab to game properties
Diffstat (limited to 'Source/Core/DiscIO/DiscExtractor.cpp')
-rw-r--r--Source/Core/DiscIO/DiscExtractor.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp
index c9a26f5bdb..057a22378d 100644
--- a/Source/Core/DiscIO/DiscExtractor.cpp
+++ b/Source/Core/DiscIO/DiscExtractor.cpp
@@ -19,16 +19,21 @@
namespace DiscIO
{
-std::string DirectoryNameForPartitionType(u32 partition_type)
+std::string NameForPartitionType(u32 partition_type, bool include_prefix)
{
switch (partition_type)
{
- case 0:
+ case PARTITION_DATA:
return "DATA";
- case 1:
+ case PARTITION_UPDATE:
return "UPDATE";
- case 2:
+ case PARTITION_CHANNEL:
return "CHANNEL";
+ case PARTITION_INSTALL:
+ // wit doesn't recognize the name "INSTALL", so we can't use it when naming partition folders
+ if (!include_prefix)
+ return "INSTALL";
+ // [[fallthrough]]
default:
const std::string type_as_game_id{static_cast<char>((partition_type >> 24) & 0xFF),
static_cast<char>((partition_type >> 16) & 0xFF),
@@ -37,10 +42,10 @@ std::string DirectoryNameForPartitionType(u32 partition_type)
if (std::all_of(type_as_game_id.cbegin(), type_as_game_id.cend(),
[](char c) { return std::isalnum(c, std::locale::classic()); }))
{
- return "P-" + type_as_game_id;
+ return include_prefix ? "P-" + type_as_game_id : type_as_game_id;
}
- return StringFromFormat("P%u", partition_type);
+ return StringFromFormat(include_prefix ? "P%u" : "%u", partition_type);
}
}