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

Go to the source code of this file.

Classes

class  OBStream
 Output half of the byte stream interface. More...

Functions

OBStream & operator<< (OBStream &stream, int bValue)
 Write a truth value as one byte.
OBStream & operator<< (OBStream &stream, long nValue)
 Write a 64-bit integer as its low four bytes.
OBStream & operator<< (OBStream &stream, unsigned long nValue)
 Write an unsigned 64-bit integer as its low four bytes.

Function Documentation

◆ operator<<() [1/3]

OBStream & operator<< ( OBStream & stream,
int bValue )

Write a truth value as one byte.

The routine stores the low byte of its argument to the stack and moves a single byte through Write(). Its counterpart reads the byte back and stores a four-byte word. The value is therefore one byte on the wire and four bytes in memory. Whether the original declared the parameter as an int or as a bool of the four-byte width some builds of this compiler used cannot be settled from the transfer alone, and int is written here to match the width of the store.

Parameters
streamThe stream to write to.
bValueThe value, of which only the low byte reaches the stream.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x004edc80
Ghidra address:
PAL: 0x0052c828

◆ operator<<() [2/3]

OBStream & operator<< ( OBStream & stream,
long nValue )

Write a 64-bit integer as its low four bytes.

The routine truncates the register to 32 bits with a sign extension and moves four bytes through WriteLE(). No call site remains in the shipped program.

Parameters
streamThe stream to write to.
nValueThe value, of which only the low four bytes reach the stream.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x004edcb8
Ghidra address:
PAL: 0x0052c860

◆ operator<<() [3/3]

OBStream & operator<< ( OBStream & stream,
unsigned long nValue )

Write an unsigned 64-bit integer as its low four bytes.

The body is byte-identical to the long writer, because narrowing either signedness to 32 bits compiles the same way. The unsigned identity is inferred from the reader pairing. IBStream has a long reader and an unsigned long reader side by side, and this routine follows the long writer in the same unit, where a second emission of one non-inline routine cannot occur. PhraseDatabase::Save() is the one caller.

Parameters
streamThe stream to write to.
nValueThe value, of which only the low four bytes reach the stream.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x004edcf8
Ghidra address:
PAL: 0x0052c8a0