DiscIO: implement CISOBlob::GetDataSize()

This is a best-effort approach, since the CISO format does not save the
original file size.
This commit is contained in:
Tillmann Karras 2015-09-17 10:58:38 +02:00
parent 1a8e2e16e3
commit efe71e686b
2 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,7 @@ CISOFileReader* CISOFileReader::Create(const std::string& filename)
u64 CISOFileReader::GetDataSize() const u64 CISOFileReader::GetDataSize() const
{ {
return GetRawSize(); return CISO_MAP_SIZE * m_block_size;
} }
u64 CISOFileReader::GetRawSize() const u64 CISOFileReader::GetRawSize() const

View File

@ -37,7 +37,11 @@ public:
static CISOFileReader* Create(const std::string& filename); static CISOFileReader* Create(const std::string& filename);
BlobType GetBlobType() const override { return BlobType::CISO; } BlobType GetBlobType() const override { return BlobType::CISO; }
// The CISO format does not save the original file size.
// This function returns an upper bound.
u64 GetDataSize() const override; u64 GetDataSize() const override;
u64 GetRawSize() const override; u64 GetRawSize() const override;
bool Read(u64 offset, u64 nbytes, u8* out_ptr) override; bool Read(u64 offset, u64 nbytes, u8* out_ptr) override;