aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/vfs_real.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-09-25 16:59:44 -0400
committerGitHub <noreply@github.com>2018-09-25 16:59:44 -0400
commit7b81e1e52565ee867c285e2b0c2526f8d4b82581 (patch)
tree718decad5aae4153d8acaa444058914a1c12f147 /src/core/file_sys/vfs_real.cpp
parentb67c1fdf38655638d746b4cb252f16bd298da017 (diff)
parentb3c2ec362bbbdd89da9c0aa84b425717f5e3d351 (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.cpp17
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 5e242e20f..9defad04c 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;
}