ObjFW  Check-in [000706786e]

Overview
Comment:Better handling of text and comments in OFXMLElements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 000706786e2f186fbe9f0b603f201f64101f13881cdd2b86fc1f0f44c5081759
User & Date: js on 2010-06-13 21:34:30
Other Links: manifest | tags
Context
2010-06-16
19:38
Update PLATFORMS. check-in: 39f395427b user: js tags: trunk
2010-06-13
21:34
Better handling of text and comments in OFXMLElements. check-in: 000706786e user: js tags: trunk
17:44
Fallback to select() in OFSocketObserver if poll() is unavailable. check-in: 6a73e7ac51 user: js tags: trunk
Changes

Modified src/OFXMLElement.m from [1d13a2237c] to [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
	return self;
}

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

	@try {
		OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
		text = [[text_ stringByXMLEscaping] retain];
		[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: @"-->"];
	} @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];

	if (comment != nil)






		return [[comment retain] autorelease];


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

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







<
<
|
<
<
<
<
<








<
<
<
|
<
<
<
<

















|

|
>
>
>
>
>
>
|
>







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];



	text = [text_ copy];






	return self;
}

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




	comment = [comment_ copy];





	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 stringByXMLEscaping];

	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];