ObjFW  Diff

Differences From Artifact [1d13a2237c]:

To Artifact [9fef639632]:


112
113
114
115
116
117
118
119
120
121

122
123
124
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
170
112
113
114
115
116
117
118



119





120
121
122
123
124
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







-
-
-
+
-
-
-
-
-








-
-
-
-
+
-
-
-
-

















-
+

-
-
+
+
+
+
+
+
+
+
+







	return self;
}

- initWithText: (OFString*)text_
{
	self = [super init];

	@try {
		OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
		text = [[text_ stringByXMLEscaping] retain];
	text = [text_ copy];
		[pool release];
	} @catch (OFException *e) {
		[self dealloc];
		@throw e;
	}

	return self;
}

- initWithComment: (OFString*)comment_
{
	self = [super init];

	@try {
		comment = [[OFMutableString alloc] initWithString: @"<!--"];
		[comment appendString: comment_];
		[comment appendString: @"-->"];
	comment = [comment_ copy];
	} @catch (OFException *e) {
		[self dealloc];
		@throw e;
	}

	return self;
}

- (OFString*)_stringWithParentNamespaces: (OFDictionary*)parent_namespaces
		  parentDefaultNamespace: (OFString*)parent_default_ns
{
	OFAutoreleasePool *pool, *pool2;
	char *str_c;
	size_t len, i, j, attrs_count;
	OFString *prefix = nil;
	OFXMLAttribute **attrs_carray;
	OFString *ret, *tmp;
	OFMutableDictionary *all_namespaces;
	OFString *def_ns;

	if (text != nil)
		return [[text retain] autorelease];
		return [text stringByXMLEscaping];

	if (comment != nil)
		return [[comment retain] autorelease];
	if (comment != nil) {
		OFMutableString *str;

		str = [OFMutableString stringWithString: @"<!--"];
		[str appendString: comment];
		[str appendString: @"-->"];

		return str;
	}

	pool = [[OFAutoreleasePool alloc] init];
	def_ns = (defaultNamespace != nil
	    ? defaultNamespace : parent_default_ns);

	if (parent_namespaces != nil) {
		OFEnumerator *key_enum = [namespaces keyEnumerator];