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