00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _OSRTINPUTSTREAMIF_H_
00029 #define _OSRTINPUTSTREAMIF_H_
00030
00031 #include "rtxsrc/OSRTStreamIF.h"
00032
00043 class EXTRTCLASS OSRTInputStreamIF : public OSRTStreamIF {
00044 public:
00045 enum StreamID { Unknown, File, Memory, Socket };
00046
00050 virtual EXTRTMETHOD ~OSRTInputStreamIF ();
00051
00059 virtual OSBOOL isA (StreamID id) const = 0;
00060
00066 virtual size_t currentPos () = 0;
00067
00077 virtual int getPosition (size_t* ppos) = 0;
00078
00088 virtual OSBOOL markSupported () = 0;
00089
00105 virtual int mark (size_t readAheadLimit) = 0;
00106
00119 virtual long read (OSOCTET* pDestBuf, size_t maxToRead) = 0;
00120
00133 virtual long readBlocking (OSOCTET* pDestBuf, size_t toReadBytes) = 0;
00134
00144 virtual int reset () = 0;
00145
00156 virtual int setPosition (size_t pos) = 0;
00157
00168 virtual int skip (size_t n) = 0;
00169
00170 } ;
00171
00172 class EXTRTCLASS OSRTInputStreamPtr {
00173 OSRTInputStreamIF* mPtr;
00174 public:
00175 inline OSRTInputStreamPtr (OSRTInputStreamIF* ptr) : mPtr (ptr) {}
00176 inline ~OSRTInputStreamPtr () { delete mPtr; }
00177
00178 inline operator OSRTInputStreamIF* () { return mPtr; }
00179 inline OSRTInputStreamIF* operator-> () { return mPtr; }
00180 } ;
00181
00184 #endif