diff options
Diffstat (limited to 'Source/Core/DiscIO/Filesystem.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Filesystem.cpp | 15 |
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 |
