2014-12-16 00:33:41 -05:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-16 21:38:14 -08:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-12-16 00:33:41 -05:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2017-12-09 14:12:04 -05:00
|
|
|
#include <utility>
|
2018-10-17 15:23:56 -04:00
|
|
|
#include "core/core.h"
|
2016-09-20 23:52:38 -07:00
|
|
|
#include "core/file_sys/archive_savedata.h"
|
2015-05-06 21:40:39 -03:00
|
|
|
#include "core/hle/kernel/process.h"
|
2014-12-16 00:33:41 -05:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FileSys namespace
|
|
|
|
|
|
|
|
namespace FileSys {
|
|
|
|
|
2016-11-28 23:47:41 +02:00
|
|
|
ArchiveFactory_SaveData::ArchiveFactory_SaveData(
|
|
|
|
std::shared_ptr<ArchiveSource_SDSaveData> sd_savedata)
|
2017-12-09 14:12:04 -05:00
|
|
|
: sd_savedata_source(std::move(sd_savedata)) {}
|
2014-12-16 00:33:41 -05:00
|
|
|
|
2015-02-06 11:53:14 -02:00
|
|
|
ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SaveData::Open(const Path& path) {
|
2018-10-17 15:23:56 -04:00
|
|
|
return sd_savedata_source->Open(
|
|
|
|
Core::System::GetInstance().Kernel().GetCurrentProcess()->codeset->program_id);
|
2014-12-29 13:04:37 -05:00
|
|
|
}
|
2014-12-16 00:33:41 -05:00
|
|
|
|
2016-09-18 09:38:01 +09:00
|
|
|
ResultCode ArchiveFactory_SaveData::Format(const Path& path,
|
|
|
|
const FileSys::ArchiveFormatInfo& format_info) {
|
2018-10-17 15:23:56 -04:00
|
|
|
return sd_savedata_source->Format(
|
|
|
|
Core::System::GetInstance().Kernel().GetCurrentProcess()->codeset->program_id, format_info);
|
2014-12-16 00:33:41 -05:00
|
|
|
}
|
|
|
|
|
2015-12-28 13:51:44 -05:00
|
|
|
ResultVal<ArchiveFormatInfo> ArchiveFactory_SaveData::GetFormatInfo(const Path& path) const {
|
2018-10-17 15:23:56 -04:00
|
|
|
return sd_savedata_source->GetFormatInfo(
|
|
|
|
Core::System::GetInstance().Kernel().GetCurrentProcess()->codeset->program_id);
|
2015-12-28 13:51:44 -05:00
|
|
|
}
|
|
|
|
|
2014-12-16 00:33:41 -05:00
|
|
|
} // namespace FileSys
|