From e0a433a94dd82d7754757efcc50f294de50bf185 Mon Sep 17 00:00:00 2001 From: Dees Troy Date: Mon, 2 Dec 2013 04:10:37 +0000 Subject: Refactor twrpTar to use TarList Eliminate the use of tarDirs and Generate_MultipleArcives in favor of Generate_TarList so that we have one method for backup creation instead of three. Change-Id: I267937b6e40b32d43fbac8b4cca82f7468d4f94c --- twrpTar.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'twrpTar.hpp') diff --git a/twrpTar.hpp b/twrpTar.hpp index fa3d2ced6..17f69594d 100644 --- a/twrpTar.hpp +++ b/twrpTar.hpp @@ -47,10 +47,10 @@ public: virtual ~twrpTar(); int createTarFork(); int extractTarFork(); - int splitArchiveFork(); void setexcl(string exclude); void setfn(string fn); void setdir(string dir); + void setsize(unsigned long long backup_size); unsigned long long uncompressedSize(); public: @@ -68,22 +68,19 @@ private: int addFile(string fn, bool include_root); int entryExists(string entry); int closeTar(); - int create(); - int Split_Archive(); int removeEOT(string tarFile); int extractTar(); - int tarDirs(bool include_root); - int Generate_Multiple_Archives(string Path); string Strip_Root_Dir(string Path); int openTar(); int Generate_TarList(string Path, std::vector *TarList, unsigned long long *Target_Size, unsigned *thread_id); static void* createList(void *cookie); static void* extractMulti(void *cookie); - int tarList(bool include_root, std::vector *TarList, unsigned thread_id); + int tarList(std::vector *TarList, unsigned thread_id); - int Archive_File_Count; int Archive_Current_Type; unsigned long long Archive_Current_Size; + unsigned long long Total_Backup_Size; + bool include_root_dir; TAR *t; int fd; pid_t pigz_pid; @@ -94,7 +91,6 @@ private: string basefn; vector tarexclude; - vector split; std::vector *ItemList; int thread_id; -- cgit v1.2.3