diff --git a/headers/os/app/Message.h b/headers/os/app/Message.h index 781c99ff5f..038d5166f3 100644 --- a/headers/os/app/Message.h +++ b/headers/os/app/Message.h @@ -63,6 +63,8 @@ class BMessage { int32 *countFound = NULL) const; status_t GetInfo(const char *name, type_code *typeFound, bool *fixedSize) const; + status_t GetInfo(const char *name, type_code *typeFound, + int32 *countFound, bool *fixedSize) const; int32 CountNames(type_code type) const; bool IsEmpty() const; diff --git a/src/kits/app/Message.cpp b/src/kits/app/Message.cpp index bf1b9df250..e99d3ee74e 100644 --- a/src/kits/app/Message.cpp +++ b/src/kits/app/Message.cpp @@ -494,6 +494,27 @@ BMessage::GetInfo(const char *name, type_code *typeFound, bool *fixedSize) } +status_t +BMessage::GetInfo(const char *name, type_code *typeFound, int32 *countFound, + bool *fixedSize) const +{ + DEBUG_FUNCTION_ENTER; + field_header *field = NULL; + status_t result = _FindField(name, B_ANY_TYPE, &field); + if (result < B_OK || field == NULL) + return result; + + if (typeFound) + *typeFound = field->type; + if (countFound) + *countFound = field->count; + if (fixedSize) + *fixedSize = (field->flags & FIELD_FLAG_FIXED_SIZE) != 0; + + return B_OK; +} + + int32 BMessage::CountNames(type_code type) const {