File indexing completed on 2024-05-12 15:59:59

0001 /*
0002  * SPDX-FileCopyrightText: 2019 Boudewijn Rempt <boud@valdyas.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef KoQuaZipStore_h
0008 #define KoQuaZipStore_h
0009 
0010 #include "KoStore.h"
0011 #include <QScopedPointer>
0012 
0013 class QUrl;
0014 
0015 class KoQuaZipStore : public KoStore
0016 {
0017 public:
0018     KoQuaZipStore(const QString & _filename, Mode _mode, const QByteArray & appIdentification,
0019                   bool writeMimetype = true);
0020 
0021     KoQuaZipStore(QIODevice *dev, Mode mode, const QByteArray & appIdentification,
0022                   bool writeMimetype = true);
0023 
0024     ~KoQuaZipStore() override;
0025 
0026     void setCompressionEnabled(bool enabled) override;
0027     qint64 write(const char* _data, qint64 _len) override;
0028 
0029     QStringList directoryList() const override;
0030 
0031 protected:
0032     void init(const QByteArray& appIdentification);
0033     bool doFinalize() override;
0034     bool openWrite(const QString& name) override;
0035     bool openRead(const QString& name) override;
0036     bool closeWrite() override;
0037     bool closeRead() override;
0038     bool enterRelativeDirectory(const QString& dirName) override;
0039     bool enterAbsoluteDirectory(const QString& path) override;
0040     bool fileExists(const QString& absPath) const override;
0041 
0042 private:
0043     struct Private;
0044     const QScopedPointer<Private> dd;
0045     Q_DECLARE_PRIVATE(KoStore)
0046 
0047 };
0048 
0049 #endif