Warning, file /office/calligra/libs/store/KoZipStore.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002    Copyright (C) 2002 David Faure <faure@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef koZipStore_h
0021 #define koZipStore_h
0022 
0023 #include "KoStore.h"
0024 
0025 class KZip;
0026 class KArchiveDirectory;
0027 class QUrl;
0028 
0029 class KoZipStore : public KoStore
0030 {
0031 public:
0032     KoZipStore(const QString & _filename, Mode _mode, const QByteArray & appIdentification,
0033                bool writeMimetype = true);
0034     KoZipStore(QIODevice *dev, Mode mode, const QByteArray & appIdentification,
0035                bool writeMimetype = true);
0036     /**
0037      * QUrl-constructor
0038      * @todo saving not completely implemented (fixed temporary file)
0039      */
0040     KoZipStore(QWidget* window, const QUrl &_url, const QString & _filename, Mode _mode,
0041                const QByteArray & appIdentification, bool writeMimetype = true);
0042     ~KoZipStore() override;
0043 
0044     void setCompressionEnabled(bool e) override;
0045     qint64 write(const char* _data, qint64 _len) override;
0046 
0047     QStringList directoryList() const override;
0048 
0049 protected:
0050     void init(const QByteArray& appIdentification);
0051     bool doFinalize() override;
0052     bool openWrite(const QString& name) override;
0053     bool openRead(const QString& name) override;
0054     bool closeWrite() override;
0055     bool closeRead() override {
0056         return true;
0057     }
0058     bool enterRelativeDirectory(const QString& dirName) override;
0059     bool enterAbsoluteDirectory(const QString& path) override;
0060     bool fileExists(const QString& absPath) const override;
0061 
0062 private:
0063 
0064     /// The archive
0065     KZip * m_pZip;
0066 
0067     /** In "Read" mode this pointer is pointing to the
0068     current directory in the archive to speed up the verification process */
0069     const KArchiveDirectory* m_currentDir;
0070 
0071     Q_DECLARE_PRIVATE(KoStore)
0072 };
0073 
0074 #endif