• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • io
kzip.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2002 Holger Schroeder <holger-kde@holgis.net>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18#ifndef KZIP_H
19#define KZIP_H
20
21#include <karchive.h>
22
23class KZipFileEntry;
45class KDECORE_EXPORT KZip : public KArchive
46{
47public:
54 KZip( const QString& filename );
55
63 KZip( QIODevice * dev );
64
69 virtual ~KZip();
70
74 enum ExtraField { NoExtraField = 0,
75 ModificationTime = 1,
76 DefaultExtraField = 1
77 };
78
85 void setExtraField( ExtraField ef );
86
92 ExtraField extraField() const;
93
97 enum Compression { NoCompression = 0,
98 DeflateCompression = 1
99 };
100
101
108 void setCompression( Compression c );
109
115 Compression compression() const;
116
123 virtual bool writeData( const char* data, qint64 size );
124
125protected:
127 virtual bool doWriteSymLink(const QString &name, const QString &target,
128 const QString &user, const QString &group,
129 mode_t perm, time_t atime, time_t mtime, time_t ctime);
131 virtual bool doPrepareWriting( const QString& name, const QString& user,
132 const QString& group, qint64 size, mode_t perm,
133 time_t atime, time_t mtime, time_t ctime );
134
140 virtual bool doFinishWriting( qint64 size );
141
148 virtual bool openArchive( QIODevice::OpenMode mode );
149
151 virtual bool closeArchive();
152
154 virtual bool doWriteDir( const QString& name, const QString& user,
155 const QString& group, mode_t perm, time_t atime,
156 time_t mtime, time_t ctime );
157
158protected:
159 virtual void virtual_hook( int id, void* data );
160
161private:
162 class KZipPrivate;
163 KZipPrivate * const d;
164};
165
166
170class KDECORE_EXPORT KZipFileEntry : public KArchiveFile
171{
172public:
176 KZipFileEntry( KZip* zip, const QString& name, int access, int date,
177 const QString& user, const QString& group, const QString& symlink,
178 const QString& path, qint64 start, qint64 uncompressedSize,
179 int encoding, qint64 compressedSize);
180
184 ~KZipFileEntry();
185
186 int encoding() const;
187 qint64 compressedSize() const;
188
190 void setCompressedSize(qint64 compressedSize);
191
193 void setHeaderStart(qint64 headerstart);
194 qint64 headerStart() const;
195
197 unsigned long crc32() const;
198 void setCRC32(unsigned long crc32);
199
201 const QString &path() const;
202
207 virtual QByteArray data() const;
208
216 virtual QIODevice* createDevice() const;
217
218private:
219 class KZipFileEntryPrivate;
220 KZipFileEntryPrivate * const d;
221};
222
223#endif
KArchiveFile
Represents a file entry in a KArchive.
Definition: karchive.h:458
KArchive
KArchive is a base class for reading and writing archives.
Definition: karchive.h:44
KZipFileEntry
A KZipFileEntry represents an file in a zip archive.
Definition: kzip.h:171
KZip
A class for reading / writing zip archives.
Definition: kzip.h:46
KZip::ExtraField
ExtraField
Describes the contents of the "extra field" for a given file in the Zip archive.
Definition: kzip.h:74
KZip::Compression
Compression
Describes the compression type for a given file in the Zip archive.
Definition: kzip.h:97
QIODevice
QString
qint64
karchive.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal