zipios::ZipOutputStreambuf Class Reference

ZipOutputStreambuf is a zip output streambuf filter. More...

`#include <zipoutputstreambuf.h>`

Inheritance diagram for zipios::ZipOutputStreambuf:
[legend]

## Public Types

enum | CompressionLevels { NO_COMPRESSION = Z_NO_COMPRESSION , BEST_SPEED = Z_BEST_SPEED , BEST_COMPRESSION = Z_BEST_COMPRESSION , DEFAULT_COMPRESSION = Z_DEFAULT_COMPRESSION }

## Public Member Functions

| ZipOutputStreambuf (streambuf *outbuf, bool del_outbuf=false)
| ZipOutputStreambuf constructor.
void | closeEntry ()
| Closes the current entry, and positions the stream read pointer at the beginning of the next entry (if there is one).
void | close ()
| Calls finish.
void | finish ()
| Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream.
void | putNextEntry (const ZipCDirEntry &entry)
| Begins writing the next entry.
void | setComment (const string &comment)
| Sets the global comment for the Zip archive.
void | setLevel (int level)
| Sets the compression level to be used for subsequent entries.
void | setMethod (StorageMethod method)
| Sets the compression method to be used.
virtual | ~ZipOutputStreambuf ()
| Destructor.
Public Member Functions inherited from zipios::DeflateOutputStreambuf
| DeflateOutputStreambuf (streambuf *outbuf, bool user_init=false, bool del_outbuf=false)
| DeflateOutputStreambuf constructor.
virtual | ~DeflateOutputStreambuf ()
| Destructor.
bool | init (int comp_level=6)
bool | closeStream ()
uint32 | getCrc32 () const
| Returns the CRC32 for the current stream.
uint32 | getCount () const
| Returns the number of bytes written to the streambuf, that has been processed from the input buffer by the compressor.
Public Member Functions inherited from zipios::FilterOutputStreambuf
| FilterOutputStreambuf (streambuf *outbuf, bool del_outbuf=false)
| Constructor.
virtual | ~FilterOutputStreambuf ()
| Destructor.

## Protected Member Functions

virtual int | overflow (int c=EOF)
virtual int | sync ()
void | setEntryClosedState ()
void | updateEntryHeaderInfo ()
Protected Member Functions inherited from zipios::DeflateOutputStreambuf
bool | flushOutvec ()
| Flushes _outvec and updates _zs.next_out and _zs.avail_out.
void | endDeflation ()
| Flushes the remaining data in the zlib buffers, after which the only possible operations are deflateEnd() or deflateReset().

## Static Protected Member Functions

static void | writeCentralDirectory (const vector< ZipCDirEntry > &entries, EndOfCentralDirectory eocd, ostream &os)

## Additional Inherited Members

Protected Attributes inherited from zipios::DeflateOutputStreambuf
const int | _invecsize
vector< char > | _invec
const int | _outvecsize
vector< char > | _outvec
uint32 | _crc32
uint32 | _overflown_bytes
Protected Attributes inherited from zipios::FilterOutputStreambuf
streambuf * | _outbuf
bool | _del_outbuf

## Detailed Description

ZipOutputStreambuf is a zip output streambuf filter.

Definition at line 17 of file zipoutputstreambuf.h.

## Member Enumeration Documentation

## CompressionLevels

enum zipios::ZipOutputStreambuf::CompressionLevels

Definition at line 20 of file zipoutputstreambuf.h.

## Constructor & Destructor Documentation

## ZipOutputStreambuf()

zipios::ZipOutputStreambuf::ZipOutputStreambuf | ( | streambuf * | outbuf,
|  | bool | del_outbuf = false )

explicit

ZipOutputStreambuf constructor.

A newly constructed ZipOutputStreambuf is not ready to accept data, putNextEntry() must be invoked first.

Parameters

  outbuf | the streambuf to use for input.
  del_outbuf | if true is specified outbuf will be deleted, when the ZipOutputStreambuf is destructed.

Definition at line 20 of file zipoutputstreambuf.cpp.

## ~ZipOutputStreambuf()

zipios::ZipOutputStreambuf::~ZipOutputStreambuf | ( |  | ) |

virtual

Destructor.

Definition at line 56 of file zipoutputstreambuf.cpp.

## Member Function Documentation

## close()

void zipios::ZipOutputStreambuf::close | ( |  | ) |

Calls finish.

Definition at line 41 of file zipoutputstreambuf.cpp.

## closeEntry()

void zipios::ZipOutputStreambuf::closeEntry | ( |  | ) |

Closes the current entry, and positions the stream read pointer at the beginning of the next entry (if there is one).

Definition at line 30 of file zipoutputstreambuf.cpp.

## finish()

void zipios::ZipOutputStreambuf::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 46 of file zipoutputstreambuf.cpp.

## overflow()

int zipios::ZipOutputStreambuf::overflow | ( | int | c = EOF | ) |

protected virtual

Reimplemented from zipios::DeflateOutputStreambuf.

Definition at line 108 of file zipoutputstreambuf.cpp.

## putNextEntry()

void zipios::ZipOutputStreambuf::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 61 of file zipoutputstreambuf.cpp.

## setComment()

void zipios::ZipOutputStreambuf::setComment | ( | const string & | comment | ) |

Sets the global comment for the Zip archive.

Definition at line 83 of file zipoutputstreambuf.cpp.

## setEntryClosedState()

void zipios::ZipOutputStreambuf::setEntryClosedState | ( |  | ) |

protected

Definition at line 127 of file zipoutputstreambuf.cpp.

## setLevel()

void zipios::ZipOutputStreambuf::setLevel | ( | int | level | ) |

Sets the compression level to be used for subsequent entries.

Definition at line 88 of file zipoutputstreambuf.cpp.

## setMethod()

void zipios::ZipOutputStreambuf::setMethod | ( | StorageMethod | method | ) |

Sets the compression method to be used.

only STORED and DEFLATED are supported.

Definition at line 93 of file zipoutputstreambuf.cpp.

## sync()

int zipios::ZipOutputStreambuf::sync | ( |  | ) |

protected virtual

Reimplemented from zipios::DeflateOutputStreambuf.

Definition at line 118 of file zipoutputstreambuf.cpp.

## updateEntryHeaderInfo()

void zipios::ZipOutputStreambuf::updateEntryHeaderInfo | ( |  | ) |

protected

Definition at line 134 of file zipoutputstreambuf.cpp.

## writeCentralDirectory()

void zipios::ZipOutputStreambuf::writeCentralDirectory | ( | const vector< ZipCDirEntry > & | entries,
|  | EndOfCentralDirectory | eocd,
|  | ostream & | os )

static protected

Definition at line 164 of file zipoutputstreambuf.cpp.

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

- zipoutputstreambuf.h
- zipoutputstreambuf.cpp