The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | #ifndef FILES_H |
| 2 | #define FILES_H |
| 3 | |
| 4 | #include <map> |
| 5 | #include <string> |
| 6 | #include <vector> |
| 7 | #include <sys/types.h> |
| 8 | |
| 9 | using namespace std; |
| 10 | |
| 11 | struct FileRecord |
| 12 | { |
| 13 | string listFile; |
| 14 | int listLine; |
| 15 | |
| 16 | string sourceBase; |
| 17 | string sourceName; |
| 18 | string sourcePath; |
| 19 | bool sourceIsDir; |
| 20 | time_t sourceMod; |
| 21 | |
| 22 | string outName; |
| 23 | string outPath; |
| 24 | time_t outMod; |
| 25 | bool outIsDir; |
| 26 | unsigned int mode; |
| 27 | }; |
| 28 | |
| 29 | int read_list_file(const string& filename, |
| 30 | const map<string, string>& variables, |
| 31 | vector<FileRecord>* files, |
| 32 | vector<string>* excludes); |
| 33 | int locate(FileRecord* rec, const vector<string>& search); |
| 34 | void stat_out(const string& base, FileRecord* rec); |
| 35 | string dir_part(const string& filename); |
| 36 | int list_dir(const FileRecord& rec, const vector<string>& excludes, |
| 37 | vector<FileRecord>* files); |
| 38 | |
| 39 | #endif // FILES_H |