ObjFW  Diff

Differences From Artifact [69097c8dd7]:

To Artifact [d870a955f7]:


233
234
235
236
237
238
239
240

241
242
243
244
245
246
247
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247







-
+







}

- (size_t)length
{
	return length;
}

- (OFString*)clone
- (id)copy
{
	return [OFString stringWithCString: string];
}

- setTo: (OFString*)str
{
	size_t len;
266
267
268
269
270
271
272










273

274



275

276
277
278
279
280
281
282
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282

283
284
285
286
287

288
289
290
291
292
293
294
295







+
+
+
+
+
+
+
+
+
+
-
+

+
+
+
-
+







	length = len;
	string = [self getMemWithSize: length + 1];
	memcpy(string, [str cString], length + 1);

	return self;
}

- (BOOL)isEqual: (id)obj
{
	if (![obj isKindOf: [OFString class]])
		return NO;
	if (strcmp(string, [obj cString]))
		return NO;

	return YES;
}

- (int)compareTo: (OFString*)str
- (int)compare: (id)obj
{
	if (![obj isKindOf: [OFString class]])
		@throw [OFInvalidArgumentException newWithClass: [self class]];

	return strcmp(string, [str cString]);
	return strcmp(string, [obj cString]);
}

- append: (OFString*)str
{
	return [self appendCString: [str cString]];
}