CDImage: Add Precache() method

This commit is contained in:
Connor McLaughlin
2022-04-03 20:55:27 +10:00
parent ec9411c0a7
commit 9ab64ecdb3
3 changed files with 31 additions and 5 deletions

View File

@ -324,6 +324,11 @@ std::string CDImage::GetSubImageMetadata(u32 index, const std::string_view& type
return {};
}
CDImage::PrecacheResult CDImage::Precache(ProgressCallback* progress /*= ProgressCallback::NullProgressCallback*/)
{
return PrecacheResult::Unsupported;
}
void CDImage::ClearTOC()
{
m_lba_count = 0;

View File

@ -57,6 +57,13 @@ public:
Mode2Raw // 2352 bytes per sector
};
enum class PrecacheResult : u8
{
Unsupported,
ReadError,
Success,
};
struct SectorHeader
{
u8 minute;
@ -294,6 +301,9 @@ public:
// Retrieve sub-image metadata.
virtual std::string GetSubImageMetadata(u32 index, const std::string_view& type) const;
// Returns true if the source supports precaching, which may be more optimal than an in-memory copy.
virtual PrecacheResult Precache(ProgressCallback* progress = ProgressCallback::NullProgressCallback);
protected:
void ClearTOC();
void CopyTOC(const CDImage* image);