ObjFW  Diff

Differences From Artifact [0296655a87]:

To Artifact [c9b26460ed]:


284
285
286
287
288
289
290

























291
292
293
294
295
296
297
	char *p = string + length;

	if (is_utf8)
		@throw [OFInvalidEncodingException newWithClass: isa];

	while (--p >= string)
		*p = tolower((int)*p);


























	return self;
}

- replaceOccurrencesOfString: (OFString*)str
		  withString: (OFString*)repl
{







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
	char *p = string + length;

	if (is_utf8)
		@throw [OFInvalidEncodingException newWithClass: isa];

	while (--p >= string)
		*p = tolower((int)*p);

	return self;
}

- removeCharactersFromIndex: (size_t)start
		    toIndex: (size_t)end
{
	if (start > end)
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	if (end > length)
		@throw [OFOutOfRangeException newWithClass: isa];

	memmove(string + start, string + end, length - end);
	length -= end - start;
	string[length] = 0;

	@try {
		string = [self resizeMemory: string
				     toSize: length + 1];
	} @catch (OFOutOfMemoryException *e) {
		/* We don't really care, as we only made it smaller */
		[e dealloc];
	}

	return self;
}

- replaceOccurrencesOfString: (OFString*)str
		  withString: (OFString*)repl
{