ObjFW  Diff

Differences From Artifact [ec25f9d317]:

To Artifact [e6a40ac98c]:


19
20
21
22
23
24
25
26
27
28




29
30
31
32
33
34
35
19
20
21
22
23
24
25



26
27
28
29
30
31
32
33
34
35
36







-
-
-
+
+
+
+







#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"

@class OFArray;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_dictionary_enumeration_block_t)(id key, id obj, BOOL *stop);
typedef BOOL (^of_dictionary_filter_block_t)(id key, id obj);
typedef id (^of_dictionary_map_block_t)(id key, id obj);
typedef void (^of_dictionary_enumeration_block_t)(id key, id object,
     BOOL *stop);
typedef BOOL (^of_dictionary_filter_block_t)(id key, id object);
typedef id (^of_dictionary_map_block_t)(id key, id object);
#endif

struct of_dictionary_bucket
{
	id <OFCopying> key;
	id object;
	uint32_t hash;
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
106

107
108
109
110
111
112
113

114
115
116

117
118
119
120
121
122
123
124

125
126
127

128
129
130
131
132
133
134

135
136
137

138
139
140
141
142
143
144


145
146
147
148


149
150
151
152
153
154
155
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
106

107
108
109
110
111
112
113

114
115
116

117
118
119
120
121
122
123
124

125
126
127

128
129
130
131
132
133
134

135
136
137

138
139
140
141
142
143


144
145
146
147


148
149
150
151
152
153
154
155
156







-
+


-
+





-
+


-
+






-
+


-
+





-
+


-
+












-
+


-
+






-
+


-
+







-
+


-
+






-
+


-
+





-
-
+
+


-
-
+
+







 * \return A new autoreleased OFDictionary
 */
+ dictionary;

/**
 * Creates a new OFDictionary with the specified dictionary.
 *
 * \param dict An OFDictionary
 * \param dictionary An OFDictionary
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithDictionary: (OFDictionary*)dict;
+ dictionaryWithDictionary: (OFDictionary*)dictionary;

/**
 * Creates a new OFDictionary with the specified key and object.
 *
 * \param key The key
 * \param obj The object
 * \param object The object
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithObject: (id)obj
+ dictionaryWithObject: (id)object
		forKey: (id <OFCopying>)key;

/**
 * Creates a new OFDictionary with the specified keys and objects.
 *
 * \param keys An array of keys
 * \param objs An array of objects
 * \param objects An array of objects
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithObjects: (OFArray*)objs
+ dictionaryWithObjects: (OFArray*)objects
		forKeys: (OFArray*)keys;

/**
 * Creates a new OFDictionary with the specified keys objects.
 *
 * \param key The first key
 * \param firstKey The first key
 * \return A new autoreleased OFDictionary
 */
+ dictionaryWithKeysAndObjects: (id <OFCopying>)key, ...;
+ dictionaryWithKeysAndObjects: (id <OFCopying>)firstKey, ...;

/**
 * Initializes an already allocated OFDictionary.
 *
 * \return An initialized OFDictionary
 */
- init;

/**
 * Initializes an already allocated OFDictionary with the specified
 * OFDictionary.
 *
 * \param dict An OFDictionary
 * \param dictionary An OFDictionary
 * \return An initialized OFDictionary
 */
- initWithDictionary: (OFDictionary*)dict;
- initWithDictionary: (OFDictionary*)dictionary;

/**
 * Initializes an already allocated OFDictionary with the specified key and
 * object.
 *
 * \param key The key
 * \param obj The object
 * \param object The object
 * \return A new initialized OFDictionary
 */
- initWithObject: (id)obj
- initWithObject: (id)object
	  forKey: (id <OFCopying>)key;

/**
 * Initializes an already allocated OFDictionary with the specified keys and
 * objects.
 *
 * \param keys An array of keys
 * \param objs An array of objects
 * \param objects An array of objects
 * \return A new initialized OFDictionary
 */
- initWithObjects: (OFArray*)objs
- initWithObjects: (OFArray*)objects
	  forKeys: (OFArray*)keys;

/**
 * Initializes an already allocated OFDictionary with the specified keys and
 * objects.
 *
 * \param first The first key
 * \param firstKey The first key
 * \return A new initialized OFDictionary
 */
- initWithKeysAndObjects: (id <OFCopying>)first, ...;
- initWithKeysAndObjects: (id <OFCopying>)firstKey, ...;

/**
 * Initializes an already allocated OFDictionary with the specified key and
 * va_list.
 *
 * \param first The first key
 * \param args A va_list of the other arguments
 * \param firstKey The first key
 * \param arguments A va_list of the other arguments
 * \return A new initialized OFDictionary
 */
- initWithKey: (id <OFCopying>)first
      argList: (va_list)args;
-  initWithKey: (id <OFCopying>)firstKey
  argumentList: (va_list)arguments;

/**
 * Returns the object for the given key or nil if the key was not found.
 *
 * The returned object is <i>not</i> retained and autoreleased for performance
 * reasons!
 *