resonance 1.0.1
Loading...
Searching...
No Matches
ibstream.h
Go to the documentation of this file.
1#pragma once
2
15
36class IBStream {
37public:
47 virtual IBStream &Read(void *pDest, int nSize) = 0;
48
58 virtual IBStream &Seek(int nOffset, int nWhence) = 0;
59
67 virtual int Tell() = 0;
68
76 virtual int Eof() = 0;
77
85 virtual int Fail() = 0;
86
99 virtual IBStream &ReadLE(void *pDest, int nSize);
100
111 virtual IBStream &Flush() = 0;
112
120 virtual ~IBStream() {
121 }
122};
123
138IBStream &operator>>(IBStream &stream, int &bValue);
139
153IBStream &operator>>(IBStream &stream, long &nValue);
154
166IBStream &operator>>(IBStream &stream, unsigned long &nValue);
Input half of the byte stream interface.
Definition ibstream.h:36
virtual IBStream & Read(void *pDest, int nSize)=0
Move nSize bytes into pDest.
virtual int Tell()=0
Report the read position.
virtual IBStream & Seek(int nOffset, int nWhence)=0
Move the read position.
virtual IBStream & Flush()=0
Service the underlying transport.
virtual IBStream & ReadLE(void *pDest, int nSize)
Move nSize bytes into pDest through the virtual Read().
virtual int Eof()=0
Test whether the read position has arrived at the end of the data.
virtual ~IBStream()
Close the stream.
Definition ibstream.h:120
virtual int Fail()=0
Test whether a transfer has failed.
StreamSeekOrigin
Origin an IBStream::Seek() offset is measured from.
Definition ibstream.h:10
@ kStreamSeekEnd
Definition ibstream.h:13
@ kStreamSeekSet
Definition ibstream.h:11
@ kStreamSeekCur
Definition ibstream.h:12
IBStream & operator>>(IBStream &stream, int &bValue)
Read a truth value from one byte.