bigbiff bigbiff | 34684ff | 2013-12-01 21:03:45 -0500 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2013 TeamWin |
| 3 | This file is part of TWRP/TeamWin Recovery Project. |
| 4 | |
| 5 | TWRP is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation, either version 3 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | TWRP is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with TWRP. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef TWRPDU_HPP |
| 20 | #define TWRPDU_HPP |
| 21 | |
| 22 | #include <sys/types.h> |
| 23 | #include <sys/stat.h> |
| 24 | #include <dirent.h> |
| 25 | #include <fcntl.h> |
| 26 | #include <string.h> |
| 27 | #include <errno.h> |
| 28 | #include <fcntl.h> |
| 29 | #include <fstream> |
| 30 | #include <string> |
| 31 | #include <vector> |
| 32 | #include "twcommon.h" |
| 33 | |
| 34 | using namespace std; |
| 35 | |
| 36 | class twrpDU { |
| 37 | |
| 38 | public: |
| 39 | twrpDU(); |
| 40 | uint64_t Get_Folder_Size(const string& Path); // Gets the folder's size using stat |
| 41 | void add_absolute_dir(string Path); |
| 42 | void add_relative_dir(string Path); |
bigbiff bigbiff | c7360dd | 2014-01-25 15:02:57 -0500 | [diff] [blame] | 43 | bool check_skip_dirs(string& dir); |
bigbiff bigbiff | 34684ff | 2013-12-01 21:03:45 -0500 | [diff] [blame] | 44 | vector<string> get_absolute_dirs(void); |
bigbiff bigbiff | c7360dd | 2014-01-25 15:02:57 -0500 | [diff] [blame] | 45 | void clear_relative_dir(string dir); |
bigbiff bigbiff | 34684ff | 2013-12-01 21:03:45 -0500 | [diff] [blame] | 46 | private: |
| 47 | vector<string> absolutedir; |
| 48 | vector<string> relativedir; |
| 49 | string parent; |
| 50 | }; |
| 51 | |
| 52 | extern twrpDU du; |
| 53 | #endif |