strigi/src/streams
dataeventinputstream.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef STRIGI_DATAEVENTINPUTSTREAM_H
00021 #define STRIGI_DATAEVENTINPUTSTREAM_H
00022 #include <strigi/strigiconfig.h>
00023 #include "streambase.h"
00024
00025 namespace Strigi {
00026
00037 class STREAMS_EXPORT DataEventHandler {
00038 public:
00040 virtual ~DataEventHandler() {}
00063 virtual bool handleData(const char* data, uint32_t size) = 0;
00071 virtual void handleEnd() {}
00072 };
00073
00094 class STREAMS_EXPORT DataEventInputStream : public InputStream {
00095 private:
00096 int64_t totalread;
00097 InputStream* input;
00098 DataEventHandler& handler;
00099 bool finished;
00100
00101 void finish();
00102 public:
00114 explicit DataEventInputStream(InputStream *input,
00115 DataEventHandler& handler);
00116 int32_t read(const char*& start, int32_t min, int32_t max);
00117 int64_t skip(int64_t ntoskip);
00118 int64_t reset(int64_t pos);
00119 };
00120
00121 }
00122
00123 #endif