resonance 1.0.1
Loading...
Searching...
No Matches
hxidatachunk.h
Go to the documentation of this file.
1#pragma once
2
3#include "stream/hxstream.h"
4
5class HxIListChunk;
6class HxChunkHeader;
7
19class HxIDataChunk : public HxStream {
20public:
31 explicit HxIDataChunk(HxIListChunk *pReader);
32
41 explicit HxIDataChunk(HxStream *pSource);
42
49 ~HxIDataChunk() override;
50
61 void SetMarker(int nOffset, int nWhence) override;
62
71 int GetMarker() override;
72
80 int Size() override;
81
94 HxStream &ReadData(void *pDest, int nSize) override;
95
104
105private:
106 HxIListChunk *mReader; // Reader to unlock on destruction, or null.
107 HxStream *mSource; // Stream the payload lies in.
108 HxChunkHeader *mId; // Heap copy of the chunk header.
109 int mStart; // Source position of the first payload byte.
110 int mEnd; // Source position after the last payload byte.
111};
Header of one RIFF or Standard MIDI File chunk: its name, its size, and whether it is a list.
Definition hxchunkheader.h:21
HxIDataChunk(HxStream *pSource)
Read a chunk header at a stream's read position and open that chunk.
~HxIDataChunk() override
Unlock the reader, if any, and free the header.
int GetMarker() override
Report the read position within the payload.
HxIDataChunk(HxIListChunk *pReader)
Open the current chunk of a reader, and lock the reader.
HxStream & ReadData(void *pDest, int nSize) override
Move up to nSize bytes of the payload into pDest.
HxStream * UnderlyingStream() override
Report the stream the payload lies in.
int Size() override
Report the payload size from the chunk header.
void SetMarker(int nOffset, int nWhence) override
Move the read position within the payload.
Cursor over the chunks inside one RIFF list or Standard MIDI File.
Definition hxilistchunk.h:19
HxStream()
Construct a stream with a zeroed state.