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

Header of one RIFF or Standard MIDI File chunk: its name, its size, and whether it is a list. More...

#include <hxchunkheader.h>

Collaboration diagram for HxChunkHeader:

Public Member Functions

 HxChunkHeader ()
 Construct an unread header named ?
 HxChunkHeader (const HxChunkName &name, int nSize, int nIsList)
 Construct a header from its three fields.
HxChunkName Name () const
 Report the chunk name by value.
HxStream & Read (HxStream &stream)
 Read the header from a stream.
void Print (std::ostream &stream)
 Write the header to a diagnostic stream as LIST: for a list, the four characters, and the size in angle brackets.

Public Attributes

HxChunkName mName
int mSize
int mIsList

Detailed Description

Header of one RIFF or Standard MIDI File chunk: its name, its size, and whether it is a list.

The class is not polymorphic and has no RTTI. Its name comes from the debugging symbols of the North American demo release. The twelve-byte size comes from the heap copies HxIListChunk and HxIDataChunk allocate. A header named LIST or RIFF is a list. Read() replaces its name with the form type in the next four bytes, marks the header as a list, and takes the four bytes out of the size.

Every member is public, because HxIListChunk, HxIDataChunk, and Mid::Reader read the fields directly and the image exposes no accessor.

Constructor & Destructor Documentation

◆ HxChunkHeader() [1/2]

HxChunkHeader::HxChunkHeader ( )
inline

Construct an unread header named ?

???.

Inline. HxIListChunk's constructors and HxIDataChunk's stream constructor expand it, copying the name from the literal at 0x007d3eb8.

◆ HxChunkHeader() [2/2]

HxChunkHeader::HxChunkHeader ( const HxChunkName & name,
int nSize,
int nIsList )
inline

Construct a header from its three fields.

Inline. HxIListChunk's stream constructor expands it for a stream with no header of its own, naming the whole stream a list.

Parameters
nameThe name.
nSizeThe size.
nIsListNon-zero for a list.

Member Function Documentation

◆ Name()

HxChunkName HxChunkHeader::Name ( ) const
inline

Report the chunk name by value.

Inline. Every comparison outside Read() compares a stack copy of the name, the temporary this accessor returns.

Returns
A copy of mName.

◆ Read()

HxStream & HxChunkHeader::Read ( HxStream & stream)

Read the header from a stream.

Reads the name raw and the size through HxStream::ReadNum(). A LIST or RIFF header then reads its form type over the name, is marked a list, and loses four bytes of size. Any other header is marked not a list.

Parameters
streamThe stream to read from.
Returns
The stream.
Ghidra address:
NTSC-U/C: 0x00145fe0
Ghidra address:
PAL: 0x00146af8

◆ Print()

void HxChunkHeader::Print ( std::ostream & stream)

Write the header to a diagnostic stream as LIST: for a list, the four characters, and the size in angle brackets.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x00145868
Ghidra address:
PAL: 0x00146380

Member Data Documentation

◆ mName

HxChunkName HxChunkHeader::mName

The chunk name, or a list's form type. +0x00

◆ mSize

int HxChunkHeader::mSize

Bytes of payload after the header. +0x04

◆ mIsList

int HxChunkHeader::mIsList

Non-zero for a LIST or RIFF header. +0x08


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