mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
edbbf493f8
Rather than rely on the developer to do the right thing, just make the default behavior safely deallocate resources. If shared semantics are ever needed in the future, the constructor that takes a unique_ptr for shared_ptr can be used.
35 lines
615 B
C++
35 lines
615 B
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#include <memory>
|
|
#include "DiscIO/Filesystem.h"
|
|
#include "DiscIO/FileSystemGCWii.h"
|
|
|
|
namespace DiscIO
|
|
{
|
|
|
|
IFileSystem::IFileSystem(const IVolume *_rVolume)
|
|
: m_rVolume(_rVolume)
|
|
{}
|
|
|
|
|
|
IFileSystem::~IFileSystem()
|
|
{}
|
|
|
|
|
|
std::unique_ptr<IFileSystem> CreateFileSystem(const IVolume* volume)
|
|
{
|
|
std::unique_ptr<IFileSystem> filesystem = std::make_unique<CFileSystemGCWii>(volume);
|
|
|
|
if (!filesystem)
|
|
return nullptr;
|
|
|
|
if (!filesystem->IsValid())
|
|
filesystem.reset();
|
|
|
|
return filesystem;
|
|
}
|
|
|
|
} // namespace
|