Qt 4.8
qzipreader_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QZIPREADER_H
43 #define QZIPREADER_H
44 
45 #ifndef QT_NO_TEXTODFWRITER
46 
47 //
48 // W A R N I N G
49 // -------------
50 //
51 // This file is not part of the Qt API. It exists for the convenience
52 // of the QZipReader class. This header file may change from
53 // version to version without notice, or even be removed.
54 //
55 // We mean it.
56 //
57 
58 #include <QtCore/qdatetime.h>
59 #include <QtCore/qfile.h>
60 #include <QtCore/qstring.h>
61 
63 
64 class QZipReaderPrivate;
65 
67 {
68 public:
69  QZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly );
70 
71  explicit QZipReader(QIODevice *device);
72  ~QZipReader();
73 
74  QIODevice* device() const;
75 
76  bool isReadable() const;
77  bool exists() const;
78 
80  {
81  FileInfo();
82  FileInfo(const FileInfo &other);
83  ~FileInfo();
84  FileInfo &operator=(const FileInfo &other);
85  bool isValid() const;
87  uint isDir : 1;
88  uint isFile : 1;
90  QFile::Permissions permissions;
94  void *d;
95  };
96 
97  QList<FileInfo> fileInfoList() const;
98  int count() const;
99 
100  FileInfo entryInfoAt(int index) const;
101  QByteArray fileData(const QString &fileName) const;
102  bool extractAll(const QString &destinationDir) const;
103 
104  enum Status {
109  FileError
110  };
111 
112  Status status() const;
113 
114  void close();
115 
116 private:
119 };
120 
122 
123 #endif // QT_NO_TEXTODFWRITER
124 #endif // QZIPREADER_H
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
Status
The following status values are possible:
Definition: qzipreader_p.h:104
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
uint isFile
A boolean type, if it is one this entry is a file.
Definition: qzipreader_p.h:88
QDateTime lastModified
Definition: qzipreader_p.h:93
QString filePath
The full filepath inside the archive.
Definition: qzipreader_p.h:86
The QString class provides a Unicode character string.
Definition: qstring.h:83
Represents one entry in the zip table of contents.
Definition: qzipreader_p.h:79
the QZipReader class provides a way to inspect the contents of a zip archive and extract individual f...
Definition: qzipreader_p.h:66
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QFile::Permissions permissions
Definition: qzipreader_p.h:90
qint64 size
The total size of the unpacked content.
Definition: qzipreader_p.h:92
unsigned int uint
Definition: qglobal.h:996
uint isSymLink
A boolean type, if it is one this entry is symbolic link.
Definition: qzipreader_p.h:89
__int64 qint64
Definition: qglobal.h:942
uint crc32
The calculated checksum as a crc32 type.
Definition: qzipreader_p.h:91
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
quint16 index
QZipReaderPrivate * d
Definition: qzipreader_p.h:117
uint isDir
A boolean type indicating if the entry is a directory.
Definition: qzipreader_p.h:87
The QIODevice class is the base interface class of all I/O devices in Qt.
Definition: qiodevice.h:66
static QString fileName(const QString &fileUrl)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62