Serialize file/directory services

This commit is contained in:
Hamish Milne
2020-01-10 23:47:39 +00:00
committed by zhupengfei
parent 9525d81344
commit ca971ff31f
7 changed files with 81 additions and 3 deletions

View File

@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "common/logging/log.h"
#include "core/core.h"
#include "core/file_sys/errors.h"
@ -13,8 +14,20 @@
#include "core/hle/kernel/server_session.h"
#include "core/hle/service/fs/file.h"
SERIALIZE_EXPORT_IMPL(Service::FS::File)
SERIALIZE_EXPORT_IMPL(Service::FS::FileSessionSlot)
namespace Service::FS {
template <class Archive>
void File::serialize(Archive& ar, const unsigned int) {
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar& path;
ar& backend;
}
File::File() : ServiceFramework("", 1), kernel(Core::Global<Kernel::KernelSystem>()) {}
File::File(Kernel::KernelSystem& kernel, std::unique_ptr<FileSys::FileBackend>&& backend,
const FileSys::Path& path)
: ServiceFramework("", 1), path(path), backend(std::move(backend)), kernel(kernel) {