ObjFW  Diff

Differences From Artifact [21642e8123]:

To Artifact [2c4b841ea9]:


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
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
157
158
159
160
161
162


163
164
165
166
167
168
169

170
171
172
173
174
175
176
177


178
179
180
181
182
183
184
185
186


187
188
189
190
191
192
193
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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
178

179
180
181
182
183
184
185
186
187


188
189
190
191
192
193
194
195
196







-
+






-
+







-
+









-
+









-
+







-
+






-
-
+
+







-
-
+
+









-
-
+
+









-
-
+
+







-
-
+
+









-
+










+
+






-
+







-
+
+







-
-
+
+







{
	struct of_dictionary_bucket **data;
	uint32_t size;
	size_t count;
}

/**
 * Creates a new OFDictionary.
 * \brief Creates a new OFDictionary.
 *
 * \return A new autoreleased OFDictionary
 */
+ dictionary;

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

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

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

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

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

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

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

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

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

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

/**
 * Returns the object for the given key or nil if the key was not found.
 * \brief 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!
 *
 * \param key The key whose object should be returned
 * \return The object for the given key or nil if the key was not found
 */
- (id)objectForKey: (id)key;

/**
 * \brief Returns an OFEnumerator to enumerate through the dictionary's keys.
 *
 * \return An OFEnumerator to enumerate through the dictionary's keys
 */
- (OFEnumerator*)keyEnumerator;

#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each key / object pair.
 * \brief Executes a block for each key / object pair.
 *
 * \param block The block to execute for each key / object pair.
 */
- (void)enumerateKeysAndObjectsUsingBlock:
    (of_dictionary_enumeration_block_t)block;

/**
 * Returns a new dictionary, mapping each object using the specified block.
 * \brief Returns a new dictionary, mapping each object using the specified
 *	  block.
 *
 * \param block A block which maps an object for each object
 * \return A new, autorelease OFDictionary
 */
- (OFDictionary*)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block;

/**
 * Returns a new dictionary, only containing the objects for which the block
 * returns YES.
 * \brief Returns a new dictionary, only containing the objects for which the
 *	  block returns YES.
 *
 * \param block A block which determines if the object should be in the new
 *		dictionary
 * \return A new, autoreleased OFDictionary
 */
- (OFDictionary*)filteredDictionaryUsingBlock:
    (of_dictionary_filter_block_t)block;