1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:07:34 +00:00

LibGfx: Add fallible ICC::Profile::try_for_each_tag

Similar to 13b18a1 or d0f3f3d.
This commit is contained in:
Nico Weber 2023-02-19 07:06:27 -05:00 committed by Andreas Kling
parent 0f0694edb1
commit 8179327068

View file

@ -247,6 +247,14 @@ public:
callback(tag.key, tag.value);
}
template<FallibleFunction<TagSignature, NonnullRefPtr<TagData>> Callback>
ErrorOr<void> try_for_each_tag(Callback&& callback) const
{
for (auto const& tag : m_tag_table)
TRY(callback(tag.key, tag.value));
return {};
}
size_t tag_count() const { return m_tag_table.size(); }
// Only versions 2 and 4 are in use.