diff options
| author | JosJuice <josjuice@gmail.com> | 2019-03-21 22:23:12 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2019-03-30 12:45:17 +0100 |
| commit | cf9ab6ddcc93cd279aaf62897095ac5b8929bab9 (patch) | |
| tree | b20b104c79f2c133e65a307bca69cc6109ebd1e2 /Source/Core/DiscIO/DiscExtractor.cpp | |
| parent | 3014dadfa8c2065f81009895ecf81396de5120bc (diff) | |
DiscExtractor: Make P prefix for partition names optional
Also added constants for common partition types.
Diffstat (limited to 'Source/Core/DiscIO/DiscExtractor.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DiscExtractor.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp index c9a26f5bdb..34c55a1d73 100644 --- a/Source/Core/DiscIO/DiscExtractor.cpp +++ b/Source/Core/DiscIO/DiscExtractor.cpp @@ -19,15 +19,15 @@ 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"; default: const std::string type_as_game_id{static_cast<char>((partition_type >> 24) & 0xFF), @@ -37,10 +37,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); } } |
