diff options
| author | bunnei <bunneidev@gmail.com> | 2018-09-25 16:59:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-25 16:59:44 -0400 |
| commit | fcce94706bfdcfe610528e2d71ad67fc355a5102 (patch) | |
| tree | 718decad5aae4153d8acaa444058914a1c12f147 /src/core/file_sys/vfs_real.cpp | |
| parent | a2ceebf4dc460f396f37ca187ecf351cdd47c839 (diff) | |
| parent | 0243903c12bd841af407b60b1b628d8bf7a21850 (diff) | |
Merge pull request #1365 from DarkLordZach/lfs
file_sys: Add support for LayeredFS mods
Diffstat (limited to 'src/core/file_sys/vfs_real.cpp')
| -rw-r--r-- | src/core/file_sys/vfs_real.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index 5e242e20fc..9defad04c4 100644 --- a/src/core/file_sys/vfs_real.cpp +++ b/src/core/file_sys/vfs_real.cpp @@ -413,6 +413,23 @@ std::string RealVfsDirectory::GetFullPath() const { return out; } +std::map<std::string, VfsEntryType, std::less<>> RealVfsDirectory::GetEntries() const { + if (perms == Mode::Append) + return {}; + + std::map<std::string, VfsEntryType, std::less<>> 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; } |
