From 1b7a31bd65d4e6bf5e337d6280e3d5319d460bef Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 3 Jul 2014 15:09:22 -0500 Subject: Track backup and restore progress Track backup and restore progress based on the sizes of the files as they are being added to the tar backup file. Update the progress bar based on the sizes of the files. Change-Id: Idf649efa1db3e91830b4b2add86203a3f30042ff --- twrpTar.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'twrpTar.hpp') diff --git a/twrpTar.hpp b/twrpTar.hpp index 443e5f4b3..799475234 100644 --- a/twrpTar.hpp +++ b/twrpTar.hpp @@ -45,12 +45,13 @@ class twrpTar { public: twrpTar(); virtual ~twrpTar(); - int createTarFork(); - int extractTarFork(); + int createTarFork(const unsigned long long *overall_size, const unsigned long long *other_backups_size); + int extractTarFork(const unsigned long long *overall_size, unsigned long long *other_backups_size); void setfn(string fn); void setdir(string dir); void setsize(unsigned long long backup_size); void setpassword(string pass); + unsigned long long get_size(); public: int use_encryption; @@ -59,6 +60,9 @@ public: int split_archives; int has_data_media; string backup_name; + int progress_pipe_fd; + string partition_name; + string backup_folder; private: int extract(); @@ -75,6 +79,7 @@ private: static void* createList(void *cookie); static void* extractMulti(void *cookie); int tarList(std::vector *TarList, unsigned thread_id); + unsigned long long uncompressedSize(string filename, int *archive_type); int Archive_Current_Type; unsigned long long Archive_Current_Size; @@ -84,6 +89,7 @@ private: int fd; pid_t pigz_pid; pid_t oaes_pid; + unsigned long long file_count; string tardir; string tarfn; -- cgit v1.2.3