2017-06-15 16:09:05 +00:00
|
|
|
// 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 {
|
|
|
|
|
2018-07-26 10:04:17 +00:00
|
|
|
class RomFSFile {
|
|
|
|
public:
|
2018-07-26 11:10:56 +00:00
|
|
|
RomFSFile() = default;
|
2018-07-26 10:04:17 +00:00
|
|
|
RomFSFile(const u8* data, u64 length);
|
|
|
|
const u8* Data() const;
|
|
|
|
u64 Length() const;
|
|
|
|
|
|
|
|
private:
|
2018-07-26 11:10:56 +00:00
|
|
|
const u8* data = nullptr;
|
|
|
|
u64 length = 0;
|
2018-07-26 10:04:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2017-06-15 16:09:05 +00:00
|
|
|
} // namespace RomFS
|