/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#pragma once
#include
#include
#include
#include
namespace ams::fssrv {
namespace impl {
class FileSystemProxyCoreImpl;
}
class NcaFileSystemService;
class SaveDataFileSystemService;
class FileSystemProxyImpl {
NON_COPYABLE(FileSystemProxyImpl);
NON_MOVEABLE(FileSystemProxyImpl);
private:
impl::FileSystemProxyCoreImpl *m_impl;
std::shared_ptr m_nca_service;
std::shared_ptr m_save_data_service;
u64 m_process_id;
public:
FileSystemProxyImpl();
~FileSystemProxyImpl();
/* TODO */
public:
/* fsp-ldr */
Result OpenCodeFileSystemDeprecated(ams::sf::Out> out_fs, const fssrv::sf::Path &path, ncm::ProgramId program_id);
Result OpenCodeFileSystem(ams::sf::Out> out_fs, ams::sf::Out out_verif, const fssrv::sf::Path &path, ncm::ProgramId program_id);
Result IsArchivedProgram(ams::sf::Out out, u64 process_id);
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid);
};
static_assert(sf::IsIFileSystemProxy);
static_assert(sf::IsIFileSystemProxyForLoader);
class InvalidFileSystemProxyImplForLoader {
public:
Result OpenCodeFileSystemDeprecated(ams::sf::Out> out_fs, const fssrv::sf::Path &path, ncm::ProgramId program_id) {
AMS_UNUSED(out_fs, path, program_id);
return fs::ResultPortAcceptableCountLimited();
}
Result OpenCodeFileSystem(ams::sf::Out> out_fs, ams::sf::Out out_verif, const fssrv::sf::Path &path, ncm::ProgramId program_id) {
AMS_UNUSED(out_fs, out_verif, path, program_id);
return fs::ResultPortAcceptableCountLimited();
}
Result IsArchivedProgram(ams::sf::Out out, u64 process_id) {
AMS_UNUSED(out, process_id);
return fs::ResultPortAcceptableCountLimited();
}
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid) {
AMS_UNUSED(client_pid);
return fs::ResultPortAcceptableCountLimited();
}
};
static_assert(sf::IsIFileSystemProxyForLoader);
}