2017-07-04 14:35:17 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-07-04 14:35:17 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
2019-05-29 06:16:12 +00:00
|
|
|
#include <string_view>
|
2017-07-04 14:35:17 +00:00
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "DiscIO/Blob.h"
|
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
class FileInfo;
|
2017-08-02 16:16:56 +00:00
|
|
|
struct Partition;
|
2017-07-04 14:35:17 +00:00
|
|
|
class Volume;
|
|
|
|
|
|
|
|
class VolumeFileBlobReader final : public BlobReader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static std::unique_ptr<VolumeFileBlobReader>
|
2019-05-29 06:16:12 +00:00
|
|
|
Create(const Volume& volume, const Partition& partition, std::string_view file_path);
|
2017-07-04 14:35:17 +00:00
|
|
|
|
|
|
|
BlobType GetBlobType() const override { return BlobType::PLAIN; }
|
2020-06-07 12:11:00 +00:00
|
|
|
|
2017-07-04 14:35:17 +00:00
|
|
|
u64 GetRawSize() const override;
|
2019-03-21 21:20:23 +00:00
|
|
|
u64 GetDataSize() const override;
|
2022-08-01 09:53:30 +00:00
|
|
|
DataSizeType GetDataSizeType() const override { return DataSizeType::Accurate; }
|
2020-06-07 12:11:00 +00:00
|
|
|
|
|
|
|
u64 GetBlockSize() const override;
|
|
|
|
bool HasFastRandomAccessInBlock() const override;
|
2020-06-21 18:41:50 +00:00
|
|
|
std::string GetCompressionMethod() const override;
|
2022-02-24 10:51:52 +00:00
|
|
|
std::optional<int> GetCompressionLevel() const override;
|
2020-06-07 12:11:00 +00:00
|
|
|
|
2017-07-04 14:35:17 +00:00
|
|
|
bool Read(u64 offset, u64 length, u8* out_ptr) override;
|
|
|
|
|
|
|
|
private:
|
2017-08-02 16:16:56 +00:00
|
|
|
VolumeFileBlobReader(const Volume& volume, const Partition& partition,
|
2017-07-04 14:35:17 +00:00
|
|
|
std::unique_ptr<FileInfo> file_info);
|
|
|
|
|
|
|
|
const Volume& m_volume;
|
2017-08-02 16:16:56 +00:00
|
|
|
const Partition& m_partition;
|
2017-07-04 14:35:17 +00:00
|
|
|
std::unique_ptr<FileInfo> m_file_info;
|
|
|
|
};
|
2019-05-05 23:48:12 +00:00
|
|
|
} // namespace DiscIO
|