ObjFW  Check-in [ddb15601a2]

Overview
Comment:Rename -[enumerator] to -[objectEnumerator] for consistency.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ddb15601a286ee44fb9ef1288302a1121b80c53f31328b70ebdec2890014e4bc
User & Date: js on 2010-09-05 23:23:08
Other Links: manifest | tags
Context
2010-09-05
23:33
Add OFCollection protocol. check-in: ba19e68fb6 user: js tags: trunk
23:23
Rename -[enumerator] to -[objectEnumerator] for consistency. check-in: ddb15601a2 user: js tags: trunk
23:19
Replace OFObject* with id in many places. check-in: e2b06423e0 user: js tags: trunk
Changes

Modified src/OFArray.h from [dc04fe21ab] to [a12c7e5760].

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
 * \return A string containing all objects joined by the separator
 */
- (OFString*)componentsJoinedByString: (OFString*)separator;

/**
 * \return An OFEnumerator to enumarate through the array's objects
 */
- (OFEnumerator*)enumerator;

#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each object.
 *
 * \param block The block to execute for each object
 */







|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
 * \return A string containing all objects joined by the separator
 */
- (OFString*)componentsJoinedByString: (OFString*)separator;

/**
 * \return An OFEnumerator to enumarate through the array's objects
 */
- (OFEnumerator*)objectEnumerator;

#ifdef OF_HAVE_BLOCKS
/**
 * Executes a block for each object.
 *
 * \param block The block to execute for each object
 */

Modified src/OFArray.m from [1e2bb24ba2] to [ff4f2762a1].

345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	state->state = count;
	state->itemsPtr = [array cArray];
	state->mutationsPtr = (unsigned long*)self;

	return count;
}

- (OFEnumerator*)enumerator
{
	return [[[OFArrayEnumerator alloc]
	    initWithDataArray: array
	     mutationsPointer: NULL] autorelease];
}

#ifdef OF_HAVE_BLOCKS







|







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	state->state = count;
	state->itemsPtr = [array cArray];
	state->mutationsPtr = (unsigned long*)self;

	return count;
}

- (OFEnumerator*)objectEnumerator
{
	return [[[OFArrayEnumerator alloc]
	    initWithDataArray: array
	     mutationsPointer: NULL] autorelease];
}

#ifdef OF_HAVE_BLOCKS

Modified src/OFMutableArray.m from [6ea5171a82] to [cd027f3f1d].

225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	state->state = count;
	state->itemsPtr = [array cArray];
	state->mutationsPtr = &mutations;

	return count;
}

- (OFEnumerator*)enumerator
{
	return [[[OFArrayEnumerator alloc]
	    initWithDataArray: array
	     mutationsPointer: &mutations] autorelease];
}

#ifdef OF_HAVE_BLOCKS







|







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	state->state = count;
	state->itemsPtr = [array cArray];
	state->mutationsPtr = &mutations;

	return count;
}

- (OFEnumerator*)objectEnumerator
{
	return [[[OFArrayEnumerator alloc]
	    initWithDataArray: array
	     mutationsPointer: &mutations] autorelease];
}

#ifdef OF_HAVE_BLOCKS

Modified tests/OFArrayTests.m from [f1dd14b8b5] to [8f3081b30f].

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
	    (a[1] = [OFArray arrayWithObject: @"foo"]) &&
	    [[a[1] componentsJoinedByString: @" "] isEqual: @"foo"])

	m[0] = [[a[0] mutableCopy] autorelease];
	ok = YES;
	i = 0;

	TEST(@"-[enumerator]", (enumerator = [m[0] enumerator]))

	while ((obj = [enumerator nextObject]) != nil) {
		if (![obj isEqual: c_ary[i]])
			ok = NO;
		[m[0] replaceObjectAtIndex: i
				withObject: @""];
		i++;







|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
	    (a[1] = [OFArray arrayWithObject: @"foo"]) &&
	    [[a[1] componentsJoinedByString: @" "] isEqual: @"foo"])

	m[0] = [[a[0] mutableCopy] autorelease];
	ok = YES;
	i = 0;

	TEST(@"-[objectEnumerator]", (enumerator = [m[0] objectEnumerator]))

	while ((obj = [enumerator nextObject]) != nil) {
		if (![obj isEqual: c_ary[i]])
			ok = NO;
		[m[0] replaceObjectAtIndex: i
				withObject: @""];
		i++;