resonance 1.0.1
Loading...
Searching...
No Matches
OBFileStream Class Reference

Output stream over a C library FILE. More...

#include <obfilestream.h>

Inheritance diagram for OBFileStream:
Collaboration diagram for OBFileStream:

Public Member Functions

 OBFileStream (const HxStr &path)
 Open a file for writing.
virtual OBStream & Write (const void *pSrc, int nSize)
virtual OBStream & Reset ()
virtual int Fail ()
virtual ~OBFileStream ()
 Close the file.
virtual int Tell ()
 Report the write position.
Public Member Functions inherited from OBStream
virtual OBStream & WriteLE (const void *pSrc, int nSize)
 Move nSize bytes out of pSrc through the virtual Write().

Detailed Description

Output stream over a C library FILE.

Its RTTI descriptor is at 0x00901bd0. It has single inheritance from OBStream at offset 0. The type function is at 0x004ed900. The object is 8 bytes. Its vtable at 0x00824208 runs to slot

  1. One call site constructs one.

Two slots are added beyond OBStream's four, in the order the declarations below give. The destructor is one of them, because OBStream declares none, so a stream of this class destroyed through an OBStream * never closes its file.

Every transfer goes to fwrite with a one-byte element size, and the failure test reads bit 0x40 of the FILE flags rather than calling ferror. Reset() does nothing, and in particular does not flush.

Constructor & Destructor Documentation

◆ OBFileStream()

OBFileStream::OBFileStream ( const HxStr & path)

Open a file for writing.

An empty path arrives at fopen as the program-wide empty string rather than as null.

Parameters
pathThe file to open.
Ghidra address:
NTSC-U/C: 0x004edee0
Ghidra address:
PAL: 0x0052ca88

◆ ~OBFileStream()

virtual OBFileStream::~OBFileStream ( )
virtual

Close the file.

Vtable slot 5, the first virtual this class adds.

Ghidra address:
NTSC-U/C: 0x004edf30
Ghidra address:
PAL: 0x0052cad8

Member Function Documentation

◆ Write()

virtual OBStream & OBFileStream::Write ( const void * pSrc,
int nSize )
virtual
Ghidra address:
NTSC-U/C: 0x004edf88
Ghidra address:
PAL: 0x0052cb30

Implements OBStream.

◆ Reset()

virtual OBStream & OBFileStream::Reset ( )
virtual
Ghidra address:
NTSC-U/C: 0x004edfc0
Ghidra address:
PAL: 0x0052cb68

Implements OBStream.

◆ Fail()

virtual int OBFileStream::Fail ( )
virtual
Ghidra address:
NTSC-U/C: 0x004edff0
Ghidra address:
PAL: 0x0052cb98

Implements OBStream.

◆ Tell()

virtual int OBFileStream::Tell ( )
virtual

Report the write position.

Vtable slot 6, the second virtual this class adds. OBStream has no such slot, which is why this one is new rather than an override.

Returns
The position in bytes from the start of the file.
Ghidra address:
NTSC-U/C: 0x004edfc8
Ghidra address:
PAL: 0x0052cb70

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