From 9c754053b07a724bdd98d039f34899d6a49115b7 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Wed, 9 Jan 2013 09:09:08 -0500 Subject: Add libtar to TWRP instead of using busybox tar Add proper mkdosfs tool Add fuse to TWRP Add experimental exfat-fuse to TWRP Convert all system() functions to use new Exec_Cmd function --- twrpTar.hpp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 twrpTar.hpp (limited to 'twrpTar.hpp') diff --git a/twrpTar.hpp b/twrpTar.hpp new file mode 100644 index 000000000..554a01dbd --- /dev/null +++ b/twrpTar.hpp @@ -0,0 +1,61 @@ +/* + Copyright 2012 bigbiff/Dees_Troy TeamWin + This file is part of TWRP/TeamWin Recovery Project. + + TWRP is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + TWRP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TWRP. If not, see . +*/ + +extern "C" { + #include "libtar/libtar.h" +} +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +class twrpTar { + public: + int create(string dir, string fn); + int createTGZ(string dir, string fn); + int extract(string rootDir, string fn); + int compress(string fn); + int extractTGZ(string rootdir, string fn); + int uncompress(string fn); + int addFilesToExistingTar(vector files, string tarFile); + int createTar(string dir, string fn); + int openTar(string rootdir, string fn, bool gzip); + int addFile(string fn, bool include_root); + int closeTar(string fn, bool gzip); + int Split_Archive(string Path, string fn); + private: + int removeEOT(string tarFile); + int extractTar(string rootdir, string fn); + int tarDirs(string dir, string fn, bool include_root); + int Generate_Multiple_Archives(string Path, string fn); + + private: + int has_data_media; + int Archive_File_Count; + unsigned long long Archive_Current_Size; + string Strip_Root_Dir(string Path); + TAR *t; + FILE* p; + int fd; +}; -- cgit v1.2.3