| zipios 2.3.4
    Zipios -- a small C++ library providing easy access to .zip files. | 
A stream implementation that outputs data to a ZIP file. More...
#include <gzipoutputstream.hpp>


| Public Member Functions | |
| GZIPOutputStream (std::ostream &os, FileEntry::CompressionLevel compression_level) | |
| Create a ZIP output stream object. | |
| GZIPOutputStream (std::string const &filename, FileEntry::CompressionLevel compression_level) | |
| Create a named ZIP stream for output. | |
| virtual | ~GZIPOutputStream () | 
| Destroy the output stream. | |
| void | close () | 
| Close the streams. | |
| void | finish () | 
| Finishes the stream. | |
| void | setComment (std::string const &comment) | 
| Set a comment in the stream. | |
| void | setFilename (std::string const &filename) | 
| Set the filename of a stream. | |
| Private Attributes | |
| std::unique_ptr< std::ofstream > | m_ofs = std::unique_ptr<std::ofstream>() | 
| std::unique_ptr< GZIPOutputStreambuf > | m_ozf = std::unique_ptr<GZIPOutputStreambuf>() | 
GZIPOutputStream is an ostream that writes the output to a zip file. The interface approximates the interface of the Java GZIPOutputStream.
It can be used with either an existing std::ostream object, or a filename.
Definition at line 42 of file gzipoutputstream.hpp.
| zipios::GZIPOutputStream::GZIPOutputStream | ( | std::ostream & | os, | 
| FileEntry::CompressionLevel | compression_level | ||
| ) | 
This constructor creates a zip stream from an existing standard output stream.
os stream.)| [in,out] | os | ostream to which the compressed zip archive is written. | 
| [in] | compression_level | The compression level to use to compress. | 
Definition at line 63 of file gzipoutputstream.cpp.
References m_ozf.
| zipios::GZIPOutputStream::GZIPOutputStream | ( | std::string const & | filename, | 
| FileEntry::CompressionLevel | compression_level | ||
| ) | 
| [in] | filename | Name of the file where the zip archive is to be written. | 
| [in] | compression_level | The compression level to use to compress. | 
Definition at line 80 of file gzipoutputstream.cpp.
References m_ozf.
| 
 | virtual | 
The destructor ensures that all allocated resources get destroyed.
Definition at line 93 of file gzipoutputstream.cpp.
| void zipios::GZIPOutputStream::close | ( | ) | 
This function closes the streams making sure that all data gets saved in the output file.
It is not required since destroying the object will also force a close.
Definition at line 135 of file gzipoutputstream.cpp.
| void zipios::GZIPOutputStream::finish | ( | ) | 
Definition at line 148 of file gzipoutputstream.cpp.
References m_ozf.
| void zipios::GZIPOutputStream::setComment | ( | std::string const & | comment | ) | 
This function can be used to add a comment to the zip file.
A comment is optional.
| [in] | comment | The comment to attach to this stream. | 
Definition at line 121 of file gzipoutputstream.cpp.
References m_ozf.
| void zipios::GZIPOutputStream::setFilename | ( | std::string const & | filename | ) | 
This function can be used to set the name of the file being added to this stream.
The filename is optional.
| [in] | filename | The filename to attach to this stream. | 
Definition at line 107 of file gzipoutputstream.cpp.
References m_ozf.
| 
 | private | 
Definition at line 55 of file gzipoutputstream.hpp.
Referenced by close().
| 
 | private | 
Definition at line 56 of file gzipoutputstream.hpp.
Referenced by GZIPOutputStream(), GZIPOutputStream(), close(), finish(), setComment(), and setFilename().