ObjFW  Check-in [2473176537]

Overview
Comment:Add -[setName:] and -[setNamespace:] to OFXMLElement.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2473176537cd0c7381b5fb9ee411798e465badf407d8e4b597abcc1a01204028
User & Date: js on 2011-09-10 22:17:21
Other Links: manifest | tags
Context
2011-09-10
22:27
Add -[removeChild:] to OFXMLElement. check-in: 4369d4c8fb user: js tags: trunk
22:17
Add -[setName:] and -[setNamespace:] to OFXMLElement. check-in: 2473176537 user: js tags: trunk
20:35
Declare of_std{in,out,err} as OFStream. check-in: 5adb201b41 user: js tags: trunk
Changes

Modified src/OFXMLElement.h from [c82cae4634] to [8ef6e6b71a].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	OFMutableArray *children;
	OFString *characters;
	OFString *CDATA;
	OFString *comment;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *name;
@property (readonly, copy, getter=namespace) OFString *ns;
@property (copy) OFString *defaultNamespace;
@property (readonly, copy) OFArray *attributes;
@property (readonly, copy) OFArray *children;
#endif

/**
 * \param name The name for the element







|
|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	OFMutableArray *children;
	OFString *characters;
	OFString *CDATA;
	OFString *comment;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *name;
@property (copy, getter=namespace, setter=setNamespace) OFString *ns;
@property (copy) OFString *defaultNamespace;
@property (readonly, copy) OFArray *attributes;
@property (readonly, copy) OFArray *children;
#endif

/**
 * \param name The name for the element
229
230
231
232
233
234
235







236
237
238
239
240







241
242
243
244
245
246
247
 * with it.
 *
 * \param path The path to the file
 * \return An initialized OFXMLElement with the contents of the specified file
 */
- initWithFile: (OFString*)path;








/**
 * \return The name of the element
 */
- (OFString*)name;








/**
 * \return The namespace of the element
 */
- (OFString*)namespace;

/**
 * \return An OFArray with the attributes of the element







>
>
>
>
>
>
>





>
>
>
>
>
>
>







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
 * with it.
 *
 * \param path The path to the file
 * \return An initialized OFXMLElement with the contents of the specified file
 */
- initWithFile: (OFString*)path;

/**
 * Sets the name of the element.
 *
 * \param name The new name
 */
- (void)setName: (OFString*)name;

/**
 * \return The name of the element
 */
- (OFString*)name;

/**
 * Sets the namespace of the element.
 *
 * \param ns The new namespace
 */
- (void)setNamespace: (OFString*)ns;

/**
 * \return The namespace of the element
 */
- (OFString*)namespace;

/**
 * \return An OFArray with the attributes of the element

Modified src/OFXMLElement.m from [77eb90df4f] to [3000b0638d].

386
387
388
389
390
391
392









393
394
395
396
397









398
399
400
401
402
403
404
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}










- (OFString*)name
{
	return [[name copy] autorelease];
}










- (OFString*)namespace
{
	return [[ns copy] autorelease];
}

- (OFArray*)attributes







>
>
>
>
>
>
>
>
>





>
>
>
>
>
>
>
>
>







386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)setName: (OFString*)name_
{
	if (name == nil)
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	OF_SETTER(name, name_, YES, YES)
}

- (OFString*)name
{
	return [[name copy] autorelease];
}

- (void)setNamespace: (OFString*)ns_
{
	if (name == nil)
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	OF_SETTER(ns, ns_, YES, YES)
}

- (OFString*)namespace
{
	return [[ns copy] autorelease];
}

- (OFArray*)attributes