Add application iteration method.

This commit is contained in:
Michael Lotz
2013-03-05 11:04:24 -05:00
committed by Ryan Leavengood
parent cfa8131526
commit 0778e1477d
2 changed files with 26 additions and 0 deletions
+24
View File
@@ -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)
+2
View File
@@ -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,