1998-07-14 12:06:50 +00: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-15 00:23:28 +00:00
|
|
|
#ifndef _WX_WXZSTREAM_H__
|
|
|
|
#define _WX_WXZSTREAM_H__
|
1998-07-14 12:06:50 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <wx/stream.h>
|
|
|
|
|
|
|
|
class wxZlibInputStream: public wxFilterInputStream {
|
|
|
|
public:
|
|
|
|
wxZlibInputStream(wxInputStream& stream);
|
|
|
|
virtual ~wxZlibInputStream();
|
|
|
|
|
|
|
|
protected:
|
1998-10-14 17:36:50 +00:00
|
|
|
size_t OnSysRead(void *buffer, size_t size);
|
1998-07-24 17:13:47 +00:00
|
|
|
|
|
|
|
protected:
|
1998-07-14 12:06:50 +00:00
|
|
|
size_t m_z_size;
|
|
|
|
unsigned char *m_z_buffer;
|
1998-09-17 17:30:13 +00:00
|
|
|
struct z_stream_s *m_inflate;
|
1998-07-14 12:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class wxZlibOutputStream: public wxFilterOutputStream {
|
|
|
|
public:
|
|
|
|
wxZlibOutputStream(wxOutputStream& stream);
|
|
|
|
virtual ~wxZlibOutputStream();
|
|
|
|
|
1998-07-24 17:13:47 +00:00
|
|
|
void Sync();
|
1998-07-14 12:06:50 +00:00
|
|
|
|
|
|
|
protected:
|
1998-10-14 17:36:50 +00:00
|
|
|
size_t OnSysWrite(const void *buffer, size_t size);
|
1998-07-24 17:13:47 +00:00
|
|
|
|
|
|
|
protected:
|
1998-07-14 12:06:50 +00:00
|
|
|
size_t m_z_size;
|
|
|
|
unsigned char *m_z_buffer;
|
1998-09-17 17:30:13 +00:00
|
|
|
struct z_stream_s *m_deflate;
|
1998-07-14 12:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|