2 * Copyright 2009-2010 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 #ifndef _PROPERTY_INFO_H
6 #define _PROPERTY_INFO_H
10 #include <Flattenable.h>
11 #include <SupportDefs.h>
12 #include <TypeConstants.h>
18 struct compound_type
{
27 struct property_info
{
30 uint32 specifiers
[10];
34 compound_type ctypes
[3];
55 class BPropertyInfo
: public BFlattenable
{
57 BPropertyInfo(property_info
* prop
= NULL
,
58 value_info
* value
= NULL
,
59 bool freeOnDelete
= false);
60 virtual ~BPropertyInfo();
62 virtual int32
FindMatch(BMessage
* msg
, int32 index
,
63 BMessage
* specifier
, int32 form
,
64 const char* prop
, void* data
= NULL
) const;
66 virtual bool IsFixedSize() const;
67 virtual type_code
TypeCode() const;
68 virtual ssize_t
FlattenedSize() const;
69 virtual status_t
Flatten(void* buffer
, ssize_t size
) const;
70 virtual bool AllowsTypeCode(type_code code
) const;
71 virtual status_t
Unflatten(type_code code
, const void* buffer
,
74 const property_info
* Properties() const;
75 const value_info
* Values() const;
76 int32
CountProperties() const;
77 int32
CountValues() const;
79 void PrintToStream() const;
82 static bool FindCommand(uint32 what
, int32 index
,
84 static bool FindSpecifier(uint32 form
, property_info
* info
);
87 virtual void _ReservedPropertyInfo1();
88 virtual void _ReservedPropertyInfo2();
89 virtual void _ReservedPropertyInfo3();
90 virtual void _ReservedPropertyInfo4();
92 BPropertyInfo(const BPropertyInfo
& other
);
93 BPropertyInfo
& operator=(const BPropertyInfo
& other
);
96 property_info
* fPropInfo
;
97 value_info
* fValueInfo
;
105 #endif /* _PROPERTY_INFO_H */