2022-04-23 01:59:50 -07:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-07-27 15:14:03 -07:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "core/file_sys/vfs.h"
|
|
|
|
|
|
|
|
namespace FileSys {
|
|
|
|
|
2018-09-23 18:50:16 -07:00
|
|
|
enum class RomFSExtractionType {
|
2018-12-24 13:18:28 -08:00
|
|
|
Full, // Includes data directory
|
|
|
|
Truncated, // Traverses into data directory
|
|
|
|
SingleDiscard, // Traverses into the first subdirectory of root
|
2018-09-23 18:50:16 -07:00
|
|
|
};
|
|
|
|
|
2018-07-27 15:14:03 -07:00
|
|
|
// Converts a RomFS binary blob to VFS Filesystem
|
|
|
|
// Returns nullptr on failure
|
2018-09-23 18:50:16 -07:00
|
|
|
VirtualDir ExtractRomFS(VirtualFile file,
|
|
|
|
RomFSExtractionType type = RomFSExtractionType::Truncated);
|
2018-09-19 19:04:51 -07:00
|
|
|
|
|
|
|
// Converts a VFS filesystem into a RomFS binary
|
|
|
|
// Returns nullptr on failure
|
2018-10-02 05:56:56 -07:00
|
|
|
VirtualFile CreateRomFS(VirtualDir dir, VirtualDir ext = nullptr);
|
2018-07-27 15:14:03 -07:00
|
|
|
|
|
|
|
} // namespace FileSys
|