/* * Copyright (c) 2023, kleines Filmröllchen * Copyright (c) 2023, Nicolas Ramz * Copyright (c) 2023, Nico Weber * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include ErrorOr RIFF::ChunkID::read_from_stream(Stream& stream) { Array id; TRY(stream.read_until_filled(id.span())); return ChunkID { id }; } ErrorOr RIFF::OwnedList::read_from_stream(Stream& stream) { auto type = TRY(stream.read_value()); Vector chunks; while (!stream.is_eof()) TRY(chunks.try_append(TRY(stream.read_value()))); return RIFF::OwnedList { .type = type, .chunks = move(chunks) }; }