diff options
author | Nico Weber <thakis@chromium.org> | 2023-02-19 07:06:27 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-19 23:46:36 +0100 |
commit | 81793270680680ae04dd60f270cec9e29939d5eb (patch) | |
tree | 4b33e7fb33a1be7f23a83c534f1c18493c48b470 /Userland/Libraries | |
parent | 0f0694edb1c390d980bb6a66e84d35eccddda09b (diff) | |
download | serenity-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.h | 8 |
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. |