• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

kzip.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2002 Holger Schroeder <holger-kde@holgis.net>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 #ifndef KZIP_H
00019 #define KZIP_H
00020 
00021 #include <karchive.h>
00022 
00023 class KZipFileEntry;
00044 class KIO_EXPORT KZip : public KArchive
00045 {
00046 public:
00053     KZip( const QString& filename );
00054 
00062     KZip( QIODevice * dev );
00063 
00068     virtual ~KZip();
00069 
00073     enum ExtraField { NoExtraField = 0,      
00074                       ModificationTime = 1,  
00075                       DefaultExtraField = 1
00076     };
00077 
00084     void setExtraField( ExtraField ef );
00085 
00091     ExtraField extraField() const;
00092 
00096     enum Compression { NoCompression = 0,     
00097                DeflateCompression = 1 
00098     };
00099 
00100 
00107     void setCompression( Compression c );
00108 
00114     Compression compression() const;
00115 
00122     virtual bool writeData( const char* data, qint64 size );
00123 
00124 protected:
00126     virtual bool doWriteSymLink(const QString &name, const QString &target,
00127                                 const QString &user, const QString &group,
00128                                 mode_t perm, time_t atime, time_t mtime, time_t ctime);
00130     virtual bool doPrepareWriting( const QString& name, const QString& user,
00131                                  const QString& group, qint64 size, mode_t perm,
00132                                  time_t atime, time_t mtime, time_t ctime );
00133 
00139     virtual bool doFinishWriting( qint64 size );
00140 
00147     virtual bool openArchive( QIODevice::OpenMode mode );
00148 
00150     virtual bool closeArchive();
00151 
00153     virtual bool doWriteDir( const QString& name, const QString& user,
00154                              const QString& group, mode_t perm, time_t atime,
00155                              time_t mtime, time_t ctime );
00156 
00157 protected:
00158     virtual void virtual_hook( int id, void* data );
00159 
00160 private:
00161     class KZipPrivate;
00162     KZipPrivate * const d;
00163 };
00164 
00165 
00169 class KIO_EXPORT KZipFileEntry : public KArchiveFile
00170 {
00171 public:
00175     KZipFileEntry( KZip* zip, const QString& name, int access, int date,
00176                    const QString& user, const QString& group, const QString& symlink,
00177                    const QString& path, qint64 start, qint64 uncompressedSize,
00178                    int encoding, qint64 compressedSize);
00179 
00183     ~KZipFileEntry();
00184 
00185     int encoding() const;
00186     qint64 compressedSize() const;
00187 
00189     void setCompressedSize(qint64 compressedSize);
00190 
00192     void setHeaderStart(qint64 headerstart);
00193     qint64 headerStart() const;
00194 
00196     unsigned long crc32() const;
00197     void setCRC32(unsigned long crc32);
00198 
00200     const QString &path() const;
00201 
00206     virtual QByteArray data() const;
00207 
00215     virtual QIODevice* createDevice() const;
00216 
00217 private:
00218     class KZipFileEntryPrivate;
00219     KZipFileEntryPrivate * const d;
00220 };
00221 
00222 #endif

KIO

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal