resonance 1.0.1
Loading...
Searching...
No Matches
iobmemstream.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "stream/iobstream.h"
6
7class IBStream;
8class OBStream;
9
29class IOBMemStream : public IOBStream {
30public:
40
52 IOBMemStream(const void *pData, int nSize);
53
62 virtual ~IOBMemStream();
63
68 virtual IBStream &Read(void *pDest, int nSize);
69
74 virtual IBStream &Seek(int nOffset, int nWhence);
75
80 virtual int Tell();
81
86 virtual int Eof();
87
97 virtual int Fail();
98
103 virtual IBStream &Flush();
104
115 virtual void Fill(const void *pSrc, int nSize);
116
127 virtual void Resize(int nSize);
128
138 virtual char *Buffer();
139
150 void Compact();
151
156 virtual OBStream &Write(const void *pSrc, int nSize);
157
162 virtual OBStream &Reset();
163
164private:
165 int mEof;
166 int mFail;
167 int mPos;
168 std::vector<char> mBuffer;
169};
Input half of the byte stream interface.
Definition ibstream.h:36
virtual void Resize(int nSize)
Resize the buffer and rewind the cursor.
virtual ~IOBMemStream()
Close the stream and release the buffer.
virtual IBStream & Read(void *pDest, int nSize)
IOBMemStream(const void *pData, int nSize)
Open a stream and write an initial block into it.
IOBMemStream()
Open an empty stream.
virtual IBStream & Flush()
virtual OBStream & Reset()
virtual char * Buffer()
Report the buffer.
virtual IBStream & Seek(int nOffset, int nWhence)
void Compact()
Drop the bytes already read from the front of the buffer and rewind the cursor.
virtual int Fail()
Test whether a transfer has failed.
virtual OBStream & Write(const void *pSrc, int nSize)
virtual int Eof()
virtual void Fill(const void *pSrc, int nSize)
Grow the buffer by nSize bytes and write nSize bytes at the cursor.
virtual int Tell()
Bidirectional byte stream interface.
Definition iobstream.h:24
Output half of the byte stream interface.
Definition obstream.h:25