-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflist.h
More file actions
52 lines (45 loc) · 948 Bytes
/
Copy pathflist.h
File metadata and controls
52 lines (45 loc) · 948 Bytes
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
51
52
/*
* qftp
* Copyright (C) 1997,1998 Peter Strand
* Distributed under the GNU Pulic Licence
*/
#ifndef _FLIST_H_
#define _FLIST_H_
#include <vector>
class Entry
{
public:
Entry();
char *wd, *name, *date, *user, *group, *perms;
int type, perm;
long size;
};
class DirList {
std::vector<Entry> ents;
std::vector<Entry>::iterator iter;
struct { bool operator()(const Entry &a, const Entry &b) const {
return strcmp(a.name, b.name) < 0;
}
} cmpn;
struct { bool operator()(const Entry &a, const Entry &b) const {
return strcmp(a.date, b.date) < 0;
}
} cmpd;
struct { bool operator()(const Entry &a, const Entry &b) const {
return a.size < b.size;
}
} cmps;
public:
char *path;
int isused, islong;
DirList();
void Flush();
void Reset();
int GetWidest();
void Sort(int what, int dir);
void Add(Entry &ent);
void AddAt(Entry &e, int i);
int GetNext(Entry &ent);
int GetAt(Entry &ent, int i);
};
#endif