summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/sdmc_factory.cpp9
-rw-r--r--src/core/file_sys/sdmc_factory.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp
index a5f1dcc5c..743e2e63a 100644
--- a/src/core/file_sys/sdmc_factory.cpp
+++ b/src/core/file_sys/sdmc_factory.cpp
@@ -6,6 +6,7 @@
#include "core/file_sys/registered_cache.h"
#include "core/file_sys/sdmc_factory.h"
#include "core/file_sys/xts_archive.h"
+#include "core/settings.h"
namespace FileSys {
@@ -40,4 +41,12 @@ VirtualDir SDMCFactory::GetImageDirectory() const {
return GetOrCreateDirectoryRelative(dir, "/Nintendo/Album");
}
+u64 SDMCFactory::GetSDMCFreeSpace() const {
+ return GetSDMCTotalSpace() - dir->GetSize();
+}
+
+u64 SDMCFactory::GetSDMCTotalSpace() const {
+ return static_cast<u64>(Settings::values.sdmc_size);
+}
+
} // namespace FileSys
diff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.h
index abe6cc41c..164fd9435 100644
--- a/src/core/file_sys/sdmc_factory.h
+++ b/src/core/file_sys/sdmc_factory.h
@@ -28,6 +28,9 @@ public:
VirtualDir GetImageDirectory() const;
+ u64 GetSDMCFreeSpace() const;
+ u64 GetSDMCTotalSpace() const;
+
private:
VirtualDir dir;