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

Stream over a C library FILE. More...

#include <filestream.h>

Inheritance diagram for Rnd::FileStream:
Collaboration diagram for Rnd::FileStream:

Public Member Functions

 FileStream (const HxStr &path, int nWrite)
 Open a file.
virtual ~FileStream ()
 Close the file.
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 C library FILE.

Its RTTI descriptor is at 0x008eefd8. It has single inheritance from Rnd::Stream at offset 0. The object is 8 bytes and its vtable is at 0x008261d8.

Every transfer goes straight to fread or fwrite with a one-byte element size, and the end and failure tests read bits 0x20 and 0x40 of the FILE flags rather than calling feof and ferror. A path that fails to open leaves the FILE null, which Fail() then reports.

Constructor & Destructor Documentation

◆ FileStream()

Rnd::FileStream::FileStream ( const HxStr & path,
int nWrite )

Open a file.

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

Parameters
pathThe file to open.
nWriteNon-zero to open for writing, which uses mode "wb" rather than "rb".
Ghidra address:
NTSC-U/C: 0x0050fe98
Ghidra address:
PAL: 0x0054f480

◆ ~FileStream()

virtual Rnd::FileStream::~FileStream ( )
virtual

Close the file.

Ghidra address:
NTSC-U/C: 0x0050ff00
Ghidra address:
PAL: 0x0054f4e8

Member Function Documentation

◆ Read()

virtual Stream & Rnd::FileStream::Read ( void * pDest,
int nSize )
virtual
Ghidra address:
NTSC-U/C: 0x0050ff60
Ghidra address:
PAL: 0x0054f548

Implements Rnd::Stream.

◆ Write()

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

Implements Rnd::Stream.

◆ Flush()

virtual Stream & Rnd::FileStream::Flush ( )
virtual
Ghidra address:
NTSC-U/C: 0x0050ffd0
Ghidra address:
PAL: 0x0054f5b8

Implements Rnd::Stream.

◆ Seek()

virtual Stream & Rnd::FileStream::Seek ( int nOffset,
int nWhence )
virtual
Ghidra address:
NTSC-U/C: 0x00510000
Ghidra address:
PAL: 0x0054f5e8

Implements Rnd::Stream.

◆ Tell()

virtual int Rnd::FileStream::Tell ( )
virtual
Ghidra address:
NTSC-U/C: 0x00510058
Ghidra address:
PAL: 0x0054f640

Implements Rnd::Stream.

◆ Eof()

virtual int Rnd::FileStream::Eof ( )
virtual
Ghidra address:
NTSC-U/C: 0x00510080
Ghidra address:
PAL: 0x0054f668

Implements Rnd::Stream.

◆ Fail()

virtual int Rnd::FileStream::Fail ( )
virtual
Ghidra address:
NTSC-U/C: 0x00510098
Ghidra address:
PAL: 0x0054f680

Implements Rnd::Stream.


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