mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
DiscExtractor: Make P prefix for partition names optional
Also added constants for common partition types.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user