mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-23 20:40:05 +00:00
370d77f13a
By default, a regular copy requires an atomic increment and decrement. A move avoids this from occurring, which makes sense when the constructor is taking the shared_ptr by value.
32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
// Copyright 2014 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#include <utility>
|
|
#include "core/file_sys/archive_savedata.h"
|
|
#include "core/hle/kernel/process.h"
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// FileSys namespace
|
|
|
|
namespace FileSys {
|
|
|
|
ArchiveFactory_SaveData::ArchiveFactory_SaveData(
|
|
std::shared_ptr<ArchiveSource_SDSaveData> sd_savedata)
|
|
: sd_savedata_source(std::move(sd_savedata)) {}
|
|
|
|
ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveData::Open(const Path& path) {
|
|
return sd_savedata_source->Open(Kernel::g_current_process->codeset->program_id);
|
|
}
|
|
|
|
ResultCode ArchiveFactory_SaveData::Format(const Path& path,
|
|
const FileSys::ArchiveFormatInfo& format_info) {
|
|
return sd_savedata_source->Format(Kernel::g_current_process->codeset->program_id, format_info);
|
|
}
|
|
|
|
ResultVal<ArchiveFormatInfo> ArchiveFactory_SaveData::GetFormatInfo(const Path& path) const {
|
|
return sd_savedata_source->GetFormatInfo(Kernel::g_current_process->codeset->program_id);
|
|
}
|
|
|
|
} // namespace FileSys
|