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