diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-riff.cpp | 13 | ||||
| -rw-r--r-- | source/core/slang-riff.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/source/core/slang-riff.cpp b/source/core/slang-riff.cpp index 3a3722bb8..2e633f2e7 100644 --- a/source/core/slang-riff.cpp +++ b/source/core/slang-riff.cpp @@ -535,6 +535,19 @@ RiffContainer::Chunk* RiffContainer::ListChunk::findContained(FourCC fourCC) con return nullptr; } +void RiffContainer::ListChunk::findContained(FourCC type, List<ListChunk*>& out) +{ + Chunk* chunk = m_containedChunks; + while (chunk) + { + if (chunk->m_fourCC == type && chunk->m_kind == Chunk::Kind::List) + { + out.add(static_cast<ListChunk*>(chunk)); + } + chunk = chunk->m_next; + } +} + RiffContainer::Data* RiffContainer::ListChunk::findContainedData(FourCC type) const { Chunk* found = findContained(type); diff --git a/source/core/slang-riff.h b/source/core/slang-riff.h index 4d23e45c1..99d078625 100644 --- a/source/core/slang-riff.h +++ b/source/core/slang-riff.h @@ -245,6 +245,9 @@ public: template <typename T> T* findContainedData(FourCC type) const { return (T*)findContainedData(type, sizeof(T)); } + /// Find all contained that match the type + void findContained(FourCC type, List<ListChunk*>& out); + /// Find the list (including self) that matches subtype recursively ListChunk* findListRec(FourCC subType); |
