// Copyright 2017 Citra Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #pragma once #include #include #include #include #include "common/common_types.h" #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" #include "core/loader/loader.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace namespace FileSys { struct NCCHData { std::shared_ptr> icon; std::shared_ptr> logo; std::shared_ptr> banner; std::shared_ptr romfs_file; std::shared_ptr update_romfs_file; }; /// File system interface to the SelfNCCH archive class ArchiveFactory_SelfNCCH final : public ArchiveFactory { public: ArchiveFactory_SelfNCCH() = default; /// Registers a loaded application so that we can open its SelfNCCH archive when requested. void Register(Loader::AppLoader& app_loader); std::string GetName() const override { return "SelfNCCH"; } ResultVal> Open(const Path& path, u64 program_id) override; ResultCode Format(const Path& path, const FileSys::ArchiveFormatInfo& format_info, u64 program_id) override; ResultVal GetFormatInfo(const Path& path, u64 program_id) const override; private: /// Mapping of ProgramId -> NCCHData std::unordered_map ncch_data; }; } // namespace FileSys