• Skip to content
  • Skip to link menu
KDE 4.1 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 
00155     virtual bool doWriteDir( const QString& name, const QString& user,
00156                              const QString& group, mode_t perm, time_t atime,
00157                              time_t mtime, time_t ctime );
00158 
00159 protected:
00160     virtual void virtual_hook( int id, void* data );
00161 
00162 private:
00163     class KZipPrivate;
00164     KZipPrivate * const d;
00165 };
00166 
00167 
00171 class KIO_EXPORT KZipFileEntry : public KArchiveFile
00172 {
00173 public:
00177     KZipFileEntry( KZip* zip, const QString& name, int access, int date,
00178                    const QString& user, const QString& group, const QString& symlink,
00179                    const QString& path, qint64 start, qint64 uncompressedSize,
00180                    int encoding, qint64 compressedSize);
00181 
00185     ~KZipFileEntry();
00186 
00187     int encoding() const;
00188     qint64 compressedSize() const;
00189 
00191     void setCompressedSize(qint64 compressedSize);
00192 
00194     void setHeaderStart(qint64 headerstart);
00195     qint64 headerStart() const;
00196 
00198     unsigned long crc32() const;
00199     void setCRC32(unsigned long crc32);
00200 
00202     const QString &path() const;
00203 
00208     virtual QByteArray data() const;
00209 
00217     virtual QIODevice* createDevice() const;
00218 
00219 private:
00220     class KZipFileEntryPrivate;
00221     KZipFileEntryPrivate * const d;
00222 };
00223 
00224 #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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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