From 0778e1477dc3080ab2f40cb8159324eb88696779 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 7 Feb 2012 17:08:12 +0100 Subject: [PATCH] Add application iteration method. --- src/servers/keystore/Keyring.cpp | 24 ++++++++++++++++++++++++ src/servers/keystore/Keyring.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/src/servers/keystore/Keyring.cpp b/src/servers/keystore/Keyring.cpp index f6f5f2e18c..ed227ab647 100644 --- a/src/servers/keystore/Keyring.cpp +++ b/src/servers/keystore/Keyring.cpp @@ -103,6 +103,30 @@ Keyring::KeyMessage() const } +status_t +Keyring::GetNextApplication(uint32& cookie, BString& signature, + BString& path) +{ + char* nameFound = NULL; + status_t result = fApplications.GetInfo(B_MESSAGE_TYPE, cookie++, + &nameFound, NULL); + if (result != B_OK) + return B_ENTRY_NOT_FOUND; + + BMessage appMessage; + result = fApplications.FindMessage(nameFound, &appMessage); + if (result != B_OK) + return B_ENTRY_NOT_FOUND; + + result = appMessage.FindString("path", &path); + if (result != B_OK) + return B_ERROR; + + signature = nameFound; + return B_OK; +} + + status_t Keyring::FindApplication(const char* signature, const char* path, BMessage& appMessage) diff --git a/src/servers/keystore/Keyring.h b/src/servers/keystore/Keyring.h index 0c75263aa2..b5381f29f5 100644 --- a/src/servers/keystore/Keyring.h +++ b/src/servers/keystore/Keyring.h @@ -25,6 +25,8 @@ public: bool IsAccessible() const; const BMessage& KeyMessage() const; + status_t GetNextApplication(uint32& cookie, + BString& signature, BString& path); status_t FindApplication(const char* signature, const char* path, BMessage& appMessage); status_t AddApplication(const char* signature,