| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <memory> |
| 7 |
#include <string_view> |
| 8 |
|
| 9 |
#include "Common/CommonTypes.h" |
| 10 |
#include "DiscIO/Blob.h" |
| 11 |
|
| 12 |
namespace DiscIO |
| 13 |
{ |
| 14 |
class FileInfo; |
| 15 |
struct Partition; |
| 16 |
class Volume; |
| 17 |
|
| 18 |
class VolumeFileBlobReader final : public BlobReader |
| 19 |
{ |
| 20 |
public: |
| 21 |
static std::unique_ptr<VolumeFileBlobReader> |
| 22 |
Create(const Volume& volume, const Partition& partition, std::string_view file_path); |
| 23 |
~VolumeFileBlobReader(); |
| 24 |
|
| 25 |
BlobType GetBlobType() const override { return BlobType::PLAIN; } |
| 26 |
std::unique_ptr<BlobReader> CopyReader() const override; |
| 27 |
|
| 28 |
u64 GetRawSize() const override; |
| 29 |
u64 GetDataSize() const override; |
| 30 |
DataSizeType GetDataSizeType() const override { return DataSizeType::Accurate; } |
| 31 |
|
| 32 |
u64 GetBlockSize() const override; |
| 33 |
bool HasFastRandomAccessInBlock() const override; |
| 34 |
std::string GetCompressionMethod() const override; |
| 35 |
std::optional<int> GetCompressionLevel() const override; |
| 36 |
|
| 37 |
bool Read(u64 offset, u64 length, u8* out_ptr) override; |
| 38 |
|
| 39 |
private: |
| 40 |
VolumeFileBlobReader(const Volume& volume, const Partition& partition, |
| 41 |
std::unique_ptr<FileInfo> file_info); |
| 42 |
|
| 43 |
const Volume& m_volume; |
| 44 |
const Partition& m_partition; |
| 45 |
std::unique_ptr<FileInfo> m_file_info; |
| 46 |
}; |
| 47 |
} |