| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include <vector> |
| 11 |
#include "Common/CommonTypes.h" |
| 12 |
|
| 13 |
namespace File |
| 14 |
{ |
| 15 |
class IOFile; |
| 16 |
} |
| 17 |
|
| 18 |
namespace DiscIO |
| 19 |
{ |
| 20 |
class FileInfo; |
| 21 |
class Volume; |
| 22 |
struct Partition; |
| 23 |
|
| 24 |
class DiscScrubber final |
| 25 |
{ |
| 26 |
public: |
| 27 |
DiscScrubber(); |
| 28 |
|
| 29 |
bool SetupScrub(const Volume& disc); |
| 30 |
|
| 31 |
|
| 32 |
bool CanBlockBeScrubbed(u64 offset) const; |
| 33 |
|
| 34 |
static constexpr size_t CLUSTER_SIZE = 0x8000; |
| 35 |
|
| 36 |
private: |
| 37 |
void MarkAsUsed(u64 offset, u64 size); |
| 38 |
void MarkAsUsedE(u64 partition_data_offset, u64 offset, u64 size); |
| 39 |
u64 ToClusterOffset(u64 offset) const; |
| 40 |
bool ReadFromVolume(const Volume& disc, u64 offset, u32& buffer, const Partition& partition); |
| 41 |
bool ReadFromVolume(const Volume& disc, u64 offset, u64& buffer, const Partition& partition); |
| 42 |
bool ParseDisc(const Volume& disc); |
| 43 |
bool ParsePartitionData(const Volume& disc, const Partition& partition); |
| 44 |
void ParseFileSystemData(u64 partition_data_offset, const FileInfo& directory); |
| 45 |
|
| 46 |
std::vector<u8> m_free_table; |
| 47 |
u64 m_file_size = 0; |
| 48 |
bool m_has_wii_hashes = false; |
| 49 |
bool m_is_scrubbing = false; |
| 50 |
}; |
| 51 |
|
| 52 |
} |