summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-02-19 07:06:27 -0500
committerAndreas Kling <kling@serenityos.org>2023-02-19 23:46:36 +0100
commit81793270680680ae04dd60f270cec9e29939d5eb (patch)
tree4b33e7fb33a1be7f23a83c534f1c18493c48b470 /Userland/Libraries
parent0f0694edb1c390d980bb6a66e84d35eccddda09b (diff)
downloadserenity-81793270680680ae04dd60f270cec9e29939d5eb.zip
LibGfx: Add fallible ICC::Profile::try_for_each_tag
Similar to 13b18a1 or d0f3f3d.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGfx/ICC/Profile.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/ICC/Profile.h b/Userland/Libraries/LibGfx/ICC/Profile.h
index 8059c83d70..f4ddc6e4cc 100644
--- a/Userland/Libraries/LibGfx/ICC/Profile.h
+++ b/Userland/Libraries/LibGfx/ICC/Profile.h
@@ -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.