From e20dc8a7b7be013af204c9deaa3d7bef6f65943d Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 22 Jun 2009 21:43:06 +0000 Subject: [PATCH] Added missing convenience methods for unsigned integers. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31187 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/app/Message.h | 26 +++++++++++++++++++++++++- src/kits/app/Message.cpp | 6 +++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/headers/os/app/Message.h b/headers/os/app/Message.h index 2dd19e277f..895ef5511a 100644 --- a/headers/os/app/Message.h +++ b/headers/os/app/Message.h @@ -86,7 +86,7 @@ class BMessage { bigtime_t timeout = B_INFINITE_TIMEOUT); status_t SendReply(BMessage *reply, BMessenger replyTo, bigtime_t timeout = B_INFINITE_TIMEOUT); - + status_t SendReply(uint32 command, BMessage *replyToReply); status_t SendReply(BMessage *the_reply, BMessage *replyToReply, bigtime_t sendTimeout = B_INFINITE_TIMEOUT, @@ -119,9 +119,13 @@ class BMessage { status_t AddString(const char *name, const char *aString); status_t AddString(const char *name, const BString &aString); status_t AddInt8(const char *name, int8 value); + status_t AddUInt8(const char *name, uint8 value); status_t AddInt16(const char *name, int16 value); + status_t AddUInt16(const char *name, uint16 value); status_t AddInt32(const char *name, int32 value); + status_t AddUInt32(const char *name, uint32 value); status_t AddInt64(const char *name, int64 value); + status_t AddUInt64(const char *name, uint64 value); status_t AddBool(const char *name, bool aBoolean); status_t AddFloat(const char *name, float aFloat); status_t AddDouble(const char *name, double aDouble); @@ -151,12 +155,20 @@ class BMessage { status_t FindString(const char *name, int32 index, BString *string) const; status_t FindInt8(const char *name, int8 *value) const; status_t FindInt8(const char *name, int32 index, int8 *value) const; + status_t FindUInt8(const char *name, uint8 *value) const; + status_t FindUInt8(const char *name, int32 index, uint8 *value) const; status_t FindInt16(const char *name, int16 *value) const; status_t FindInt16(const char *name, int32 index, int16 *value) const; + status_t FindUInt16(const char *name, uint16 *value) const; + status_t FindUInt16(const char *name, int32 index, uint16 *value) const; status_t FindInt32(const char *name, int32 *value) const; status_t FindInt32(const char *name, int32 index, int32 *value) const; + status_t FindUInt32(const char *name, uint32 *value) const; + status_t FindUInt32(const char *name, int32 index, uint32 *value) const; status_t FindInt64(const char *name, int64 *value) const; status_t FindInt64(const char *name, int32 index, int64 *value) const; + status_t FindUInt64(const char *name, uint64 *value) const; + status_t FindUInt64(const char *name, int32 index, uint64 *value) const; status_t FindBool(const char *name, bool *value) const; status_t FindBool(const char *name, int32 index, bool *value) const; status_t FindFloat(const char *name, float *value) const; @@ -189,12 +201,20 @@ class BMessage { status_t ReplaceString(const char *name, int32 index, const BString &aString); status_t ReplaceInt8(const char *name, int8 value); status_t ReplaceInt8(const char *name, int32 index, int8 value); + status_t ReplaceUInt8(const char *name, uint8 value); + status_t ReplaceUInt8(const char *name, int32 index, uint8 value); status_t ReplaceInt16(const char *name, int16 value); status_t ReplaceInt16(const char *name, int32 index, int16 value); + status_t ReplaceUInt16(const char *name, uint16 value); + status_t ReplaceUInt16(const char *name, int32 index, uint16 value); status_t ReplaceInt32(const char *name, int32 value); status_t ReplaceInt32(const char *name, int32 index, int32 value); + status_t ReplaceUInt32(const char *name, uint32 value); + status_t ReplaceUInt32(const char *name, int32 index, uint32 value); status_t ReplaceInt64(const char *name, int64 value); status_t ReplaceInt64(const char *name, int32 index, int64 value); + status_t ReplaceUInt64(const char *name, uint64 value); + status_t ReplaceUInt64(const char *name, int32 index, uint64 value); status_t ReplaceBool(const char *name, bool aBoolean); status_t ReplaceBool(const char *name, int32 index, bool aBoolean); status_t ReplaceFloat(const char *name, float aFloat); @@ -229,9 +249,13 @@ class BMessage { bool HasPoint(const char *, int32 n = 0) const; bool HasString(const char *, int32 n = 0) const; bool HasInt8(const char *, int32 n = 0) const; + bool HasUInt8(const char *, int32 n = 0) const; bool HasInt16(const char *, int32 n = 0) const; + bool HasUInt16(const char *, int32 n = 0) const; bool HasInt32(const char *, int32 n = 0) const; + bool HasUInt32(const char *, int32 n = 0) const; bool HasInt64(const char *, int32 n = 0) const; + bool HasUInt64(const char *, int32 n = 0) const; bool HasBool(const char *, int32 n = 0) const; bool HasFloat(const char *, int32 n = 0) const; bool HasDouble(const char *, int32 n = 0) const; diff --git a/src/kits/app/Message.cpp b/src/kits/app/Message.cpp index 6933a70bfe..93470d93fe 100644 --- a/src/kits/app/Message.cpp +++ b/src/kits/app/Message.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008, Haiku Inc. All rights reserved. + * Copyright 2005-2009, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -2325,9 +2325,13 @@ BMessage::Has##typeName(const char *name, int32 index) const \ DEFINE_FUNCTIONS(BPoint, Point, B_POINT_TYPE); DEFINE_FUNCTIONS(BRect, Rect, B_RECT_TYPE); DEFINE_FUNCTIONS(int8, Int8, B_INT8_TYPE); +DEFINE_FUNCTIONS(uint8, UInt8, B_UINT8_TYPE); DEFINE_FUNCTIONS(int16, Int16, B_INT16_TYPE); +DEFINE_FUNCTIONS(uint16, UInt16, B_UINT16_TYPE); DEFINE_FUNCTIONS(int32, Int32, B_INT32_TYPE); +DEFINE_FUNCTIONS(uint32, UInt32, B_UINT32_TYPE); DEFINE_FUNCTIONS(int64, Int64, B_INT64_TYPE); +DEFINE_FUNCTIONS(uint64, UInt64, B_UINT64_TYPE); DEFINE_FUNCTIONS(bool, Bool, B_BOOL_TYPE); DEFINE_FUNCTIONS(float, Float, B_FLOAT_TYPE); DEFINE_FUNCTIONS(double, Double, B_DOUBLE_TYPE);