File: files.h

package info (click to toggle)
android-platform-build 1%3A8.1.0%2Br23-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,620 kB
  • sloc: python: 12,074; cpp: 6,068; cs: 5,512; makefile: 2,356; sh: 1,829; java: 1,359; ansic: 987
file content (50 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef FILES_H
#define FILES_H

#include <map>
#include <string>
#include <vector>
#include <sys/types.h>

using namespace std;

enum FileOpType {
    FILE_OP_COPY = 0,
    FILE_OP_REMOVE,
    FILE_OP_STRIP
};

struct FileRecord
{
    FileRecord();

    string listFile;
    int listLine;

    string sourceBase;
    string sourceName;
    string sourcePath;
    bool sourceIsDir;
    time_t sourceMod;
    off_t  sourceSize;
    FileOpType fileOp;

    string outName;
    string outPath;
    off_t  outSize;
    time_t outMod;
    bool outIsDir;
    unsigned int mode;
};

int read_list_file(const string& filename,
                   const map<string, string>& variables,
                   vector<FileRecord>* files,
                   vector<string>* excludes);
int locate(FileRecord* rec, const vector<string>& search);
void stat_out(const string& base, FileRecord* rec);
string dir_part(const string& filename);
int list_dir(const FileRecord& rec, const vector<string>& excludes,
                    vector<FileRecord>* files);

#endif // FILES_H