ObjFW  Diff

Differences From Artifact [28440d417d]:

To Artifact [ac132aa128]:


125
126
127
128
129
130
131
132

133
134
135
136
137

138
139
140
141
142
143
144
145


146
147
148
149
150
151
152
153


154
155
156
157
158
159
160
161
162



163
164
165
166
167
168
169
125
126
127
128
129
130
131

132
133
134
135
136

137
138
139
140
141
142
143


144
145
146
147
148
149
150
151


152
153
154
155
156
157
158
159



160
161
162
163
164
165
166
167
168
169







-
+




-
+






-
-
+
+






-
-
+
+






-
-
-
+
+
+







#ifdef OF_HAVE_FILES
+ (instancetype)elementWithFile: (OFString *)path
{
	return [[[self alloc] initWithFile: path] autorelease];
}
#endif

- init
- (instancetype)init
{
	OF_INVALID_INIT_METHOD
}

- initWithName: (OFString *)name
- (instancetype)initWithName: (OFString *)name
{
	return [self initWithName: name
			namespace: nil
		      stringValue: nil];
}

- initWithName: (OFString *)name
   stringValue: (OFString *)stringValue
- (instancetype)initWithName: (OFString *)name
		 stringValue: (OFString *)stringValue
{
	return [self initWithName: name
			namespace: nil
		      stringValue: stringValue];
}

- initWithName: (OFString *)name
     namespace: (OFString *)namespace
- (instancetype)initWithName: (OFString *)name
		   namespace: (OFString *)namespace
{
	return [self initWithName: name
			namespace: namespace
		      stringValue: nil];
}

- initWithName: (OFString *)name
     namespace: (OFString *)namespace
   stringValue: (OFString *)stringValue
- (instancetype)initWithName: (OFString *)name
		   namespace: (OFString *)namespace
		 stringValue: (OFString *)stringValue
{
	self = [super of_init];

	@try {
		if (name == nil)
			@throw [OFInvalidArgumentException exception];

181
182
183
184
185
186
187
188

189
190
191
192
193
194
195
181
182
183
184
185
186
187

188
189
190
191
192
193
194
195







-
+







		[self release];
		@throw e;
	}

	return self;
}

- initWithElement: (OFXMLElement *)element
- (instancetype)initWithElement: (OFXMLElement *)element
{
	self = [super of_init];

	@try {
		if (element == nil)
			@throw [OFInvalidArgumentException exception];

203
204
205
206
207
208
209
210

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

210
211
212
213
214
215
216
217







-
+







		[self release];
		@throw e;
	}

	return self;
}

- initWithXMLString: (OFString *)string
- (instancetype)initWithXMLString: (OFString *)string
{
	void *pool;
	OFXMLParser *parser;
	OFXMLElementBuilder *builder;
	OFXMLElement_OFXMLElementBuilderDelegate *delegate;

	[self release];
238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
238
239
240
241
242
243
244

245
246
247
248
249
250
251
252







-
+








	objc_autoreleasePoolPop(pool);

	return self;
}

#ifdef OF_HAVE_FILES
- initWithFile: (OFString *)path
- (instancetype)initWithFile: (OFString *)path
{
	void *pool;
	OFXMLParser *parser;
	OFXMLElementBuilder *builder;
	OFXMLElement_OFXMLElementBuilderDelegate *delegate;

	[self release];
270
271
272
273
274
275
276
277

278
279
280
281
282
283
284
270
271
272
273
274
275
276

277
278
279
280
281
282
283
284







-
+








	objc_autoreleasePoolPop(pool);

	return self;
}
#endif

- initWithSerialization: (OFXMLElement *)element
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
	self = [super of_init];

	@try {
		void *pool = objc_autoreleasePoolPush();
		OFXMLElement *attributesElement, *namespacesElement;
		OFXMLElement *childrenElement;
1073
1074
1075
1076
1077
1078
1079
1080

1081
1082
1083
1084
1073
1074
1075
1076
1077
1078
1079

1080
1081
1082
1083
1084







-
+




	OF_HASH_ADD_HASH(hash, [_children hash]);

	OF_HASH_FINALIZE(hash);

	return hash;
}

- copy
- (id)copy
{
	return [[[self class] alloc] initWithElement: self];
}
@end