Main Page   Class Hierarchy   Compound List   File List   Compound Members  

zipios::ZipOutputStream Class Reference

ZipOutputStream is an ostream that writes the output to a zip file. More...

#include <zipoutputstream.h>

Inheritance diagram for zipios::ZipOutputStream

Inheritance graph

[legend]
List of all members.

Public Methods

 ZipOutputStream ( ostream &os, streampos pos = 0 )
 ZipOutputStream constructor. More...

 ZipOutputStream ( const string &filename, streampos pos = 0 )
void closeEntry ()
 Closes the current entry updates its header with the relevant size information and positions the stream write pointer for the next entry header. More...

void close ()
 Calls finish and if the ZipOutputStream was created with a filename as a parameter that file is closed as well. More...

void finish ()
 Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream. More...

void putNextEntry ( const ZipCDirEntry &entry )
 Begins writing the next entry. More...

void setComment ( const string &comment )
 Sets the global comment for the Zip archive. More...

void setLevel ( int level )
 Sets the compression level to be used for subsequent entries. More...

void setMethod ( StorageMethod method )
 Sets the compression method to be used. More...

virtual ~ZipOutputStream ()
 Destructor. More...


Detailed Description

ZipOutputStream is an ostream that writes the output to a zip file.

The interface approximates the interface of the Java ZipOutputStream.

Definition at line 20 of file zipoutputstream.h.


Constructor & Destructor Documentation

zipios::ZipOutputStream::ZipOutputStream ( ostream & os,
streampos pos = 0 ) [explicit]
 

ZipOutputStream constructor.

Parameters:
os   ostream to which the compressed zip archive is written.
pos   position to reposition the ostream to before reading.

Definition at line 11 of file zipoutputstream.cpp.

zipios::ZipOutputStream::ZipOutputStream ( const string & filename,
streampos pos = 0 ) [explicit]
 

Definition at line 22 of file zipoutputstream.cpp.

zipios::ZipOutputStream::~ZipOutputStream ( ) [virtual]
 

Destructor.

Definition at line 68 of file zipoutputstream.cpp.


Member Function Documentation

void zipios::ZipOutputStream::close ( )
 

Calls finish and if the ZipOutputStream was created with a filename as a parameter that file is closed as well.

If the ZipOutputStream was created with an ostream as its first parameter nothing but the call to finish happens.

Definition at line 36 of file zipoutputstream.cpp.

void zipios::ZipOutputStream::closeEntry ( )
 

Closes the current entry updates its header with the relevant size information and positions the stream write pointer for the next entry header.

Puts the stream in EOF state. Call putNextEntry() to clear the EOF stream state flag.

Definition at line 31 of file zipoutputstream.cpp.

void zipios::ZipOutputStream::finish ( )
 

Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream.

The output stream that the zip archive is being written to is not closed.

Definition at line 43 of file zipoutputstream.cpp.

void zipios::ZipOutputStream::putNextEntry ( const ZipCDirEntry & entry )
 

Begins writing the next entry.

Opens the next entry in the zip archive and returns a const pointer to a FileEntry object for the entry.

Returns:
a const FileEntry * containing information about the (now) current entry.

Definition at line 48 of file zipoutputstream.cpp.

void zipios::ZipOutputStream::setComment ( const string & comment )
 

Sets the global comment for the Zip archive.

Definition at line 53 of file zipoutputstream.cpp.

void zipios::ZipOutputStream::setLevel ( int level )
 

Sets the compression level to be used for subsequent entries.

Definition at line 58 of file zipoutputstream.cpp.

void zipios::ZipOutputStream::setMethod ( StorageMethod method )
 

Sets the compression method to be used.

only STORED and DEFLATED are supported.

Definition at line 63 of file zipoutputstream.cpp.


The documentation for this class was generated from the following files:
Generated at Tue Aug 14 20:40:00 2001 for Zipios++ by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000