File size: 841 Bytes
034d0a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
// Copyright 2017 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <string>
#include <vector>
#include "common/common_types.h"

namespace RomFS {

class RomFSFile {
public:
    RomFSFile() = default;
    RomFSFile(const u8* data, u64 length);
    const u8* Data() const;
    u64 Length() const;

private:
    const u8* data = nullptr;
    u64 length = 0;
};

/**
 * Gets a RomFSFile class to a file in a RomFS image.
 * @param romfs The pointer to the RomFS image
 * @param path A vector containing the directory names and file name of the path to the file
 * @return the RomFSFile to the file
 * @todo reimplement this with a full RomFS manager
 */
const RomFSFile GetFile(const u8* romfs, const std::vector<std::u16string>& path);

} // namespace RomFS