class InFilterStream : public Stream
Adapter Stream that glues an input stream with some filtering object, typically of compression/decompression class.
Stream *in
Pointer to input stream that serves as the source of data to be filtered.
Callback2<const void *, int> Filter
Callback to filter input function.
Callback End
Callback to filter finalization. This is invoked by InFilterStream when it reaches the end of input stream. It gives chance to the filter to flush any remaining data (to Out).
Gate More
Callback used for alternate mode of operation where instead of input stream and filter only single data source is used. It should return true if source of data is still active, false when it reaches the end. False is then interpreted as EOF of InFilterStream.
void Out(const void *ptr, int size)
Method serving as filter output.
Callback WhenOut
This callback is called whenever Out method is invoked. It is intended for load progress indicators.
template <class F> void Set(Stream& in_, F& filter)
Sets the input stream and filter. Filter must have WhenOut callback which is connected to Out method and Put and End methods that are connected to Filter and End callbacks.
void SetBufferSize(int size)
Sets the size of internal buffer used to store input data before being filtered.
InFilterStream()
Default constructor.
template <class F> InFilterStream(Stream& in, F& filter)
Equivalent of default constructor followed by Set.
|