wxGzipOutputStream::wxGzipOutputStream
wxGzipOutputStream::~wxGzipOutputStream
wxGzipOutputStream
Contents Up Previous Next

wxGzipOutputStream

A stream filter to compress gzipped data. The gzip format is specified in RFC-1952.

The stream is not seekable, SeekO() returns wxInvalidOffset.

Derived from

wxFilterOutputStream

Include files

<wx/gzstream.h>

See also

wxGzipInputStream, wxZlibOutputStream, wxOutputStream.

Members


wxGzipOutputStream::wxGzipOutputStream

wxGzipOutputStream(wxOutputStream& stream, const wxString& originalName = wxEmptyString, const wxDateTime& originalTime = wxDateTime::Now(), int level = -1, wxMBConv& conv = wxConvFile)

If the originalName is given, then it is written to the gzip header with any directory components removed. On a Unicode build it is first converted to an 8-bit encoding using conv. RFC-1952 specifies that the character set should be ISO-8859-1, however the default here is to use wxConvFile which more closely matches the behaviour of the gzip program. In a non-Unicode build conv is ignored. conv has no effect on the stream data.

If originalTime is given then it is also written to the gzip header as the timestamp. If omitted the current time is used.

level is the compression level. It can be an integer between 0 (no compression) and 9 (most compression). -1 specifies that the default compression should be used, and is currently equivalent to 6.

You can also use the following constants from <wx/zstream.h>:

// Compression level
enum {
    wxZ_DEFAULT_COMPRESSION = -1,
    wxZ_NO_COMPRESSION = 0,
    wxZ_BEST_SPEED = 1,
    wxZ_BEST_COMPRESSION = 9
}

wxGzipOutputStream::~wxGzipOutputStream

~wxGzipOutputStream()

Destructor.