|
| | IOBPreallocMemStream (char *pBuffer, int nCapacity) |
| | Open a stream over a caller-owned buffer.
|
| virtual | ~IOBPreallocMemStream () |
| | Close the stream.
|
| virtual IBStream & | Read (void *pDest, int nSize) |
| virtual IBStream & | Seek (int nOffset, int nWhence) |
| virtual int | Tell () |
| virtual int | Eof () |
| virtual int | Fail () |
| | Test whether a transfer has failed.
|
| virtual IBStream & | Flush () |
| virtual void | SetSize (int nSize) |
| | Record how many bytes a reader may consume.
|
| virtual char * | Buffer () |
| | Report the caller-owned buffer.
|
| int | Size () |
| | Report how many bytes have been written.
|
| int | Capacity () |
| | Report the buffer size passed to the constructor.
|
| virtual OBStream & | Write (const void *pSrc, int nSize) |
| virtual OBStream & | Reset () |
| virtual IBStream & | ReadLE (void *pDest, int nSize) |
| | Move nSize bytes into pDest through the virtual Read().
|
| virtual | ~IBStream () |
| | Close the stream.
|
| virtual OBStream & | WriteLE (const void *pSrc, int nSize) |
| | Move nSize bytes out of pSrc through the virtual Write().
|
Bidirectional stream over a caller-supplied byte buffer.
Its RTTI descriptor is at 0x008ef160. The base list at 0x008242c8 records two bases, IBStream at offset 0 and OBStream at offset 4, both public and non-virtual. IOBStream shares that base list and is not in the chain. This class is therefore a sibling of IOBStream rather than a subclass, and the type function at 0x004eda70 confirms it.
The object is 0x20 bytes. Two vtable pointers occupy +0x00 and +0x04, addressing 0x00824110 for the IBStream subobject and 0x008240e0 for the OBStream subobject, whose entries adjust this by -0x04. The six data members follow at +0x08 through +0x1f.
Nothing is allocated. The constructor records the buffer and its capacity, and the destructor releases nothing, so the caller owns the storage for the life of the stream. Reads consume up to the write position rather than up to the capacity, which makes the stream a first-in first-out buffer with a separate read cursor.
The two halves report failure differently, and the difference is in the binary rather than in this reconstruction. A short read is clamped and sets both the end flag and the failure flag, while a write that would pass the capacity transfers nothing and sets only the failure flag.
Twelve call sites construct one. Globals::InitServices() allocates a stream over the 0x19000 byte log buffer at 0x0086f7d0, and eleven memory card task constructors build one over the 0xf000 byte buffer at 0x008f2aa0. The memory card tasks embed the stream as a member and destroy it inline.
| char* IOBPreallocMemStream::mBuffer |
Caller-owned byte buffer, which the constructor records and the destructor does not release.
Public because three memory card task constructors load it directly out of the embedded stream immediately after constructing it, at 0x0017e5c8 in ListRemixesMCT, 0x0017bed0 in LoadRemixMCT, and 0x0017cee4 in DeleteRemixMCT. Each one is a plain word load at offset 8 with no dispatch through Buffer(), and none of the three derives from this class.
Two further readings fit the image equally well. A friend declaration per task class gives the same instructions. And a devirtualised inline Buffer() call would also compile to the one load, which is why the promotion is recorded as an inference rather than as a measurement.
+0x08