Marble

MarbleZipWriter.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//
5// This file is based on qzipwriter_p.h from Qt with the original license
6// below, taken from
7// https://code.qt.io/cgit/qt/qt.git/plain/src/gui/text/qzipwriter_p.h
8
9#ifndef MARBLEZIPWRITER_H
10#define MARBLEZIPWRITER_H
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 QZipWriter 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 <QFile>
25#include <QString>
26
27#include <marble_export.h>
28
29namespace Marble
30{
31
32class MarbleZipWriterPrivate;
33
34class MARBLE_EXPORT MarbleZipWriter
35{
36public:
37 MarbleZipWriter(const QString &fileName, QIODevice::OpenMode mode = (QIODevice::WriteOnly | QIODevice::Truncate));
38
39 explicit MarbleZipWriter(QIODevice *device);
40 ~MarbleZipWriter();
41
42 QIODevice *device() const;
43
44 bool isWritable() const;
45 bool exists() const;
46
47 enum Status {
48 NoError,
49 FileWriteError,
50 FileOpenError,
51 FilePermissionsError,
52 FileError
53 };
54
55 Status status() const;
56
57 enum CompressionPolicy {
58 AlwaysCompress,
59 NeverCompress,
60 AutoCompress
61 };
62
63 void setCompressionPolicy(CompressionPolicy policy);
64 CompressionPolicy compressionPolicy() const;
65
66 void setCreationPermissions(QFile::Permissions permissions);
67 QFile::Permissions creationPermissions() const;
68
69 void addFile(const QString &fileName, const QByteArray &data);
70
71 void addFile(const QString &fileName, QIODevice *device);
72
73 void addDirectory(const QString &dirName);
74
75 void addSymLink(const QString &fileName, const QString &destination);
76
77 void close();
78
79private:
80 MarbleZipWriterPrivate *d;
81 Q_DISABLE_COPY(MarbleZipWriter)
82};
83
84}
85
86#endif // QT_NO_TEXTODFWRITER
87#endif // MARBLEZIPWRITER_H
Q_SCRIPTABLE CaptureState status()
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.