blob: 6480c988cf3f9a1d75b4947cba1f3a723d1d2ba1 [file] [log] [blame]
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -07001#ifndef FILES_H
2#define FILES_H
3
The Android Open Source Projectdcc08f02008-12-17 18:03:49 -08004#include <map>
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -07005#include <string>
6#include <vector>
7#include <sys/types.h>
8
9using namespace std;
10
11struct 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
The Android Open Source Projectdcc08f02008-12-17 18:03:49 -080029int read_list_file(const string& filename,
30 const map<string, string>& variables,
31 vector<FileRecord>* files,
32 vector<string>* excludes);
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -070033int locate(FileRecord* rec, const vector<string>& search);
34void stat_out(const string& base, FileRecord* rec);
35string dir_part(const string& filename);
36int list_dir(const FileRecord& rec, const vector<string>& excludes,
37 vector<FileRecord>* files);
38
39#endif // FILES_H