/* * Copyright (c) 2018 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 "fsmitm_romstorage.hpp" #include "fsmitm_romfsbuild.hpp" #include "fsmitm_utils.hpp" /* Represents a merged RomFS. */ class LayeredRomFS : public IROStorage { private: /* Data Sources. */ std::shared_ptr storage_romfs; std::shared_ptr file_romfs; /* Information about the merged RomFS. */ u64 title_id; std::shared_ptr> p_source_infos; LayeredRomFS *Clone() override { return new LayeredRomFS(*this); }; public: LayeredRomFS(std::shared_ptr s_r, std::shared_ptr f_r, u64 tid); virtual ~LayeredRomFS() = default; Result Read(void *buffer, size_t size, u64 offset) override; Result GetSize(u64 *out_size) override; Result OperateRange(u32 operation_type, u64 offset, u64 size, FsRangeInfo *out_range_info) override; };