summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/romfs.h
blob: 5d7f0c2a8a51377caf21d8bed6b3d686208e7f7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "core/file_sys/vfs.h"

namespace FileSys {

enum class RomFSExtractionType {
    Full,          // Includes data directory
    Truncated,     // Traverses into data directory
    SingleDiscard, // Traverses into the first subdirectory of root
};

// Converts a RomFS binary blob to VFS Filesystem
// Returns nullptr on failure
VirtualDir ExtractRomFS(VirtualFile file,
                        RomFSExtractionType type = RomFSExtractionType::Truncated);

// Converts a VFS filesystem into a RomFS binary
// Returns nullptr on failure
VirtualFile CreateRomFS(VirtualDir dir, VirtualDir ext = nullptr);

} // namespace FileSys