Files
BluTac10-Xbox_Neo/Minecraft.Client/FolderFile.h
George V. 192c2a3c5c feat: implement recursive folder traversal for file indexing
The previous implementation only indexed files in the root directory,
ignoring files in subdirectories. This change adds recursive traversal
to index all files within the folder hierarchy while maintaining
relative paths for compatibility.
2026-04-11 20:49:57 +03:00

29 lines
648 B
C++

#pragma once
#include <vector>
#include <unordered_map>
#include <windows.h>
#include "../Minecraft.World/ArrayWithLength.h"
using namespace std;
class FolderFile
{
private:
wstring m_folderPath;
unordered_map<wstring, wstring> m_filePaths; // filename -> full path
void _buildFileIndex();
void _buildFileIndexRecursive(const wstring& currentPath, const wstring& relativePath);
public:
FolderFile(wstring folderPath);
~FolderFile();
vector<wstring>* getFileList();
bool hasFile(const wstring &filename);
int getFileSize(const wstring &filename);
byteArray getFile(const wstring &filename);
};