diff options
Diffstat (limited to 'Userland/Libraries/LibIPC')
-rw-r--r-- | Userland/Libraries/LibIPC/Dictionary.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibIPC/Dictionary.h b/Userland/Libraries/LibIPC/Dictionary.h index 437f3bffdd..9a83c03d2c 100644 --- a/Userland/Libraries/LibIPC/Dictionary.h +++ b/Userland/Libraries/LibIPC/Dictionary.h @@ -7,6 +7,7 @@ #pragma once +#include <AK/Concepts.h> #include <AK/DeprecatedString.h> #include <AK/HashMap.h> @@ -37,6 +38,14 @@ public: } } + template<FallibleFunction<DeprecatedString const&, DeprecatedString const&> Callback> + ErrorOr<void> try_for_each_entry(Callback&& callback) const + { + for (auto const& it : m_entries) + TRY(callback(it.key, it.value)); + return {}; + } + HashMap<DeprecatedString, DeprecatedString> const& entries() const { return m_entries; } private: |