-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqzdir.h
70 lines (55 loc) · 1.24 KB
/
qzdir.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Directory list emulation for specified.
* vim:sw=2
*/
#ifndef __QZ_DIR_H__
#define __QZ_DIR_H__
#include <qstring.h>
#include <qstringlist.h>
class ZDirEntry;
class ZFileEntry;
class QDir;
/* QZDir filter simbole.
all symboles must be ored. */
enum {
QZFL_NONE=0, QZFL_FILE=1, QZFL_DIR=2, QZFL_DOTS=4,
QZFL_ALL = QZFL_DIR|QZFL_FILE|QZFL_DOTS
};
enum {
QZFS_NAME,
QZFS_EXT,
QZFS_SIZE,
QZFS_DIR,
QZFS_REVERSE = 0x10
};
class QZDir {
private:
QString m_path;
int m_type;
union {
ZDirEntry *z;
QDir *q;
} m_dir;
protected:
virtual void closeZ();
virtual int updateZ();
public:
QZDir();
QZDir(QString path);
void setPath(QString path);
QStringList getList(QString mask, int filter, int sort_policy);
bool cd(QString str);
bool cdUp();
QString path();
QString absPath();
/* get information about directory entry */
int getType(QString sub);
bool isFile(QString sub);
bool isDir(QString sub);
bool isFile();
bool isDir();
bool exist();
static QString getDir(const QString &path, QString *filename = NULL);
static QString getBasename(const QString &path);
};
#endif /* __QZ_DIR_H__ */