TaurusZIPLibrary  $VERSION$
QtZipHelper::Zip Class Reference

This class represents a ZIP file being assembled. More...

#include <qtziphlp.h>

Inheritance diagram for QtZipHelper::Zip:
QtZipHelper::ZipHlpBase

Public Types

enum  OpenMode { OpenTruncate =0, OpenAppend =1 }
 Defines how the ZIP file is opened. More...
 

Public Slots

virtual bool open (QIODevice *d, OpenMode mode=OpenTruncate)
 
virtual void close ()
 
virtual bool storeFile (const QString &name, QIODevice &file, const QDateTime &time=QDateTime::currentDateTime())
 
virtual bool storeFile (const QString &name, QByteArray content, const QDateTime &time=QDateTime::currentDateTime())
 stores the byte array as a file in the ZIP file, compressing it More...
 
virtual bool storeRawFile (const ZipFileInfo &info, QIODevice &file)
 
virtual bool storeRawFile (const ZipFileInfo &info, QByteArray content)
 

Public Member Functions

 Zip (QObject *parent=0)
 create a new ZIP object More...
 
virtual ~Zip ()
 delete the ZIP object and implicitly close it More...
 
bool isOpen () const
 returns true if the ZIP file is open for adding files More...
 
- Public Member Functions inherited from QtZipHelper::ZipHlpBase
 ZipHlpBase (QObject *parent=0)
 create Zip object with parent More...
 
virtual ~ZipHlpBase ()
 delete the object More...
 
virtual void close ()=0
 abstract base function: close the ZIP file More...
 

Friends

class Unzip
 

Additional Inherited Members

- Protected Attributes inherited from QtZipHelper::ZipHlpBase
Private * d
 

Detailed Description

This class represents a ZIP file being assembled.

Member Enumeration Documentation

Defines how the ZIP file is opened.

Enumerator
OpenTruncate 

Creates a fresh ZIP archive, even if the file exists.

OpenAppend 

If the file is new: create it, if it exists: append more files to the existing archive.

Constructor & Destructor Documentation

QtZipHelper::Zip::Zip ( QObject *  parent = 0)
explicit

create a new ZIP object

virtual QtZipHelper::Zip::~Zip ( )
virtual

delete the ZIP object and implicitly close it

Member Function Documentation

virtual void QtZipHelper::Zip::close ( )
virtualslot

closes the ZIP object (writing headers, trailers, etc.), but does not close the actual QIODevice

bool QtZipHelper::Zip::isOpen ( ) const
virtual

returns true if the ZIP file is open for adding files

Implements QtZipHelper::ZipHlpBase.

virtual bool QtZipHelper::Zip::open ( QIODevice *  d,
OpenMode  mode = OpenTruncate 
)
virtualslot

attached this ZIP object to the given device, does not take ownership of the device, you are responsible for closing or reparenting it

virtual bool QtZipHelper::Zip::storeFile ( const QString &  name,
QIODevice &  file,
const QDateTime &  time = QDateTime::currentDateTime() 
)
virtualslot

stores the content of the given QIODevice in the ZIP archive, compressing it at the same time, the method assumes that the device is at the correct position to start reading (i.e. if it is a file: you are responsible for seeking to the start first)

virtual bool QtZipHelper::Zip::storeFile ( const QString &  name,
QByteArray  content,
const QDateTime &  time = QDateTime::currentDateTime() 
)
virtualslot

stores the byte array as a file in the ZIP file, compressing it

virtual bool QtZipHelper::Zip::storeRawFile ( const ZipFileInfo info,
QIODevice &  file 
)
virtualslot

assumes the file is properly compressed and the info object contains the correct information - use this for copying from an Unzip object

virtual bool QtZipHelper::Zip::storeRawFile ( const ZipFileInfo info,
QByteArray  content 
)
virtualslot

assumes the file is properly compressed and the info object contains the correct information - use this for copying from an Unzip object

Friends And Related Function Documentation

friend class Unzip
friend

The documentation for this class was generated from the following file: