RomFS: add RomFSFile and GetRomFSFile

This commit is contained in:
B3n30 2018-07-26 12:04:17 +02:00
parent 14878a17d9
commit b62978b5a1
2 changed files with 42 additions and 3 deletions

View file

@ -10,6 +10,18 @@
namespace RomFS {
class RomFSFile {
public:
RomFSFile();
RomFSFile(const u8* data, u64 length);
const u8* Data() const;
u64 Length() const;
private:
const u8* data;
u64 length;
};
/**
* Gets the pointer to a file in a RomFS image.
* @param romfs The pointer to the RomFS image
@ -19,4 +31,13 @@ namespace RomFS {
*/
const u8* GetFilePointer(const u8* romfs, const std::vector<std::u16string>& path);
/**
* 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