mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 16:55:46 +00:00
vfs: Add GetEntries method
Maps name string to directory or file.
This commit is contained in:
parent
2f2bd3b952
commit
df19124e6d
4 changed files with 32 additions and 0 deletions
|
@ -413,6 +413,23 @@ std::string RealVfsDirectory::GetFullPath() const {
|
|||
return out;
|
||||
}
|
||||
|
||||
std::map<std::string, VfsEntryType> RealVfsDirectory::GetEntries() const {
|
||||
if (perms == Mode::Append)
|
||||
return {};
|
||||
|
||||
std::map<std::string, VfsEntryType> out;
|
||||
FileUtil::ForeachDirectoryEntry(
|
||||
nullptr, path,
|
||||
[&out](u64* entries_out, const std::string& directory, const std::string& filename) {
|
||||
const std::string full_path = directory + DIR_SEP + filename;
|
||||
out.emplace(filename, FileUtil::IsDirectory(full_path) ? VfsEntryType::Directory
|
||||
: VfsEntryType::File);
|
||||
return true;
|
||||
});
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
bool RealVfsDirectory::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue