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{
32
33class MarbleZipReaderPrivate;
34
35class MARBLE_EXPORT MarbleZipReader
36{
37public:
38 MarbleZipReader(const QString &fileName, QIODevice::OpenMode mode = QIODevice::ReadOnly);
39
40 explicit MarbleZipReader(QIODevice *device);
41 ~MarbleZipReader();
42
43 QIODevice *device() const;
44
45 bool isReadable() const;
46 bool exists() const;
47
48 struct MARBLE_EXPORT FileInfo {
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.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.