resonance 1.0.1
Loading...
Searching...
No Matches
iobpreallocmemstream.h
Go to the documentation of this file.
1#pragma once
2
3#include "stream/ibstream.h"
4#include "stream/obstream.h"
5
32class IOBPreallocMemStream : public IBStream, public OBStream {
33public:
42 IOBPreallocMemStream(char *pBuffer, int nCapacity);
43
53
58 virtual IBStream &Read(void *pDest, int nSize);
59
64 virtual IBStream &Seek(int nOffset, int nWhence);
65
70 virtual int Tell();
71
76 virtual int Eof();
77
89 virtual int Fail();
90
95 virtual IBStream &Flush();
96
107 virtual void SetSize(int nSize);
108
120 virtual char *Buffer();
121
132 int Size();
133
143 int Capacity();
144
149 virtual OBStream &Write(const void *pSrc, int nSize);
150
155 virtual OBStream &Reset();
156
172 char *mBuffer;
173
174private:
175 int mCapacity;
176 int mWritePos;
177 int mReadPos;
178 int mEof;
179 int mFail;
180};
181
182// The address below is the out-of-line copy.
183// NTSC-U/C: 0x004edb68, PAL: 0x0052c710
185 return mWritePos;
186}
Input half of the byte stream interface.
Definition ibstream.h:36
virtual int Tell()
IOBPreallocMemStream(char *pBuffer, int nCapacity)
Open a stream over a caller-owned buffer.
int Size()
Report how many bytes have been written.
Definition iobpreallocmemstream.h:184
char * mBuffer
Caller-owned byte buffer, which the constructor records and the destructor does not release.
Definition iobpreallocmemstream.h:172
virtual IBStream & Read(void *pDest, int nSize)
virtual int Fail()
Test whether a transfer has failed.
int Capacity()
Report the buffer size passed to the constructor.
virtual OBStream & Reset()
virtual IBStream & Flush()
virtual OBStream & Write(const void *pSrc, int nSize)
virtual IBStream & Seek(int nOffset, int nWhence)
virtual int Eof()
virtual char * Buffer()
Report the caller-owned buffer.
virtual ~IOBPreallocMemStream()
Close the stream.
virtual void SetSize(int nSize)
Record how many bytes a reader may consume.
Output half of the byte stream interface.
Definition obstream.h:25