strigi/src/streams
inputstreamreader.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_INPUTSTREAMREADER_H
00021 #define STRIGI_INPUTSTREAMREADER_H
00022
00023 #include <string>
00024 #include <iconv.h>
00025 #include <strigi/strigiconfig.h>
00026 #include "bufferedstream.h"
00027 #include "streambase.h"
00028
00029 namespace Strigi {
00030
00039 class STREAMS_EXPORT InputStreamReader : public BufferedReader {
00040 private:
00041 iconv_t converter;
00042 bool finishedDecoding;
00043 InputStream* input;
00044 int32_t charsLeft;
00045
00046 StreamBuffer<char> charbuf;
00047 void readFromStream();
00048 int32_t decode(wchar_t* start, int32_t space);
00049 int32_t fillBuffer(wchar_t* start, int32_t space);
00050 public:
00064 explicit InputStreamReader(InputStream *i, const char *enc=0);
00065 ~InputStreamReader();
00066 };
00067
00068 }
00069
00070 #endif