ObjFW  Check-in [caef9fbb2e]

Overview
Comment:Add -[setChildren:] and -[setStringValue:] to OFXMLElement.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: caef9fbb2e9c119eeacb179fa475c71cb0812725c9e3c34769a561cf46a944e8
User & Date: js on 2011-03-31 12:32:34
Other Links: manifest | tags
Context
2011-04-01
16:06
Check nfds against OPEN_MAX before calling poll. check-in: 52102a2906 user: js tags: trunk
2011-03-31
12:32
Add -[setChildren:] and -[setStringValue:] to OFXMLElement. check-in: caef9fbb2e user: js tags: trunk
12:14
Add -[stringValue] to OFXMLElement. check-in: 4e88d4192d user: js tags: trunk
Changes

Modified src/OFXMLElement.h from [1dd54e0aa6] to [11b7a22a69].

208
209
210
211
212
213
214







215
216
217
218
219







220
221
222
223
224
225
226
- (OFString*)namespace;

/**
 * \return An OFArray with the attributes of the element
 */
- (OFArray*)attributes;








/**
 * \return An array with all children of the element
 */
- (OFArray*)children;








/**
 * \return A string with the string value of all children concatenated
 */
- (OFString*)stringValue;

/**
 * \return A new autoreleased OFString representing the OFXMLElement as an







>
>
>
>
>
>
>





>
>
>
>
>
>
>







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
- (OFString*)namespace;

/**
 * \return An OFArray with the attributes of the element
 */
- (OFArray*)attributes;

/**
 * Removes all children and adds the children from the specified array.
 *
 * \param children The new children to add
 */
- (void)setChildren: (OFArray*)children;

/**
 * \return An array with all children of the element
 */
- (OFArray*)children;

/**
 * Removes all children and sets the string value to the specified string.
 *
 * \param value The new string value for the element
 */
- (void)setStringValue: (OFString*)value;

/**
 * \return A string with the string value of all children concatenated
 */
- (OFString*)stringValue;

/**
 * \return A new autoreleased OFString representing the OFXMLElement as an

Modified src/OFXMLElement.m from [7f8c49938a] to [1d2471d4ea].

255
256
257
258
259
260
261














262
263
264
265
266










267
268
269
270
271
272
273
	return [[ns copy] autorelease];
}

- (OFArray*)attributes
{
	return [[attributes copy] autorelease];
}















- (OFArray*)children
{
	return [[children copy] autorelease];
}











- (OFString*)stringValue
{
	OFAutoreleasePool *pool;
	OFMutableString *ret;
	OFXMLElement **children_c;
	size_t i, count = [children count];







>
>
>
>
>
>
>
>
>
>
>
>
>
>





>
>
>
>
>
>
>
>
>
>







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
	return [[ns copy] autorelease];
}

- (OFArray*)attributes
{
	return [[attributes copy] autorelease];
}

- (void)setChildren: (OFArray*)children_
{
	OFMutableArray *new = [children_ mutableCopy];

	@try {
		[children release];
	} @catch (id e) {
		[new release];
		@throw e;
	}

	children = new;
}

- (OFArray*)children
{
	return [[children copy] autorelease];
}

- (void)setStringValue: (OFString*)value
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

	[self setChildren: [OFArray arrayWithObject:
	    [OFXMLElement elementWithCharacters: value]]];

	[pool release];
}

- (OFString*)stringValue
{
	OFAutoreleasePool *pool;
	OFMutableString *ret;
	OFXMLElement **children_c;
	size_t i, count = [children count];