ObjFW  Diff

Differences From Artifact [b1e5dbc875]:

To Artifact [0c1768f337]:


316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
- append: (OFString*)str
{
	return [self appendCString: [str cString]];
}

- appendCString: (const char*)str
{
	char   *newstr;
	size_t newlen, strlength;

	strlength = strlen(str);

	switch (check_utf8(str, strlength)) {
	case 1:
		is_utf8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	newlen = length + strlength;
	newstr = [self resizeMem: string
			  toSize: newlen + 1];

	memcpy(newstr + length, str, strlength + 1);

	length = newlen;
	string = newstr;

	return self;
}

- appendWithFormatCString: (const char*)fmt, ...
{
	id ret;







<
|











<
|
<
|
|
<
|
<







316
317
318
319
320
321
322

323
324
325
326
327
328
329
330
331
332
333
334

335

336
337

338

339
340
341
342
343
344
345
- append: (OFString*)str
{
	return [self appendCString: [str cString]];
}

- appendCString: (const char*)str
{

	size_t strlength;

	strlength = strlen(str);

	switch (check_utf8(str, strlength)) {
	case 1:
		is_utf8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}


	string = [self resizeMem: string

			  toSize: length + strlength + 1];
	memcpy(string + length, str, strlength + 1);

	length += strlength;


	return self;
}

- appendWithFormatCString: (const char*)fmt, ...
{
	id ret;