2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DiscIO/Filesystem.h"
|
2016-06-24 08:43:46 +00:00
|
|
|
#include <memory>
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DiscIO/FileSystemGCWii.h"
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
IFileSystem::IFileSystem(const IVolume* _rVolume) : m_rVolume(_rVolume)
|
|
|
|
{
|
|
|
|
}
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
IFileSystem::~IFileSystem()
|
2016-06-24 08:43:46 +00:00
|
|
|
{
|
|
|
|
}
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2015-12-07 04:15:51 +00:00
|
|
|
std::unique_ptr<IFileSystem> CreateFileSystem(const IVolume* volume)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2017-02-12 12:02:57 +00:00
|
|
|
if (!volume)
|
|
|
|
return nullptr;
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
std::unique_ptr<IFileSystem> filesystem = std::make_unique<CFileSystemGCWii>(volume);
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
if (!filesystem)
|
|
|
|
return nullptr;
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
if (!filesystem->IsValid())
|
|
|
|
filesystem.reset();
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
return filesystem;
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
2009-02-28 01:26:56 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
} // namespace
|