2001-10-06 14:13:28 +00:00
|
|
|
#ifndef COUTPUTSTREAMFILTER_H
|
|
|
|
#define COUTPUTSTREAMFILTER_H
|
|
|
|
|
|
|
|
#include "IOutputStream.h"
|
|
|
|
|
2002-07-28 17:25:13 +00:00
|
|
|
//! A filtering output stream
|
|
|
|
/*!
|
|
|
|
This class wraps an output stream. Subclasses provide indirect access
|
|
|
|
to the stream, typically performing some filtering.
|
|
|
|
*/
|
2001-10-06 14:13:28 +00:00
|
|
|
class COutputStreamFilter : public IOutputStream {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2002-07-28 17:25:13 +00: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.
|
|
|
|
*/
|
|
|
|
COutputStreamFilter(IOutputStream* stream, bool adoptStream = true);
|
2001-10-06 14:13:28 +00:00
|
|
|
~COutputStreamFilter();
|
|
|
|
|
|
|
|
// IOutputStream overrides
|
2001-10-14 16:58:01 +00:00
|
|
|
virtual void close() = 0;
|
|
|
|
virtual UInt32 write(const void*, UInt32 count) = 0;
|
|
|
|
virtual void flush() = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
protected:
|
2002-07-28 17:25:13 +00:00
|
|
|
//! Get the stream
|
|
|
|
/*!
|
|
|
|
Returns the stream passed to the c'tor.
|
|
|
|
*/
|
2001-10-14 16:58:01 +00:00
|
|
|
IOutputStream* getStream() const;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
private:
|
2001-10-06 14:13:28 +00:00
|
|
|
IOutputStream* m_stream;
|
|
|
|
bool m_adopted;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|