GameList: Add "File Size" field

This commit is contained in:
Stenzek
2023-12-20 23:40:24 +10:00
parent fd341f6a9d
commit 36643fe78b
15 changed files with 128 additions and 26 deletions

View File

@ -32,6 +32,7 @@ public:
bool ReadSubChannelQ(SubChannelQ* subq, const Index& index, LBA lba_in_index) override;
bool HasNonStandardSubchannel() const override;
s64 GetSizeOnDisk() const override;
protected:
bool ReadSectorFromIndex(void* buffer, const Index& index, LBA lba_in_index) override;
@ -339,6 +340,15 @@ bool CDImageCueSheet::ReadSectorFromIndex(void* buffer, const Index& index, LBA
return true;
}
s64 CDImageCueSheet::GetSizeOnDisk() const
{
// Doesn't include the cue.. but they're tiny anyway, whatever.
u64 size = 0;
for (const TrackFile& tf : m_files)
size += FileSystem::FSize64(tf.file);
return size;
}
std::unique_ptr<CDImage> CDImage::OpenCueSheetImage(const char* filename, Error* error)
{
std::unique_ptr<CDImageCueSheet> image = std::make_unique<CDImageCueSheet>();