Marble

MarbleZipReader.h
1// SPDX-License-Identifier: LGPL-2.1-only WITH Qt-LGPL-exception-1.1 OR LGPL-3.0-only WITH Qt-LGPL-exception-1.1 OR GPL-3.0-only OR LicenseRef-Qt-Commercial
2//
3// SPDX-FileCopyrightText: 2015 The Qt Company Ltd. <https://www.qt.io/licensing/>
4// This file is based on qzipreader_p.h from Qt with the original license
5// below, taken from
6// https://code.qt.io/cgit/qt/qt.git/plain/src/gui/text/qzipreader_p.h
7
8#ifndef MARBLEZIPREADER_H
9#define MARBLEZIPREADER_H
10
11#ifndef QT_NO_TEXTODFWRITER
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists for the convenience
18// of the QZipReader class. This header file may change from
19// version to version without notice, or even be removed.
20//
21// We mean it.
22//
23
24#include <QDateTime>
25#include <QFile>
26#include <QString>
27
28#include <marble_export.h>
29
30namespace Marble {
31
32class MarbleZipReaderPrivate;
33
34class MARBLE_EXPORT MarbleZipReader
35{
36public:
37 MarbleZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly );
38
39 explicit MarbleZipReader(QIODevice *device);
40 ~MarbleZipReader();
41
42 QIODevice* device() const;
43
44 bool isReadable() const;
45 bool exists() const;
46
47 struct MARBLE_EXPORT FileInfo
48 {
49 FileInfo();
50 FileInfo(const FileInfo &other);
51 ~FileInfo();
52 FileInfo &operator=(const FileInfo &other);
53 bool isValid() const;
54 QString filePath;
55 uint isDir : 1;
56 uint isFile : 1;
57 uint isSymLink : 1;
58 QFile::Permissions permissions;
59 uint crc32;
60 qint64 size;
61 QDateTime lastModified;
62 void *d;
63 };
64
65 QList<FileInfo> fileInfoList() const;
66 int count() const;
67
68 FileInfo entryInfoAt(int index) const;
69 QByteArray fileData(const QString &fileName) const;
70 bool extractAll(const QString &destinationDir) const;
71
72 enum Status {
73 NoError,
74 FileReadError,
75 FileOpenError,
76 FilePermissionsError,
77 FileError
78 };
79
80 Status status() const;
81
82 void close();
83
84private:
85 MarbleZipReaderPrivate *d;
86 Q_DISABLE_COPY(MarbleZipReader)
87};
88
89}
90
91#endif // QT_NO_TEXTODFWRITER
92#endif // MARBLEZIPREADER_H
Q_SCRIPTABLE CaptureState status()
bool isValid(QStringView ifopt)
const QList< QKeySequence > & close()
Binds a QML item to a specific geodetic location in screen coordinates.
typedef Permissions
typedef OpenMode
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.