2014-12-16 06:33:41 +01:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 06:38:14 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-12-16 06:33:41 +01:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-03-29 19:56:25 +02:00
|
|
|
#include <boost/serialization/base_object.hpp>
|
2020-01-03 00:34:26 +01:00
|
|
|
#include <boost/serialization/shared_ptr.hpp>
|
2016-11-28 22:47:41 +01:00
|
|
|
#include "core/file_sys/archive_source_sd_savedata.h"
|
2014-12-16 06:33:41 +01:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FileSys namespace
|
|
|
|
|
|
|
|
namespace FileSys {
|
|
|
|
|
|
|
|
/// File system interface to the SaveData archive
|
2015-02-06 14:53:14 +01:00
|
|
|
class ArchiveFactory_SaveData final : public ArchiveFactory {
|
2014-12-16 06:33:41 +01:00
|
|
|
public:
|
2016-11-28 22:47:41 +01:00
|
|
|
explicit ArchiveFactory_SaveData(std::shared_ptr<ArchiveSource_SDSaveData> sd_savedata_source);
|
2014-12-16 06:33:41 +01:00
|
|
|
|
2016-09-18 02:38:01 +02:00
|
|
|
std::string GetName() const override {
|
|
|
|
return "SaveData";
|
|
|
|
}
|
2014-12-29 19:04:37 +01:00
|
|
|
|
2019-02-03 02:14:01 +01:00
|
|
|
ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path, u64 program_id) override;
|
|
|
|
ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info,
|
|
|
|
u64 program_id) override;
|
2015-12-28 19:51:44 +01:00
|
|
|
|
2019-02-03 02:14:01 +01:00
|
|
|
ResultVal<ArchiveFormatInfo> GetFormatInfo(const Path& path, u64 program_id) const override;
|
2014-12-29 19:04:37 +01:00
|
|
|
|
2015-02-06 14:53:14 +01:00
|
|
|
private:
|
2016-11-28 22:47:41 +01:00
|
|
|
std::shared_ptr<ArchiveSource_SDSaveData> sd_savedata_source;
|
2020-01-03 00:34:26 +01:00
|
|
|
|
|
|
|
ArchiveFactory_SaveData() = default;
|
|
|
|
template <class Archive>
|
|
|
|
void serialize(Archive& ar, const unsigned int) {
|
2020-01-09 00:19:49 +01:00
|
|
|
ar& boost::serialization::base_object<ArchiveFactory>(*this);
|
2020-01-03 00:34:26 +01:00
|
|
|
ar& sd_savedata_source;
|
|
|
|
}
|
|
|
|
friend class boost::serialization::access;
|
2014-12-16 06:33:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace FileSys
|
2020-01-03 00:34:26 +01:00
|
|
|
|
|
|
|
BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_SaveData)
|