diff options
author | Lioncash <mathew1800@gmail.com> | 2020-12-10 07:31:58 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-12-10 07:44:43 +0100 |
commit | b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a (patch) | |
tree | 6de62e6d506fb1867794956b52d3c2abde6054bd /src/core/file_sys/vfs_concat.cpp | |
parent | Merge pull request #5179 from ReinUsesLisp/fs-path (diff) | |
download | yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.gz yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.bz2 yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.lz yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.xz yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.tar.zst yuzu-b1657b8c6b4ef07dd6eea92f4559a32ca3e0894a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/vfs_concat.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/file_sys/vfs_concat.cpp b/src/core/file_sys/vfs_concat.cpp index e0ff70174..3c5a7d87a 100644 --- a/src/core/file_sys/vfs_concat.cpp +++ b/src/core/file_sys/vfs_concat.cpp @@ -46,7 +46,7 @@ VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(std::vector<VirtualFile> f if (files.size() == 1) return files[0]; - return std::shared_ptr<VfsFile>(new ConcatenatedVfsFile(std::move(files), std::move(name))); + return VirtualFile(new ConcatenatedVfsFile(std::move(files), std::move(name))); } VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(u8 filler_byte, @@ -71,20 +71,23 @@ VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(u8 filler_byte, if (files.begin()->first != 0) files.emplace(0, std::make_shared<StaticVfsFile>(filler_byte, files.begin()->first)); - return std::shared_ptr<VfsFile>(new ConcatenatedVfsFile(std::move(files), std::move(name))); + return VirtualFile(new ConcatenatedVfsFile(std::move(files), std::move(name))); } std::string ConcatenatedVfsFile::GetName() const { - if (files.empty()) + if (files.empty()) { return ""; - if (!name.empty()) + } + if (!name.empty()) { return name; + } return files.begin()->second->GetName(); } std::size_t ConcatenatedVfsFile::GetSize() const { - if (files.empty()) + if (files.empty()) { return 0; + } return files.rbegin()->first + files.rbegin()->second->GetSize(); } @@ -92,9 +95,10 @@ bool ConcatenatedVfsFile::Resize(std::size_t new_size) { return false; } -std::shared_ptr<VfsDirectory> ConcatenatedVfsFile::GetContainingDirectory() const { - if (files.empty()) +VirtualDir ConcatenatedVfsFile::GetContainingDirectory() const { + if (files.empty()) { return nullptr; + } return files.begin()->second->GetContainingDirectory(); } |