dolphin/Source/Core/DiscIO/Filesystem.cpp

38 lines
807 B
C++
Raw Normal View History

// Copyright 2008 Dolphin Emulator Project
2015-05-18 02:08:10 +03:00
// 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
{
2017-06-14 00:05:30 +03:00
FileInfo::~FileInfo() = default;
2015-08-09 21:53:38 +03:00
FileSystem::FileSystem(const Volume* volume, const Partition& partition)
: m_volume(volume), m_partition(partition)
{
}
2017-06-14 00:05:30 +03:00
FileSystem::~FileSystem() = default;
std::unique_ptr<FileSystem> CreateFileSystem(const Volume* volume, const Partition& partition)
{
if (!volume)
return nullptr;
std::unique_ptr<FileSystem> filesystem = std::make_unique<FileSystemGCWii>(volume, partition);
if (!filesystem)
return nullptr;
if (!filesystem->IsValid())
filesystem.reset();
return filesystem;
}
} // namespace