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
|
|
|
|
|
|
|
|
#include <wx/stream.h>
|
1998-07-24 15:05:25 -04:00
|
|
|
#include "../zlib/zlib.h"
|
1998-07-14 08:06:50 -04:00
|
|
|
|
|
|
|
class wxZlibInputStream: public wxFilterInputStream {
|
|
|
|
public:
|
|
|
|
wxZlibInputStream(wxInputStream& stream);
|
|
|
|
virtual ~wxZlibInputStream();
|
|
|
|
|
|
|
|
bool Eof() const;
|
|
|
|
|
|
|
|
protected:
|
1998-07-24 13:13:47 -04:00
|
|
|
size_t DoRead(void *buffer, size_t size);
|
1998-07-24 15:05:25 -04:00
|
|
|
off_t DoSeekInput(off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; }
|
1998-07-24 13:13:47 -04:00
|
|
|
off_t DoTellInput() const { return wxInvalidOffset; }
|
|
|
|
|
|
|
|
protected:
|
1998-07-14 08:06:50 -04:00
|
|
|
size_t m_z_size;
|
|
|
|
unsigned char *m_z_buffer;
|
|
|
|
struct z_stream_s m_inflate;
|
|
|
|
};
|
|
|
|
|
|
|
|
class wxZlibOutputStream: public wxFilterOutputStream {
|
|
|
|
public:
|
|
|
|
wxZlibOutputStream(wxOutputStream& stream);
|
|
|
|
virtual ~wxZlibOutputStream();
|
|
|
|
|
1998-07-24 13:13:47 -04:00
|
|
|
void Sync();
|
1998-07-14 08:06:50 -04:00
|
|
|
|
|
|
|
bool Bad() const;
|
|
|
|
|
|
|
|
protected:
|
1998-07-24 13:13:47 -04:00
|
|
|
size_t DoWrite(const void *buffer, size_t size);
|
1998-07-24 15:05:25 -04:00
|
|
|
off_t DoSeekOutput(off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; }
|
1998-07-24 13:13:47 -04:00
|
|
|
off_t DoTellOutput() const { return wxInvalidOffset; }
|
|
|
|
|
|
|
|
protected:
|
1998-07-14 08:06:50 -04:00
|
|
|
size_t m_z_size;
|
|
|
|
unsigned char *m_z_buffer;
|
|
|
|
struct z_stream_s m_deflate;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|