summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/vfs_concat.cpp
diff options
context:
space:
mode:
authorLevi <L3ehunin@gmail.com>2021-01-11 06:09:56 +0100
committerLevi <L3ehunin@gmail.com>2021-01-11 06:09:56 +0100
commit7a3c884e39fccfbb498b855080bffabc9ce2e7f1 (patch)
tree5056f9406dec188439cb0deb87603498243a9412 /src/core/file_sys/vfs_concat.cpp
parentMore forgetting... duh (diff)
parentMerge pull request #5229 from Morph1984/fullscreen-opt (diff)
downloadyuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar
yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.gz
yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.bz2
yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.lz
yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.xz
yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.zst
yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.zip
Diffstat (limited to 'src/core/file_sys/vfs_concat.cpp')
-rw-r--r--src/core/file_sys/vfs_concat.cpp18
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();
}