mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Remove recursion from RomFS parse, clang-format
This commit is contained in:
parent
2de35bd39d
commit
fb6ec3aa5f
4 changed files with 202 additions and 194 deletions
|
@ -1,22 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
||||
namespace IVFC {
|
||||
|
||||
struct IVFCLevel {
|
||||
u64 logicalOffset;
|
||||
u64 size;
|
||||
u64 blockSize;
|
||||
};
|
||||
struct IVFCLevel {
|
||||
u64 logicalOffset;
|
||||
u64 size;
|
||||
u64 blockSize;
|
||||
};
|
||||
|
||||
struct IVFC {
|
||||
u64 masterHashSize;
|
||||
std::vector<IVFCLevel> levels;
|
||||
};
|
||||
struct IVFC {
|
||||
u64 masterHashSize;
|
||||
std::vector<IVFCLevel> levels;
|
||||
};
|
||||
|
||||
size_t parseIVFC(uintptr_t ivfcStart, IVFC& ivfc);
|
||||
size_t parseIVFC(uintptr_t ivfcStart, IVFC& ivfc);
|
||||
|
||||
} // namespace IVFC
|
||||
} // namespace IVFC
|
|
@ -1,22 +1,23 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
||||
namespace RomFS {
|
||||
|
||||
struct RomFSNode {
|
||||
std::u16string name {};
|
||||
// The file/directory offset relative to the start of the RomFS
|
||||
u64 offset { 0 };
|
||||
u64 size { 0 };
|
||||
bool isDirectory { false };
|
||||
struct RomFSNode {
|
||||
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 {};
|
||||
};
|
||||
std::vector<std::unique_ptr<RomFSNode>> directories;
|
||||
std::vector<std::unique_ptr<RomFSNode>> files;
|
||||
};
|
||||
|
||||
std::unique_ptr<RomFSNode> parseRomFSTree(uintptr_t romFS, u64 romFSSize);
|
||||
|
||||
} // namespace RomFS
|
||||
std::unique_ptr<RomFSNode> parseRomFSTree(uintptr_t romFS, u64 romFSSize);
|
||||
|
||||
} // namespace RomFS
|
Loading…
Add table
Add a link
Reference in a new issue