DiscIO/DirectoryBlob: Add ability to have an offset for a partition ContentSource.

This commit is contained in:
Admiral H. Curtiss
2021-09-22 02:51:10 +02:00
parent a14436fe3f
commit b7a9cc37b1
2 changed files with 32 additions and 12 deletions

View File

@ -43,11 +43,24 @@ struct ContentFile
u64 m_offset;
};
using ContentSource =
std::variant<ContentFile, // File
const u8*, // Memory
DirectoryBlobReader* // Partition (which one it is is determined by m_offset)
>;
// Content chunk that loads data from a DirectoryBlobReader.
// Intented for representing a partition within a disc.
struct ContentPartition
{
// The reader to read data from.
DirectoryBlobReader* m_reader;
// Offset from the start of the partition for the first byte represented by this chunk.
u64 m_offset;
// The value passed as partition_data_offset to EncryptPartitionData().
u64 m_partition_data_offset;
};
using ContentSource = std::variant<ContentFile, // File
const u8*, // Memory
ContentPartition // Partition
>;
class DiscContent
{