VolumeWiiCrypted: Replace ChangePartition with a partition parameter

By removing mutable state in VolumeWiiCrypted, this change makes
partition-related code simpler. It also gets rid of other ugly things,
like ISOProperties's "over 9000" loop that creates a list of
partitions by trying possible combinations, and DiscScrubber's
volume swapping that recreates the entire volume when it needs to
change partition.
This commit is contained in:
JosJuice
2015-06-13 12:51:24 +02:00
parent 74d84c5af2
commit 19b8f1c10a
35 changed files with 622 additions and 639 deletions

View File

@ -9,11 +9,10 @@
#include <vector>
#include "Common/CommonTypes.h"
#include "DiscIO/Volume.h"
namespace DiscIO
{
class IVolume;
// file info of an FST entry
struct SFileInfo
{
@ -35,7 +34,7 @@ struct SFileInfo
class IFileSystem
{
public:
IFileSystem(const IVolume* _rVolume);
IFileSystem(const IVolume* _rVolume, const Partition& partition);
virtual ~IFileSystem();
virtual bool IsValid() const = 0;
@ -50,10 +49,12 @@ public:
virtual u64 GetBootDOLOffset() const = 0;
virtual u32 GetBootDOLSize(u64 dol_offset) const = 0;
virtual const Partition GetPartition() const { return m_partition; }
protected:
const IVolume* m_rVolume;
const IVolume* const m_rVolume;
const Partition m_partition;
};
std::unique_ptr<IFileSystem> CreateFileSystem(const IVolume* volume);
std::unique_ptr<IFileSystem> CreateFileSystem(const IVolume* volume, const Partition& partition);
} // namespace