14e632511SIngo Weinhold/*
24e632511SIngo Weinhold * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
315dbca93SRene Gollent * Copyright 2011, Rene Gollent, rene@gollent.com.
44e632511SIngo Weinhold * Distributed under the terms of the MIT License.
54e632511SIngo Weinhold */
6b7c5bd63SIngo Weinhold#ifndef _VARIANT_H
7b7c5bd63SIngo Weinhold#define _VARIANT_H
84e632511SIngo Weinhold
94e632511SIngo Weinhold
1015dbca93SRene Gollent#include <Rect.h>
114e632511SIngo Weinhold#include <SupportDefs.h>
124e632511SIngo Weinhold#include <TypeConstants.h>
134e632511SIngo Weinhold
14d8c41ef3SIngo Weinhold#include <Referenceable.h>
15d8c41ef3SIngo Weinhold
164e632511SIngo Weinhold
174e632511SIngo Weinholdenum {
18d8c41ef3SIngo Weinhold	B_VARIANT_DONT_COPY_DATA		= 0x01,
19d8c41ef3SIngo Weinhold	B_VARIANT_OWNS_DATA				= 0x02,
20d8c41ef3SIngo Weinhold	B_VARIANT_REFERENCEABLE_DATA	= 0x04
214e632511SIngo Weinhold};
224e632511SIngo Weinhold
234e632511SIngo Weinhold
24be350af3SIngo Weinholdclass BMessage;
25be350af3SIngo Weinhold
26be350af3SIngo Weinhold
27b7c5bd63SIngo Weinholdclass BVariant {
284e632511SIngo Weinholdpublic:
29b7c5bd63SIngo Weinhold	inline						BVariant();
30b5d6fc71SIngo Weinhold	inline						BVariant(bool value);
31b7c5bd63SIngo Weinhold	inline						BVariant(int8 value);
32b7c5bd63SIngo Weinhold	inline						BVariant(uint8 value);
33b7c5bd63SIngo Weinhold	inline						BVariant(int16 value);
34b7c5bd63SIngo Weinhold	inline						BVariant(uint16 value);
35b7c5bd63SIngo Weinhold	inline						BVariant(int32 value);
36b7c5bd63SIngo Weinhold	inline						BVariant(uint32 value);
37b7c5bd63SIngo Weinhold	inline						BVariant(int64 value);
38b7c5bd63SIngo Weinhold	inline						BVariant(uint64 value);
39b7c5bd63SIngo Weinhold	inline						BVariant(float value);
40b7c5bd63SIngo Weinhold	inline						BVariant(double value);
4115dbca93SRene Gollent	inline						BVariant(const BRect &value);
4215dbca93SRene Gollent	inline						BVariant(float left, float top, float right,
4315dbca93SRene Gollent									float bottom);
44b7c5bd63SIngo Weinhold	inline						BVariant(const void* value);
45b7c5bd63SIngo Weinhold	inline						BVariant(const char* value,
464e632511SIngo Weinhold									uint32 flags = 0);
47d8c41ef3SIngo Weinhold	inline						BVariant(BReferenceable* value, type_code type);
48d8c41ef3SIngo Weinhold									// type must be a custom type
49b7c5bd63SIngo Weinhold	inline						BVariant(const BVariant& other);
50b7c5bd63SIngo Weinhold								~BVariant();
514e632511SIngo Weinhold
52b7c5bd63SIngo Weinhold	inline	void				SetTo(const BVariant& other);
53b5d6fc71SIngo Weinhold	inline	void				SetTo(bool value);
544e632511SIngo Weinhold	inline	void				SetTo(int8 value);
554e632511SIngo Weinhold	inline	void				SetTo(uint8 value);
564e632511SIngo Weinhold	inline	void				SetTo(int16 value);
574e632511SIngo Weinhold	inline	void				SetTo(uint16 value);
584e632511SIngo Weinhold	inline	void				SetTo(int32 value);
594e632511SIngo Weinhold	inline	void				SetTo(uint32 value);
604e632511SIngo Weinhold	inline	void				SetTo(int64 value);
614e632511SIngo Weinhold	inline	void				SetTo(uint64 value);
624e632511SIngo Weinhold	inline	void				SetTo(float value);
634e632511SIngo Weinhold	inline	void				SetTo(double value);
6415dbca93SRene Gollent	inline	void				SetTo(const BRect& value);
6515dbca93SRene Gollent	inline	void				SetTo(float left, float top, float right,
6615dbca93SRene Gollent									float bottom);
674e632511SIngo Weinhold	inline	void				SetTo(const void* value);
684e632511SIngo Weinhold	inline	void				SetTo(const char* value,
694e632511SIngo Weinhold									uint32 flags = 0);
70d8c41ef3SIngo Weinhold	inline	void				SetTo(BReferenceable* value, type_code type);
71d8c41ef3SIngo Weinhold									// type must be a custom type
72b5d6fc71SIngo Weinhold			status_t			SetToTypedData(const void* data,
73b5d6fc71SIngo Weinhold									type_code type);
744e632511SIngo Weinhold			void				Unset();
754e632511SIngo Weinhold
76b7c5bd63SIngo Weinhold	inline	BVariant&			operator=(const BVariant& other);
774e632511SIngo Weinhold
787dde9c1dSIngo Weinhold			bool				operator==(const BVariant& other) const;
797dde9c1dSIngo Weinhold	inline	bool				operator!=(const BVariant& other) const;
807dde9c1dSIngo Weinhold
81b5d6fc71SIngo Weinhold	inline	type_code			Type() const		{ return fType; }
82b5d6fc71SIngo Weinhold			size_t				Size() const;
83b5d6fc71SIngo Weinhold			const uint8*		Bytes() const;
844e632511SIngo Weinhold
857dde9c1dSIngo Weinhold	inline	bool				IsNumber() const;
867dde9c1dSIngo Weinhold	inline	bool				IsInteger(bool* _isSigned = NULL) const;
877dde9c1dSIngo Weinhold	inline	bool				IsFloat() const;
8836c16b92SIngo Weinhold									// floating point, not just float
8936c16b92SIngo Weinhold
90b5d6fc71SIngo Weinhold			bool				ToBool() const;
914e632511SIngo Weinhold			int8				ToInt8() const;
924e632511SIngo Weinhold			uint8				ToUInt8() const;
934e632511SIngo Weinhold			int16				ToInt16() const;
944e632511SIngo Weinhold			uint16				ToUInt16() const;
954e632511SIngo Weinhold			int32				ToInt32() const;
964e632511SIngo Weinhold			uint32				ToUInt32() const;
974e632511SIngo Weinhold			int64				ToInt64() const;
984e632511SIngo Weinhold			uint64				ToUInt64() const;
994e632511SIngo Weinhold			float				ToFloat() const;
1004e632511SIngo Weinhold			double				ToDouble() const;
1014e632511SIngo Weinhold			void*				ToPointer() const;
1024e632511SIngo Weinhold			const char*			ToString() const;
10315dbca93SRene Gollent			BRect				ToRect() const;
104cdcacd7fSIngo Weinhold			BReferenceable*		ToReferenceable() const;
1054e632511SIngo Weinhold
106b5d6fc71SIngo Weinhold			void				SwapEndianess();
107b5d6fc71SIngo Weinhold									// has effect only on scalar types (pointer
108b5d6fc71SIngo Weinhold									// counting as scalar, not string, though)
109b5d6fc71SIngo Weinhold
110be350af3SIngo Weinhold			status_t			AddToMessage(BMessage& message,
111be350af3SIngo Weinhold									const char* fieldName) const;
112be350af3SIngo Weinhold			status_t			SetFromMessage(const BMessage& message,
113be350af3SIngo Weinhold									const char* fieldName);
114be350af3SIngo Weinhold
115b5d6fc71SIngo Weinhold	static	size_t				SizeOfType(type_code type);
1167dde9c1dSIngo Weinhold	static	bool				TypeIsNumber(type_code type);
1177dde9c1dSIngo Weinhold	static	bool				TypeIsInteger(type_code type,
1187dde9c1dSIngo Weinhold									bool* _isSigned = NULL);
1197dde9c1dSIngo Weinhold	static	bool				TypeIsFloat(type_code type);
1203b859de2SIngo Weinhold
1214e632511SIngo Weinholdprivate:
122b7c5bd63SIngo Weinhold			void				_SetTo(const BVariant& other);
123b5d6fc71SIngo Weinhold			void				_SetTo(bool value);
1244e632511SIngo Weinhold			void				_SetTo(int8 value);
1254e632511SIngo Weinhold			void				_SetTo(uint8 value);
1264e632511SIngo Weinhold			void				_SetTo(int16 value);
1274e632511SIngo Weinhold			void				_SetTo(uint16 value);
1284e632511SIngo Weinhold			void				_SetTo(int32 value);
1294e632511SIngo Weinhold			void				_SetTo(uint32 value);
1304e632511SIngo Weinhold			void				_SetTo(int64 value);
1314e632511SIngo Weinhold			void				_SetTo(uint64 value);
1324e632511SIngo Weinhold			void				_SetTo(float value);
1334e632511SIngo Weinhold			void				_SetTo(double value);
1344e632511SIngo Weinhold			void				_SetTo(const void* value);
13515dbca93SRene Gollent			void				_SetTo(float left, float top, float right,
13615dbca93SRene Gollent									float bottom);
137b5d6fc71SIngo Weinhold			bool				_SetTo(const char* value,
1384e632511SIngo Weinhold									uint32 flags);
139d8c41ef3SIngo Weinhold			void				_SetTo(BReferenceable* value, type_code type);
1404e632511SIngo Weinhold
1414e632511SIngo Weinhold	template<typename NumberType>
1424e632511SIngo Weinhold	inline	NumberType			_ToNumber() const;
1434e632511SIngo Weinhold
1444e632511SIngo Weinholdprivate:
1454e632511SIngo Weinhold			type_code			fType;
1464e632511SIngo Weinhold			uint32				fFlags;
1474e632511SIngo Weinhold			union {
148b5d6fc71SIngo Weinhold				bool			fBool;
1494e632511SIngo Weinhold				int8			fInt8;
1504e632511SIngo Weinhold				uint8			fUInt8;
1514e632511SIngo Weinhold				int16			fInt16;
1524e632511SIngo Weinhold				uint16			fUInt16;
1534e632511SIngo Weinhold				int32			fInt32;
1544e632511SIngo Weinhold				uint32			fUInt32;
1554e632511SIngo Weinhold				int64			fInt64;
1564e632511SIngo Weinhold				uint64			fUInt64;
1574e632511SIngo Weinhold				float			fFloat;
1584e632511SIngo Weinhold				double			fDouble;
1594e632511SIngo Weinhold				void*			fPointer;
1604e632511SIngo Weinhold				char*			fString;
161d8c41ef3SIngo Weinhold				BReferenceable*	fReferenceable;
1627bf8fcfaSRene Gollent				struct {
1637bf8fcfaSRene Gollent					float		left;
1647bf8fcfaSRene Gollent					float		top;
1657bf8fcfaSRene Gollent					float		right;
1667bf8fcfaSRene Gollent					float		bottom;
1677bf8fcfaSRene Gollent				}				fRect;
1687bf8fcfaSRene Gollent				uint8			fBytes[sizeof(float) * 4];
1694e632511SIngo Weinhold			};
1704e632511SIngo Weinhold};
1714e632511SIngo Weinhold
1724e632511SIngo Weinhold
173b7c5bd63SIngo WeinholdBVariant::BVariant()
1744e632511SIngo Weinhold	:
1754e632511SIngo Weinhold	fType(0),
1764e632511SIngo Weinhold	fFlags(0)
1774e632511SIngo Weinhold{
1784e632511SIngo Weinhold}
1794e632511SIngo Weinhold
1804e632511SIngo Weinhold
181b5d6fc71SIngo WeinholdBVariant::BVariant(bool value)
182b5d6fc71SIngo Weinhold{
183b5d6fc71SIngo Weinhold	_SetTo(value);
184b5d6fc71SIngo Weinhold}
185b5d6fc71SIngo Weinhold
186b5d6fc71SIngo Weinhold
187b7c5bd63SIngo WeinholdBVariant::BVariant(int8 value)
1884e632511SIngo Weinhold{
1894e632511SIngo Weinhold	_SetTo(value);
1904e632511SIngo Weinhold}
1914e632511SIngo Weinhold
1924e632511SIngo Weinhold
193b7c5bd63SIngo WeinholdBVariant::BVariant(uint8 value)
1944e632511SIngo Weinhold{
1954e632511SIngo Weinhold	_SetTo(value);
1964e632511SIngo Weinhold}
1974e632511SIngo Weinhold
1984e632511SIngo Weinhold
199b7c5bd63SIngo WeinholdBVariant::BVariant(int16 value)
2004e632511SIngo Weinhold{
2014e632511SIngo Weinhold	_SetTo(value);
2024e632511SIngo Weinhold}
2034e632511SIngo Weinhold
2044e632511SIngo Weinhold
205b7c5bd63SIngo WeinholdBVariant::BVariant(uint16 value)
2064e632511SIngo Weinhold{
2074e632511SIngo Weinhold	_SetTo(value);
2084e632511SIngo Weinhold}
2094e632511SIngo Weinhold
2104e632511SIngo Weinhold
211b7c5bd63SIngo WeinholdBVariant::BVariant(int32 value)
2124e632511SIngo Weinhold{
2134e632511SIngo Weinhold	_SetTo(value);
2144e632511SIngo Weinhold}
2154e632511SIngo Weinhold
2164e632511SIngo Weinhold
217b7c5bd63SIngo WeinholdBVariant::BVariant(uint32 value)
2184e632511SIngo Weinhold{
2194e632511SIngo Weinhold	_SetTo(value);
2204e632511SIngo Weinhold}
2214e632511SIngo Weinhold
2224e632511SIngo Weinhold
223b7c5bd63SIngo WeinholdBVariant::BVariant(int64 value)
2244e632511SIngo Weinhold{
2254e632511SIngo Weinhold	_SetTo(value);
2264e632511SIngo Weinhold}
2274e632511SIngo Weinhold
2284e632511SIngo Weinhold
229b7c5bd63SIngo WeinholdBVariant::BVariant(uint64 value)
2304e632511SIngo Weinhold{
2314e632511SIngo Weinhold	_SetTo(value);
2324e632511SIngo Weinhold}
2334e632511SIngo Weinhold
2344e632511SIngo Weinhold
235b7c5bd63SIngo WeinholdBVariant::BVariant(float value)
2364e632511SIngo Weinhold{
2374e632511SIngo Weinhold	_SetTo(value);
2384e632511SIngo Weinhold}
2394e632511SIngo Weinhold
2404e632511SIngo Weinhold
241b7c5bd63SIngo WeinholdBVariant::BVariant(double value)
2424e632511SIngo Weinhold{
2434e632511SIngo Weinhold	_SetTo(value);
2444e632511SIngo Weinhold}
2454e632511SIngo Weinhold
2464e632511SIngo Weinhold
24715dbca93SRene GollentBVariant::BVariant(const BRect& value)
24815dbca93SRene Gollent{
2493c776efbSRene Gollent	_SetTo(value.left, value.top, value.right, value.bottom);
25015dbca93SRene Gollent}
25115dbca93SRene Gollent
25215dbca93SRene Gollent
25315dbca93SRene GollentBVariant::BVariant(float left, float top, float right, float bottom)
25415dbca93SRene Gollent{
25515dbca93SRene Gollent	_SetTo(left, top, right, bottom);
25615dbca93SRene Gollent}
25715dbca93SRene Gollent
25815dbca93SRene Gollent
259b7c5bd63SIngo WeinholdBVariant::BVariant(const void* value)
2604e632511SIngo Weinhold{
2614e632511SIngo Weinhold	_SetTo(value);
2624e632511SIngo Weinhold}
2634e632511SIngo Weinhold
2644e632511SIngo Weinhold
265b7c5bd63SIngo WeinholdBVariant::BVariant(const char* value, uint32 flags)
2664e632511SIngo Weinhold{
2674e632511SIngo Weinhold	_SetTo(value, flags);
2684e632511SIngo Weinhold}
2694e632511SIngo Weinhold
2704e632511SIngo Weinhold
271d8c41ef3SIngo WeinholdBVariant::BVariant(BReferenceable* value, type_code type)
272d8c41ef3SIngo Weinhold{
273d8c41ef3SIngo Weinhold	_SetTo(value, type);
274d8c41ef3SIngo Weinhold}
275d8c41ef3SIngo Weinhold
276d8c41ef3SIngo Weinhold
277b7c5bd63SIngo WeinholdBVariant::BVariant(const BVariant& other)
2784e632511SIngo Weinhold{
2794e632511SIngo Weinhold	_SetTo(other);
2804e632511SIngo Weinhold}
2814e632511SIngo Weinhold
2824e632511SIngo Weinhold
283b7c5bd63SIngo WeinholdBVariant&
284b7c5bd63SIngo WeinholdBVariant::operator=(const BVariant& other)
2854e632511SIngo Weinhold{
2864e632511SIngo Weinhold	Unset();
2874e632511SIngo Weinhold	_SetTo(other);
2884e632511SIngo Weinhold	return *this;
2894e632511SIngo Weinhold}
2904e632511SIngo Weinhold
2914e632511SIngo Weinhold
2927dde9c1dSIngo Weinholdbool
2937dde9c1dSIngo WeinholdBVariant::operator!=(const BVariant& other) const
2947dde9c1dSIngo Weinhold{
2957dde9c1dSIngo Weinhold	return !(*this == other);
2967dde9c1dSIngo Weinhold}
2977dde9c1dSIngo Weinhold
2987dde9c1dSIngo Weinhold
2994e632511SIngo Weinholdvoid
300b7c5bd63SIngo WeinholdBVariant::SetTo(const BVariant& other)
3014e632511SIngo Weinhold{
3024e632511SIngo Weinhold	Unset();
3034e632511SIngo Weinhold	_SetTo(other);
3044e632511SIngo Weinhold}
3054e632511SIngo Weinhold
3064e632511SIngo Weinhold
307b5d6fc71SIngo Weinholdvoid
308b5d6fc71SIngo WeinholdBVariant::SetTo(bool value)
309b5d6fc71SIngo Weinhold{
310b5d6fc71SIngo Weinhold	Unset();
311b5d6fc71SIngo Weinhold	_SetTo(value);
312b5d6fc71SIngo Weinhold}
313b5d6fc71SIngo Weinhold
314b5d6fc71SIngo Weinhold
3154e632511SIngo Weinholdvoid
316b7c5bd63SIngo WeinholdBVariant::SetTo(int8 value)
3174e632511SIngo Weinhold{
3184e632511SIngo Weinhold	Unset();
3194e632511SIngo Weinhold	_SetTo(value);
3204e632511SIngo Weinhold}
3214e632511SIngo Weinhold
3224e632511SIngo Weinhold
3234e632511SIngo Weinholdvoid
324b7c5bd63SIngo WeinholdBVariant::SetTo(uint8 value)
3254e632511SIngo Weinhold{
3264e632511SIngo Weinhold	Unset();
3274e632511SIngo Weinhold	_SetTo(value);
3284e632511SIngo Weinhold}
3294e632511SIngo Weinhold
3304e632511SIngo Weinhold
3314e632511SIngo Weinholdvoid
332b7c5bd63SIngo WeinholdBVariant::SetTo(int16 value)
3334e632511SIngo Weinhold{
3344e632511SIngo Weinhold	Unset();
3354e632511SIngo Weinhold	_SetTo(value);
3364e632511SIngo Weinhold}
3374e632511SIngo Weinhold
3384e632511SIngo Weinhold
3394e632511SIngo Weinholdvoid
340b7c5bd63SIngo WeinholdBVariant::SetTo(uint16 value)
3414e632511SIngo Weinhold{
3424e632511SIngo Weinhold	Unset();
3434e632511SIngo Weinhold	_SetTo(value);
3444e632511SIngo Weinhold}
3454e632511SIngo Weinhold
3464e632511SIngo Weinhold
3474e632511SIngo Weinholdvoid
348b7c5bd63SIngo WeinholdBVariant::SetTo(int32 value)
3494e632511SIngo Weinhold{
3504e632511SIngo Weinhold	Unset();
3514e632511SIngo Weinhold	_SetTo(value);
3524e632511SIngo Weinhold}
3534e632511SIngo Weinhold
3544e632511SIngo Weinhold
3554e632511SIngo Weinholdvoid
356b7c5bd63SIngo WeinholdBVariant::SetTo(uint32 value)
3574e632511SIngo Weinhold{
3584e632511SIngo Weinhold	Unset();
3594e632511SIngo Weinhold	_SetTo(value);
3604e632511SIngo Weinhold}
3614e632511SIngo Weinhold
3624e632511SIngo Weinhold
3634e632511SIngo Weinholdvoid
364b7c5bd63SIngo WeinholdBVariant::SetTo(int64 value)
3654e632511SIngo Weinhold{
3664e632511SIngo Weinhold	Unset();
3674e632511SIngo Weinhold	_SetTo(value);
3684e632511SIngo Weinhold}
3694e632511SIngo Weinhold
3704e632511SIngo Weinhold
3714e632511SIngo Weinholdvoid
372b7c5bd63SIngo WeinholdBVariant::SetTo(uint64 value)
3734e632511SIngo Weinhold{
3744e632511SIngo Weinhold	Unset();
3754e632511SIngo Weinhold	_SetTo(value);
3764e632511SIngo Weinhold}
3774e632511SIngo Weinhold
3784e632511SIngo Weinhold
3794e632511SIngo Weinholdvoid
380b7c5bd63SIngo WeinholdBVariant::SetTo(float value)
3814e632511SIngo Weinhold{
3824e632511SIngo Weinhold	Unset();
3834e632511SIngo Weinhold	_SetTo(value);
3844e632511SIngo Weinhold}
3854e632511SIngo Weinhold
3864e632511SIngo Weinhold
3874e632511SIngo Weinholdvoid
388b7c5bd63SIngo WeinholdBVariant::SetTo(double value)
3894e632511SIngo Weinhold{
3904e632511SIngo Weinhold	Unset();
3914e632511SIngo Weinhold	_SetTo(value);
3924e632511SIngo Weinhold}
3934e632511SIngo Weinhold
3944e632511SIngo Weinhold
39515dbca93SRene Gollentvoid
39615dbca93SRene GollentBVariant::SetTo(const BRect& value)
39715dbca93SRene Gollent{
39815dbca93SRene Gollent	Unset();
39915dbca93SRene Gollent	_SetTo(value.left, value.top, value.right, value.bottom);
40015dbca93SRene Gollent}
40115dbca93SRene Gollent
40215dbca93SRene Gollent
40315dbca93SRene Gollentvoid
40415dbca93SRene GollentBVariant::SetTo(float left, float top, float right, float bottom)
40515dbca93SRene Gollent{
40615dbca93SRene Gollent	Unset();
40715dbca93SRene Gollent	_SetTo(left, top, right, bottom);
40815dbca93SRene Gollent}
40915dbca93SRene Gollent
41015dbca93SRene Gollent
4114e632511SIngo Weinholdvoid
412b7c5bd63SIngo WeinholdBVariant::SetTo(const void* value)
4134e632511SIngo Weinhold{
4144e632511SIngo Weinhold	Unset();
4154e632511SIngo Weinhold	_SetTo(value);
4164e632511SIngo Weinhold}
4174e632511SIngo Weinhold
4184e632511SIngo Weinhold
4194e632511SIngo Weinholdvoid
420b7c5bd63SIngo WeinholdBVariant::SetTo(const char* value, uint32 flags)
4214e632511SIngo Weinhold{
4224e632511SIngo Weinhold	Unset();
4234e632511SIngo Weinhold	_SetTo(value, flags);
4244e632511SIngo Weinhold}
4254e632511SIngo Weinhold
4264e632511SIngo Weinhold
427d8c41ef3SIngo Weinholdvoid
428d8c41ef3SIngo WeinholdBVariant::SetTo(BReferenceable* value, type_code type)
429d8c41ef3SIngo Weinhold{
430d8c41ef3SIngo Weinhold	Unset();
431d8c41ef3SIngo Weinhold	_SetTo(value, type);
432d8c41ef3SIngo Weinhold}
433d8c41ef3SIngo Weinhold
434d8c41ef3SIngo Weinhold
4357dde9c1dSIngo Weinholdbool
4367dde9c1dSIngo WeinholdBVariant::IsNumber() const
4377dde9c1dSIngo Weinhold{
4387dde9c1dSIngo Weinhold	return TypeIsNumber(fType);
4397dde9c1dSIngo Weinhold}
4407dde9c1dSIngo Weinhold
4417dde9c1dSIngo Weinhold
4427dde9c1dSIngo Weinholdbool
4437dde9c1dSIngo WeinholdBVariant::IsInteger(bool* _isSigned) const
4447dde9c1dSIngo Weinhold{
4457dde9c1dSIngo Weinhold	return TypeIsInteger(fType, _isSigned);
4467dde9c1dSIngo Weinhold}
4477dde9c1dSIngo Weinhold
4487dde9c1dSIngo Weinhold
4497dde9c1dSIngo Weinholdbool
4507dde9c1dSIngo WeinholdBVariant::IsFloat() const
4517dde9c1dSIngo Weinhold{
4527dde9c1dSIngo Weinhold	return TypeIsFloat(fType);
4537dde9c1dSIngo Weinhold}
4547dde9c1dSIngo Weinhold
4557dde9c1dSIngo Weinhold
456b7c5bd63SIngo Weinhold#endif	// _VARIANT_H
457