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 <QString>
25#include <QFile>
26
27#include <marble_export.h>
28
29namespace Marble {
30
31class MarbleZipWriterPrivate;
32
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();
78private:
79 MarbleZipWriterPrivate *d;
80 Q_DISABLE_COPY(MarbleZipWriter)
81};
82
83}
84
85#endif // QT_NO_TEXTODFWRITER
86#endif // MARBLEZIPWRITER_H
Q_SCRIPTABLE CaptureState status()
KGuiItem 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 Fri Jun 14 2024 11:54:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.