resonance 1.0.1
Loading...
Searching...
No Matches
hxchunkname.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstring>
4
5class HxStream;
6
27 explicit HxChunkName(const char *pszText) {
28 memcpy(mText, pszText, kLength);
29 }
30
32 static constexpr int kLength = 4;
33
34 char mText[kLength];
35};
36
46inline bool operator==(const HxChunkName &left, const HxChunkName &right) {
47 return strncmp(left.mText, right.mText, HxChunkName::kLength) == 0;
48}
49
57inline bool operator!=(const HxChunkName &left, const HxChunkName &right) {
58 return strncmp(left.mText, right.mText, HxChunkName::kLength) != 0;
59}
60
71
79
87
95
103
111
119
127
135
143
151
159
167
175
183
Seekable data source interface, unrelated to IBStream and OBStream.
Definition hxstream.h:35
HxChunkName g_ltxtChunkName
ltxt.
HxChunkName g_lablChunkName
labl.
HxChunkName kMidiTrackChunkID
MTrk, a Standard MIDI File track chunk.
HxChunkName g_adtlChunkName
adtl.
HxChunkName kRiffChunkID
RIFF, the name of a top-level chunk.
HxStream & operator>>(HxStream &stream, HxChunkName &name)
Read a chunk name as four raw characters, with no byte swapping.
bool operator!=(const HxChunkName &left, const HxChunkName &right)
Compare two chunk names over their four characters.
Definition hxchunkname.h:57
bool operator==(const HxChunkName &left, const HxChunkName &right)
Compare two chunk names over their four characters.
Definition hxchunkname.h:46
HxChunkName g_fmtChunkName
fmt .
HxChunkName kListChunkID
LIST, the name of a list chunk.
HxChunkName g_instChunkName
inst.
HxChunkName g_cueChunkName
cue .
HxChunkName g_dataChunkName
data.
HxChunkName g_midiChunkName
MIDI.
HxChunkName kMidiHeaderChunkID
MThd, a Standard MIDI File header chunk.
HxChunkName g_factChunkName
fact.
HxChunkName g_smplChunkName
smpl.
HxChunkName g_waveChunkName
WAVE.
Four-character name of a RIFF or Standard MIDI File chunk.
Definition hxchunkname.h:19
static constexpr int kLength
Number of characters in a chunk name.
Definition hxchunkname.h:32
HxChunkName(const char *pszText)
Copy the first four characters of a literal.
Definition hxchunkname.h:27
char mText[kLength]
Definition hxchunkname.h:34