diff options
Diffstat (limited to 'src/core/file_sys/vfs_layered.cpp')
-rw-r--r-- | src/core/file_sys/vfs_layered.cpp | 15 |
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 { |