ObjFW  Check-in [a9711fd17a]

Overview
Comment:Rename +[elementBuilder] -> +[builder]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a9711fd17afa25ffd6adc72b47c2191a98772d8bf4d0f5cf50ffd4f8d9219a3c
User & Date: js on 2021-04-08 01:56:40
Other Links: manifest | tags
Context
2021-04-08
17:24
Make OFSandbox private check-in: 787a7388b7 user: js tags: trunk
17:23
Move sandboxing API to a new branch check-in: d7f3fc07ce user: js tags: sandbox
01:56
Rename +[elementBuilder] -> +[builder] check-in: a9711fd17a user: js tags: trunk
2021-04-07
22:31
Remove some leftovers from invocation check-in: 4b06ad56fd user: js tags: trunk
Changes

Modified src/OFXMLElement.m from [fe5473696c] to [a994859558].

204
205
206
207
208
209
210
211
212
213
214
215
216
217
218

	if (string == nil)
		@throw [OFInvalidArgumentException exception];

	pool = objc_autoreleasePoolPush();

	parser = [OFXMLParser parser];
	builder = [OFXMLElementBuilder elementBuilder];
	delegate = [[[OFXMLElementElementBuilderDelegate alloc] init]
	    autorelease];

	parser.delegate = builder;
	builder.delegate = delegate;

	[parser parseString: string];







|







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218

	if (string == nil)
		@throw [OFInvalidArgumentException exception];

	pool = objc_autoreleasePoolPush();

	parser = [OFXMLParser parser];
	builder = [OFXMLElementBuilder builder];
	delegate = [[[OFXMLElementElementBuilderDelegate alloc] init]
	    autorelease];

	parser.delegate = builder;
	builder.delegate = delegate;

	[parser parseString: string];
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
	OFXMLElementElementBuilderDelegate *delegate;

	[self release];

	pool = objc_autoreleasePoolPush();

	parser = [OFXMLParser parser];
	builder = [OFXMLElementBuilder elementBuilder];
	delegate = [[[OFXMLElementElementBuilderDelegate alloc] init]
	    autorelease];

	parser.delegate = builder;
	builder.delegate = delegate;

	[parser parseStream: stream];







|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
	OFXMLElementElementBuilderDelegate *delegate;

	[self release];

	pool = objc_autoreleasePoolPush();

	parser = [OFXMLParser parser];
	builder = [OFXMLElementBuilder builder];
	delegate = [[[OFXMLElementElementBuilderDelegate alloc] init]
	    autorelease];

	parser.delegate = builder;
	builder.delegate = delegate;

	[parser parseStream: stream];

Modified src/OFXMLElementBuilder.h from [702d1ff1af] to [21b424ead3].

116
117
118
119
120
121
122
123
124
125
126
    id <OFXMLElementBuilderDelegate> delegate;

/**
 * @brief Creates a new element builder.
 *
 * @return A new, autoreleased OFXMLElementBuilder
 */
+ (instancetype)elementBuilder;
@end

OF_ASSUME_NONNULL_END







|



116
117
118
119
120
121
122
123
124
125
126
    id <OFXMLElementBuilderDelegate> delegate;

/**
 * @brief Creates a new element builder.
 *
 * @return A new, autoreleased OFXMLElementBuilder
 */
+ (instancetype)builder;
@end

OF_ASSUME_NONNULL_END

Modified src/OFXMLElementBuilder.m from [fb50bb7b18] to [032a141300].

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFArray.h"

#import "OFMalformedXMLException.h"

@implementation OFXMLElementBuilder
@synthesize delegate = _delegate;

+ (instancetype)elementBuilder
{
	return [[[self alloc] init] autorelease];
}

- (instancetype)init
{
	self = [super init];







|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFArray.h"

#import "OFMalformedXMLException.h"

@implementation OFXMLElementBuilder
@synthesize delegate = _delegate;

+ (instancetype)builder
{
	return [[[self alloc] init] autorelease];
}

- (instancetype)init
{
	self = [super init];

Modified tests/OFXMLElementBuilderTests.m from [e70986486c] to [12c66175fb].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	nodes[i++] = [node retain];
}

- (void)XMLElementBuilderTests
{
	void *pool = objc_autoreleasePoolPush();
	OFXMLParser *p = [OFXMLParser parser];
	OFXMLElementBuilder *builder = [OFXMLElementBuilder elementBuilder];
	OFString *str = @"<foo>bar<![CDATA[f<oo]]>baz<qux/>"
	    " <qux xmlns:qux='urn:qux'><?asd?><qux:bar/><x qux:y='z'/></qux>"
	    "</foo>";

	p.delegate = builder;
	builder.delegate = self;








|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	nodes[i++] = [node retain];
}

- (void)XMLElementBuilderTests
{
	void *pool = objc_autoreleasePoolPush();
	OFXMLParser *p = [OFXMLParser parser];
	OFXMLElementBuilder *builder = [OFXMLElementBuilder builder];
	OFString *str = @"<foo>bar<![CDATA[f<oo]]>baz<qux/>"
	    " <qux xmlns:qux='urn:qux'><?asd?><qux:bar/><x qux:y='z'/></qux>"
	    "</foo>";

	p.delegate = builder;
	builder.delegate = self;