Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.
Moved Get_Folder_Size to this new class.
Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 7634ff0..da11e8d 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -36,6 +36,7 @@
#include "twrp-functions.hpp"
#include "fixPermissions.hpp"
#include "twrpDigest.hpp"
+#include "twrpDU.hpp"
#ifdef TW_INCLUDE_CRYPTO
#ifdef TW_INCLUDE_JB_CRYPTO
@@ -46,6 +47,9 @@
#include "cutils/properties.h"
#endif
+TWPartitionManager::TWPartitionManager(void) {
+}
+
int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error) {
FILE *fstabFile;
char fstab_line[MAX_FSTAB_LINE_LENGTH];
@@ -772,7 +776,7 @@
time(&total_stop);
int total_time = (int) difftime(total_stop, total_start);
- unsigned long long actual_backup_size = TWFunc::Get_Folder_Size(Full_Backup_Path, true);
+ uint64_t actual_backup_size = du.Get_Folder_Size(Full_Backup_Path);
actual_backup_size /= (1024LLU * 1024LLU);
int prev_img_bps, use_compression;