ObjFW  Check-in [566996e9a6]

Overview
Comment:Throw an exception if parsing did not finish in +[elementWithString:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 566996e9a632bd4777e1bff55956c63bd28d29e74075ee1213265ae5821561c5
User & Date: js on 2011-03-31 02:20:38
Other Links: manifest | tags
Context
2011-03-31
11:44
Get rid of useless -[bindDefaultNamespace:] in OFXMLElement. check-in: 1824567235 user: js tags: trunk
02:20
Throw an exception if parsing did not finish in +[elementWithString:]. check-in: 566996e9a6 user: js tags: trunk
00:51
Add -[elementForName] to OFXMLElement. check-in: 00c9e85bdc user: js tags: trunk
Changes

Modified src/OFXMLElement.m from [d25bc67d7d] to [5b1a6ebbe9].

25
26
27
28
29
30
31

32
33
34
35
36
37
38
#import "OFDictionary.h"
#import "OFXMLAttribute.h"
#import "OFXMLParser.h"
#import "OFXMLElementBuilder.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"

#import "OFNotImplementedException.h"
#import "OFUnboundNamespaceException.h"

@interface OFXMLElement_OFXMLElementBuilderDelegate: OFObject
{
@public
	OFXMLElement *element;







>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#import "OFDictionary.h"
#import "OFXMLAttribute.h"
#import "OFXMLParser.h"
#import "OFXMLElementBuilder.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"
#import "OFMalformedXMLException.h"
#import "OFNotImplementedException.h"
#import "OFUnboundNamespaceException.h"

@interface OFXMLElement_OFXMLElementBuilderDelegate: OFObject
{
@public
	OFXMLElement *element;
223
224
225
226
227
228
229




230
231
232
233
234
235
236
	delegate = [[[OFXMLElement_OFXMLElementBuilderDelegate alloc] init]
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseString: str];





	self = [delegate->element retain];

	@try {
		[pool release];
	} @catch (id e) {
		[self release];







>
>
>
>







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
	delegate = [[[OFXMLElement_OFXMLElementBuilderDelegate alloc] init]
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseString: str];

	if (![parser finishedParsing])
		@throw [OFMalformedXMLException newWithClass: isa
						      parser: parser];

	self = [delegate->element retain];

	@try {
		[pool release];
	} @catch (id e) {
		[self release];