dolphin/Source/Core/DiscIO/Filesystem.cpp
JosJuice 19b8f1c10a 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.
2017-05-16 22:58:15 +02:00

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