mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Added Stream::PureFilter
This commit is contained in:
parent
4065ac0199
commit
4d16beef1a
1 changed files with 39 additions and 0 deletions
39
stream/filters/pure_filter.h
Normal file
39
stream/filters/pure_filter.h
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef MANGLE_STREAM_FILTER_H
|
||||||
|
#define MANGLE_STREAM_FILTER_H
|
||||||
|
|
||||||
|
#include "../stream.h"
|
||||||
|
|
||||||
|
namespace Mangle {
|
||||||
|
namespace Stream {
|
||||||
|
|
||||||
|
/** A stream that filters another stream with no changes. Intended as
|
||||||
|
a base class for other filters.
|
||||||
|
*/
|
||||||
|
class PureFilter : public Stream
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
StreamPtr src;
|
||||||
|
|
||||||
|
public:
|
||||||
|
PureFilter(StreamPtr _src)
|
||||||
|
: src(_src)
|
||||||
|
{
|
||||||
|
isSeekable = src->isSeekable;
|
||||||
|
hasPosition = src->hasPosition;
|
||||||
|
hasSize = src->hasSize;
|
||||||
|
hasPtr = src->hasPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t read(void *buf, size_t count) { return src->read(buf, count); }
|
||||||
|
void seek(size_t pos) { src->seek(pos); }
|
||||||
|
size_t tell() const { return src->tell(); }
|
||||||
|
size_t size() const { return src->size(); }
|
||||||
|
bool eof() const { return src->eof(); }
|
||||||
|
const void *getPtr() { return src->getPtr(); }
|
||||||
|
const void *getPtr(size_t size) { return src->getPtr(size); }
|
||||||
|
const void *getPtr(size_t pos, size_t size)
|
||||||
|
{ return src->getPtr(pos, size); }
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespaces
|
||||||
|
#endif
|
Loading…
Reference in a new issue