X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1dc9f8394c1488ad8e7d945e6f943f7b34554ce..12a124ddc9f861d00370de1c7dfb660c53e6931b:/src/common/zstream.cpp diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 44c26f2703..57bed6a6a3 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -248,6 +248,16 @@ size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size) return major > 1 || (major == 1 && minor >= 2); } +bool wxZlibInputStream::SetDictionary(const char *data, const size_t datalen) +{ + return (inflateSetDictionary(m_inflate, (Bytef*)data, datalen) == Z_OK); +} + +bool wxZlibInputStream::SetDictionary(const wxMemoryBuffer &buf) +{ + return SetDictionary((char*)buf.GetData(), buf.GetDataLen()); +} + ////////////////////// // wxZlibOutputStream @@ -412,5 +422,15 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size) return wxZlibInputStream::CanHandleGZip(); } +bool wxZlibOutputStream::SetDictionary(const char *data, const size_t datalen) +{ + return (deflateSetDictionary(m_deflate, (Bytef*)data, datalen) == Z_OK); +} + +bool wxZlibOutputStream::SetDictionary(const wxMemoryBuffer &buf) +{ + return SetDictionary((char*)buf.GetData(), buf.GetDataLen()); +} + #endif // wxUSE_ZLIB && wxUSE_STREAMS