resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::BufStream Class Reference

Stream over a fixed buffer the caller owns. More...

#include <bufstream.h>

Inheritance diagram for Rnd::BufStream:
Collaboration diagram for Rnd::BufStream:

Public Member Functions

 BufStream (char *pBuffer, int nSize)
 Construct a stream over nSize bytes at pBuffer, positioned at the start.
virtual Stream & Read (void *pDest, int nSize)
virtual Stream & Write (const void *pSrc, int nSize)
virtual Stream & Flush ()
virtual Stream & Seek (int nOffset, int nWhence)
virtual int Tell ()
virtual int Eof ()
virtual int Fail ()
Public Member Functions inherited from Rnd::Stream
virtual Stream & ReadLE (void *pDest, int nSize)
 Move nSize bytes into pDest, correcting the byte order for the host.
virtual Stream & WriteLE (const void *pSrc, int nSize)
 Move nSize bytes out of pSrc, correcting the byte order for the file.
virtual ~Stream ()
 Close the stream.
Stream & ReadString (HxStr &name)
 Read a NUL-terminated name and append it to a string.

Detailed Description

Stream over a fixed buffer the caller owns.

Its RTTI descriptor is at 0x008ef1e0. It has single inheritance from Rnd::Stream at offset 0. The object is 0x14 bytes and its vtable is at 0x008260c0.

The buffer neither grows nor is released here. A transfer that would pass mSize is shortened to the remainder and sets mFail, so an overrun reports itself rather than corrupting memory. Slot 10 of the vtable is null, so a BufStream must not be destroyed through a Rnd::Stream pointer.

Constructor & Destructor Documentation

◆ BufStream()

Rnd::BufStream::BufStream ( char * pBuffer,
int nSize )

Construct a stream over nSize bytes at pBuffer, positioned at the start.

A null buffer starts the stream failed. RndAsyncLoader::PollAsyncLoads() builds one over each completed read.

Parameters
pBufferThe buffer, which the caller retains.
nSizeThe buffer size in bytes.
Ghidra address:
NTSC-U/C: 0x005104b8
Ghidra address:
PAL: 0x0054faa0

Member Function Documentation

◆ Read()

virtual Stream & Rnd::BufStream::Read ( void * pDest,
int nSize )
virtual
Ghidra address:
NTSC-U/C: 0x005104e0
Ghidra address:
PAL: 0x0054fac8

Implements Rnd::Stream.

◆ Write()

virtual Stream & Rnd::BufStream::Write ( const void * pSrc,
int nSize )
virtual
Ghidra address:
NTSC-U/C: 0x00510558
Ghidra address:
PAL: 0x0054fb40

Implements Rnd::Stream.

◆ Flush()

virtual Stream & Rnd::BufStream::Flush ( )
virtual
Ghidra address:
NTSC-U/C: 0x0050fe68
Ghidra address:
PAL: 0x0054f450

Implements Rnd::Stream.

◆ Seek()

virtual Stream & Rnd::BufStream::Seek ( int nOffset,
int nWhence )
virtual
Ghidra address:
NTSC-U/C: 0x005105c8
Ghidra address:
PAL: 0x0054fbb0

Implements Rnd::Stream.

◆ Tell()

virtual int Rnd::BufStream::Tell ( )
virtual
Ghidra address:
NTSC-U/C: 0x0050fe70
Ghidra address:
PAL: 0x0054f458

Implements Rnd::Stream.

◆ Eof()

virtual int Rnd::BufStream::Eof ( )
virtual
Ghidra address:
NTSC-U/C: 0x0050fe78
Ghidra address:
PAL: 0x0054f460

Implements Rnd::Stream.

◆ Fail()

virtual int Rnd::BufStream::Fail ( )
virtual
Ghidra address:
NTSC-U/C: 0x0050fe90
Ghidra address:
PAL: 0x0054f478

Implements Rnd::Stream.


The documentation for this class was generated from the following file: