mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
19b8f1c10a
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.
38 lines
780 B
C++
38 lines
780 B
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#include "DiscIO/Filesystem.h"
|
|
#include <memory>
|
|
#include "DiscIO/FileSystemGCWii.h"
|
|
#include "DiscIO/Volume.h"
|
|
|
|
namespace DiscIO
|
|
{
|
|
IFileSystem::IFileSystem(const IVolume* _rVolume, const Partition& partition)
|
|
: m_rVolume(_rVolume), m_partition(partition)
|
|
{
|
|
}
|
|
|
|
IFileSystem::~IFileSystem()
|
|
{
|
|
}
|
|
|
|
std::unique_ptr<IFileSystem> CreateFileSystem(const IVolume* volume, const Partition& partition)
|
|
{
|
|
if (!volume)
|
|
return nullptr;
|
|
|
|
std::unique_ptr<IFileSystem> filesystem = std::make_unique<CFileSystemGCWii>(volume, partition);
|
|
|
|
if (!filesystem)
|
|
return nullptr;
|
|
|
|
if (!filesystem->IsValid())
|
|
filesystem.reset();
|
|
|
|
return filesystem;
|
|
}
|
|
|
|
} // namespace
|