added compression ratio argument to wxZlibOutputStream ctor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -104,7 +104,7 @@ size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size)
|
||||
// wxZlibOutputStream
|
||||
//////////////////////
|
||||
|
||||
wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream)
|
||||
wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream, int level)
|
||||
: wxFilterOutputStream(stream)
|
||||
{
|
||||
int err;
|
||||
@@ -115,7 +115,10 @@ wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream)
|
||||
m_deflate->zfree = (free_func)0;
|
||||
m_deflate->opaque = (voidpf)0;
|
||||
|
||||
err = deflateInit(m_deflate, Z_DEFAULT_COMPRESSION);
|
||||
if (level == -1) level = Z_DEFAULT_COMPRESSION;
|
||||
wxASSERT_MSG(level >= 0 && level <= 9, wxT("wxZlibOutputStream compression level must be between 0 and 9!"));
|
||||
|
||||
err = deflateInit(m_deflate, level);
|
||||
if (err != Z_OK) {
|
||||
deflateEnd(m_deflate);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user