2001-10-06 18:13:28 +04:00
|
|
|
#ifndef CINPUTSTREAMFILTER_H
|
|
|
|
#define CINPUTSTREAMFILTER_H
|
|
|
|
|
|
|
|
#include "IInputStream.h"
|
|
|
|
|
2002-07-28 21:25:13 +04:00
|
|
|
//! A filtering input stream
|
|
|
|
/*!
|
|
|
|
This class wraps an input stream. Subclasses provide indirect access
|
|
|
|
to the stream, typically performing some filtering.
|
|
|
|
*/
|
2001-10-06 18:13:28 +04:00
|
|
|
class CInputStreamFilter : public IInputStream {
|
2002-04-29 18:40:01 +04:00
|
|
|
public:
|
2002-07-28 21:25:13 +04:00
|
|
|
/*!
|
|
|
|
Create a wrapper around \c stream. Iff \c adoptStream is true then
|
|
|
|
this object takes ownership of the stream and will delete it in the
|
|
|
|
d'tor.
|
|
|
|
*/
|
|
|
|
CInputStreamFilter(IInputStream* stream, bool adoptStream = true);
|
2001-10-06 18:13:28 +04:00
|
|
|
~CInputStreamFilter();
|
|
|
|
|
|
|
|
// IInputStream overrides
|
2001-10-14 20:58:01 +04:00
|
|
|
virtual void close() = 0;
|
2002-07-28 21:25:13 +04:00
|
|
|
virtual UInt32 read(void*, UInt32 n, double timeout) = 0;
|
2001-10-14 20:58:01 +04:00
|
|
|
virtual UInt32 getSize() const = 0;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
protected:
|
2002-07-28 21:25:13 +04:00
|
|
|
//! Get the stream
|
|
|
|
/*!
|
|
|
|
Returns the stream passed to the c'tor.
|
|
|
|
*/
|
2001-10-14 20:58:01 +04:00
|
|
|
IInputStream* getStream() const;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
private:
|
2001-10-06 18:13:28 +04:00
|
|
|
IInputStream* m_stream;
|
|
|
|
bool m_adopted;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|