-
Notifications
You must be signed in to change notification settings - Fork 7
/
properties.h
105 lines (101 loc) · 2.08 KB
/
properties.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include "visibility.h"
enum PropertyAttributeKind
{
/**
* Property has no attributes.
*/
OBJC_PR_noattr = 0x00,
/**
* The property is declared read-only.
*/
OBJC_PR_readonly = (1<<0),
/**
* The property has a getter.
*/
OBJC_PR_getter = (1<<1),
/**
* The property has assign semantics.
*/
OBJC_PR_assign = (1<<2),
/**
* The property is declared read-write.
*/
OBJC_PR_readwrite = (1<<3),
/**
* Property has retain semantics.
*/
OBJC_PR_retain = (1<<4),
/**
* Property has copy semantics.
*/
OBJC_PR_copy = (1<<5),
/**
* Property is marked as non-atomic.
*/
OBJC_PR_nonatomic = (1<<6),
/**
* Property has setter.
*/
OBJC_PR_setter = (1<<7)
};
/**
* Structure used for property enumeration. Note that property enumeration is
* currently quite broken on OS X, so achieving full compatibility there is
* impossible. Instead, we strive to achieve compatibility with the
* documentation.
*/
struct objc_property
{
/**
* Name of this property.
*/
const char *name;
/**
* Attributes for this property. Made by ORing together
* PropertyAttributeKinds.
*/
char attributes;
/**
* Flag set if the property is synthesized.
*/
const char isSynthesized;
/**
* Name of the getter for this property.
*/
const char *getter_name;
/**
* Type encoding for the get method for this property.
*/
const char *getter_types;
/**
* Name of the set method for this property.
*/
const char *setter_name;
/**
* Type encoding of the setter for this property.
*/
const char *setter_types;
};
/**
* List of property inrospection data.
*/
struct objc_property_list
{
/**
* Number of properties in this array.
*/
int count;
/*
* The next property in a linked list.
*/
struct objc_property_list *next;
/**
* List of properties.
*/
struct objc_property properties[];
};
/**
* Constructs a property description from a list of attributes.
*/
PRIVATE struct objc_property propertyFromAttrs(const objc_property_attribute_t *attributes,
unsigned int attributeCount);