-
Notifications
You must be signed in to change notification settings - Fork 4
/
zipreader.h
88 lines (69 loc) · 1.54 KB
/
zipreader.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef ZipReader_H
#define ZipReader_H
#ifndef QT_NO_TEXTODFWRITER
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of the ZipReader class. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#ifndef Q_GUI_EXPORT
#define Q_GUI_EXPORT ""
#endif
#include <QtCore/qdatetime.h>
#include <QtCore/qfile.h>
#include <QtCore/qstring.h>
QT_BEGIN_NAMESPACE
class ZipReaderPrivate;
class ZipReader
{
public:
ZipReader(const QString& fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly);
explicit ZipReader(QIODevice* device);
~ZipReader();
QIODevice* device() const;
bool isReadable() const;
bool exists() const;
struct FileInfo
{
FileInfo();
FileInfo(const FileInfo& other);
~FileInfo();
FileInfo& operator=(const FileInfo& other);
bool isValid() const;
QString filePath;
uint isDir : 1;
uint isFile : 1;
uint isSymLink : 1;
QFile::Permissions permissions;
uint crc32;
qint64 size;
QDateTime lastModified;
void* d;
};
QList<FileInfo> fileInfoList() const;
int count() const;
FileInfo entryInfoAt(int index) const;
QByteArray fileData(const QString& fileName) const;
bool extractAll(const QString& destinationDir) const;
enum Status
{
NoError,
FileReadError,
FileOpenError,
FilePermissionsError,
FileError
};
Status status() const;
void close();
private:
ZipReaderPrivate* d;
Q_DISABLE_COPY(ZipReader)
};
QT_END_NAMESPACE
#endif // QT_NO_TEXTODFWRITER
#endif // ZipReader_H