00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SUBSTREAMBUF_H
00016 #define SUBSTREAMBUF_H
00017
00018 #include "pandabase.h"
00019 #include "streamWrapper.h"
00020
00021
00022
00023
00024
00025 class EXPCL_PANDAEXPRESS SubStreamBuf : public streambuf {
00026 public:
00027 SubStreamBuf();
00028 virtual ~SubStreamBuf();
00029
00030 void open(IStreamWrapper *source, OStreamWrapper *dest, streampos start, streampos end, bool append);
00031 void close();
00032
00033 virtual streampos seekoff(streamoff off, ios_seekdir dir, ios_openmode which);
00034 virtual streampos seekpos(streampos pos, ios_openmode which);
00035
00036 protected:
00037 virtual int overflow(int c);
00038 virtual int sync();
00039 virtual int underflow();
00040
00041 private:
00042 IStreamWrapper *_source;
00043 OStreamWrapper *_dest;
00044 streampos _start;
00045 streampos _end;
00046 bool _append;
00047 streampos _gpos;
00048 streampos _ppos;
00049 char *_buffer;
00050 };
00051
00052 #endif