summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Filesystem.cpp
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2018-06-02 21:45:02 +0200
committerGitHub <noreply@github.com>2018-06-02 21:45:02 +0200
commitba471c3214a63fcc7b4748632a68f6512714a4a0 (patch)
treeb348c3c898577100ec9a66bed7a9c50f05132c19 /Source/Core/DiscIO/Filesystem.cpp
parent396810c450e739e3d1c0b0f03c416d67e98db5fb (diff)
parentf6865117e47fb48c58ab53af1297a79b850a345a (diff)
Merge pull request #7048 from spycrab/qt_fs_size
Qt/FilesystemWidget: Add size column
Diffstat (limited to 'Source/Core/DiscIO/Filesystem.cpp')
-rw-r--r--Source/Core/DiscIO/Filesystem.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/Filesystem.cpp b/Source/Core/DiscIO/Filesystem.cpp
index 9e5336db5d..68a7decb3e 100644
--- a/Source/Core/DiscIO/Filesystem.cpp
+++ b/Source/Core/DiscIO/Filesystem.cpp
@@ -8,6 +8,19 @@ namespace DiscIO
{
FileInfo::~FileInfo() = default;
+u64 FileInfo::GetTotalSize() const
+{
+ if (!IsDirectory())
+ return GetSize();
+
+ u64 size = 0;
+
+ for (const auto& entry : *this)
+ size += entry.GetTotalSize();
+
+ return size;
+}
+
FileSystem::~FileSystem() = default;
-} // namespace
+} // namespace DiscIO