From a2f6e5ac9c3f022f1c2afb29e6cc616e08d3adca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 12 Nov 2012 23:48:45 +0100 Subject: [PATCH] Added missing BMessage::{Get|Set}String() methods. * Forgot to add those before accidentally. --- headers/os/app/Message.h | 3 +++ src/kits/app/Message.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/headers/os/app/Message.h b/headers/os/app/Message.h index c4c72dfc00..bb3a74d671 100644 --- a/headers/os/app/Message.h +++ b/headers/os/app/Message.h @@ -475,6 +475,9 @@ public: status_t SetInt64(const char* name, int64 value); status_t SetUInt64(const char* name, uint64 value); status_t SetPointer(const char* name, const void* value); + status_t SetString(const char* name, const char* string); + status_t SetString(const char* name, + const BString& string); status_t SetFloat(const char* name, float value); status_t SetDouble(const char* name, double value); status_t SetAlignment(const char* name, diff --git a/src/kits/app/Message.cpp b/src/kits/app/Message.cpp index 09bf7e4d91..36db0779ad 100644 --- a/src/kits/app/Message.cpp +++ b/src/kits/app/Message.cpp @@ -2564,6 +2564,7 @@ DEFINE_SET_GET_FUNCTIONS(uint64, UInt64, B_UINT64_TYPE); DEFINE_SET_GET_FUNCTIONS(bool, Bool, B_BOOL_TYPE); DEFINE_SET_GET_FUNCTIONS(float, Float, B_FLOAT_TYPE); DEFINE_SET_GET_FUNCTIONS(double, Double, B_DOUBLE_TYPE); +DEFINE_SET_GET_FUNCTIONS(const char *, String, B_STRING_TYPE); #undef DEFINE_SET_GET_FUNCTION @@ -3135,6 +3136,13 @@ BMessage::HasFlat(const char *name, int32 index, const BFlattenable *object) } +status_t +BMessage::SetString(const char *name, const BString& value) +{ + return SetData(name, B_STRING_TYPE, value.String(), value.Length() + 1); +} + + status_t BMessage::SetData(const char* name, type_code type, const void* data, ssize_t numBytes)