1998-07-14 08:06:50 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: zstream.h
|
|
|
|
// Purpose: Memory stream classes
|
|
|
|
// Author: Guilhem Lavaux
|
|
|
|
// Modified by:
|
|
|
|
// Created: 11/07/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Guilhem Lavaux
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_WXZSTREAM_H__
|
|
|
|
#define _WX_WXZSTREAM_H__
|
1998-07-14 08:06:50 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1999-01-04 13:34:42 -05:00
|
|
|
#include "wx/defs.h"
|
1999-01-04 08:52:06 -05:00
|
|
|
|
1999-06-15 16:21:59 -04:00
|
|
|
#if wxUSE_ZLIB && wxUSE_STREAMS
|
1999-01-04 08:52:06 -05:00
|
|
|
|
1999-08-20 18:52:21 -04:00
|
|
|
#include "wx/stream.h"
|
1998-07-14 08:06:50 -04:00
|
|
|
|
1998-11-16 06:48:53 -05:00
|
|
|
class WXDLLEXPORT wxZlibInputStream: public wxFilterInputStream {
|
1998-07-14 08:06:50 -04:00
|
|
|
public:
|
|
|
|
wxZlibInputStream(wxInputStream& stream);
|
|
|
|
virtual ~wxZlibInputStream();
|
|
|
|
|
|
|
|
protected:
|
1998-10-14 13:36:50 -04:00
|
|
|
size_t OnSysRead(void *buffer, size_t size);
|
1998-07-24 13:13:47 -04:00
|
|
|
|
|
|
|
protected:
|
1998-07-14 08:06:50 -04:00
|
|
|
size_t m_z_size;
|
|
|
|
unsigned char *m_z_buffer;
|
1998-09-17 13:30:13 -04:00
|
|
|
struct z_stream_s *m_inflate;
|
1998-07-14 08:06:50 -04:00
|
|
|
};
|
|
|
|
|
1998-11-16 06:48:53 -05:00
|
|
|
class WXDLLEXPORT wxZlibOutputStream: public wxFilterOutputStream {
|
1998-07-14 08:06:50 -04:00
|
|
|
public:
|
2000-03-03 17:52:17 -05:00
|
|
|
wxZlibOutputStream(wxOutputStream& stream, int level = -1);
|
1998-07-14 08:06:50 -04:00
|
|
|
virtual ~wxZlibOutputStream();
|
|
|
|
|
1998-07-24 13:13:47 -04:00
|
|
|
void Sync();
|
1998-07-14 08:06:50 -04:00
|
|
|
|
|
|
|
protected:
|
1998-10-14 13:36:50 -04:00
|
|
|
size_t OnSysWrite(const void *buffer, size_t size);
|
1998-07-24 13:13:47 -04:00
|
|
|
|
|
|
|
protected:
|
1998-07-14 08:06:50 -04:00
|
|
|
size_t m_z_size;
|
|
|
|
unsigned char *m_z_buffer;
|
1998-09-17 13:30:13 -04:00
|
|
|
struct z_stream_s *m_deflate;
|
1998-07-14 08:06:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1999-06-15 16:21:59 -04:00
|
|
|
// wxUSE_ZLIB && wxUSE_STREAMS
|
1999-01-04 08:52:06 -05:00
|
|
|
|
|
|
|
#endif
|
1999-07-09 11:30:31 -04:00
|
|
|
// _WX_WXZSTREAM_H__
|
|
|
|
|