Add RomFS directory traversal stuff

This commit is contained in:
offtkp 2023-07-29 04:02:13 +03:00
parent f3ce29bf2d
commit 2de35bd39d
2 changed files with 128 additions and 4 deletions

View file

@ -1,13 +1,22 @@
#pragma once
#include "helpers.hpp"
#include <string>
#include <vector>
#include <memory>
namespace RomFS {
struct RomFSNode {
std::vector<RomFSNode> children;
std::u16string name {};
// The file/directory offset relative to the start of the RomFS
u64 offset { 0 };
u64 size { 0 };
bool isDirectory { false };
std::vector<std::unique_ptr<RomFSNode>> directories {};
std::vector<std::unique_ptr<RomFSNode>> files {};
};
RomFSNode parseRomFSTree(uintptr_t romFS, u64 romFSSize);
std::unique_ptr<RomFSNode> parseRomFSTree(uintptr_t romFS, u64 romFSSize);
} // namespace RomFS