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