resonance 1.0.1
Loading...
Searching...
No Matches
ibstream.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IBStream
 Input half of the byte stream interface. More...

Enumerations

enum  StreamSeekOrigin { kStreamSeekSet = 0 , kStreamSeekCur = 1 , kStreamSeekEnd = 2 }
 Origin an IBStream::Seek() offset is measured from. More...

Functions

IBStream & operator>> (IBStream &stream, int &bValue)
 Read a truth value from one byte.
IBStream & operator>> (IBStream &stream, long &nValue)
 Read a 64-bit integer from four bytes, extending the sign.
IBStream & operator>> (IBStream &stream, unsigned long &nValue)
 Read an unsigned 64-bit integer from four bytes, extending with zeros.

Enumeration Type Documentation

◆ StreamSeekOrigin

Origin an IBStream::Seek() offset is measured from.

The three values agree with the C library, and IBFileStream::Seek() still indexes a local table to translate them. The enumeration titles are inferred, since the original spelling does not survive in the image.

Enumerator
kStreamSeekSet 

Measure from the start of the data.

kStreamSeekCur 

Measure from the read position.

kStreamSeekEnd 

Measure from the end of the data.

Function Documentation

◆ operator>>() [1/3]

IBStream & operator>> ( IBStream & stream,
int & bValue )

Read a truth value from one byte.

One byte arrives through Read() and the stored result is normalised to zero or one with an unsigned comparison against zero. The store is four bytes wide, which is what fixes the parameter's width; see the counterpart in stream/obstream.h for why the type is written as an int.

Parameters
streamThe stream to read from.
bValueReceives zero or one.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x004edb78
Ghidra address:
PAL: 0x0052c720

◆ operator>>() [2/3]

IBStream & operator>> ( IBStream & stream,
long & nValue )

Read a 64-bit integer from four bytes, extending the sign.

Four bytes arrive through ReadLE() and the full 64-bit register is stored. The routine is the reader for the operator<<(OBStream &, long) counterpart in stream/obstream.h. No call site remains in the shipped program.

Parameters
streamThe stream to read from.
nValueReceives the value.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x004edbd0
Ghidra address:
PAL: 0x0052c778

◆ operator>>() [3/3]

IBStream & operator>> ( IBStream & stream,
unsigned long & nValue )

Read an unsigned 64-bit integer from four bytes, extending with zeros.

The unsigned twin of the long reader. No call site survives in the shipped program.

Parameters
streamThe stream to read from.
nValueReceives the value.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x004edc28
Ghidra address:
PAL: 0x0052c7d0