summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/vfs_layered.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-09-25 23:38:16 +0200
committerLioncash <mathew1800@gmail.com>2018-09-26 02:06:01 +0200
commit28bef31ea80478fe58bc4eeaf1b245005f15b36a (patch)
tree8ccdb13e155d15b44893a0477984cc83bdf41224 /src/core/file_sys/vfs_layered.cpp
parentvfs_static: Remove template byte parameter from StaticVfsFile (diff)
downloadyuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.tar
yuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.tar.gz
yuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.tar.bz2
yuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.tar.lz
yuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.tar.xz
yuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.tar.zst
yuzu-28bef31ea80478fe58bc4eeaf1b245005f15b36a.zip
Diffstat (limited to 'src/core/file_sys/vfs_layered.cpp')
-rw-r--r--src/core/file_sys/vfs_layered.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/file_sys/vfs_layered.cpp b/src/core/file_sys/vfs_layered.cpp
index 45563d7ae..bfee01725 100644
--- a/src/core/file_sys/vfs_layered.cpp
+++ b/src/core/file_sys/vfs_layered.cpp
@@ -8,7 +8,13 @@
namespace FileSys {
-VirtualDir LayerDirectories(std::vector<VirtualDir> dirs, std::string name) {
+LayeredVfsDirectory::LayeredVfsDirectory(std::vector<VirtualDir> dirs, std::string name)
+ : dirs(std::move(dirs)), name(std::move(name)) {}
+
+LayeredVfsDirectory::~LayeredVfsDirectory() = default;
+
+VirtualDir LayeredVfsDirectory::MakeLayeredDirectory(std::vector<VirtualDir> dirs,
+ std::string name) {
if (dirs.empty())
return nullptr;
if (dirs.size() == 1)
@@ -17,11 +23,6 @@ VirtualDir LayerDirectories(std::vector<VirtualDir> dirs, std::string name) {
return std::shared_ptr<VfsDirectory>(new LayeredVfsDirectory(std::move(dirs), std::move(name)));
}
-LayeredVfsDirectory::LayeredVfsDirectory(std::vector<VirtualDir> dirs, std::string name)
- : dirs(std::move(dirs)), name(std::move(name)) {}
-
-LayeredVfsDirectory::~LayeredVfsDirectory() = default;
-
std::shared_ptr<VfsFile> LayeredVfsDirectory::GetFileRelative(std::string_view path) const {
for (const auto& layer : dirs) {
const auto file = layer->GetFileRelative(path);
@@ -41,7 +42,7 @@ std::shared_ptr<VfsDirectory> LayeredVfsDirectory::GetDirectoryRelative(
out.push_back(std::move(dir));
}
- return LayerDirectories(std::move(out));
+ return MakeLayeredDirectory(std::move(out));
}
std::shared_ptr<VfsFile> LayeredVfsDirectory::GetFile(std::string_view name) const {