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