ObjFW  Diff

Differences From Artifact [a9943514ef]:

To Artifact [d45226b27d]:


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#import "OFString.h"
#import "OFArray.h"
#import "OFFile.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "macros.h"

#import "asprintf.h"
#import "unicode.h"

extern const uint16_t of_iso_8859_15[256];
extern const uint16_t of_windows_1252[256];

/* References for static linking */
void _references_to_categories_of_OFString()







|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#import "OFString.h"
#import "OFArray.h"
#import "OFFile.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "macros.h"

#import "of_asprintf.h"
#import "unicode.h"

extern const uint16_t of_iso_8859_15[256];
extern const uint16_t of_windows_1252[256];

/* References for static linking */
void _references_to_categories_of_OFString()
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481

482
483
484
485
486
487
488
489
490
491

- initWithFormat: (OFString*)fmt
       arguments: (va_list)args
{
	self = [super init];

	@try {
		int t;

		if (fmt == nil)
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		if ((t = vasprintf(&string, [fmt cString], args)) == -1)
			/*
			 * This is only the most likely error to happen.
			 * Unfortunately, there is no good way to check what
			 * really happened.
			 */
			@throw [OFOutOfMemoryException newWithClass: isa];


		@try {
			length = t;

			switch (of_string_check_utf8(string, length)) {
			case 1:
				isUTF8 = YES;
				break;
			case -1:
				@throw [OFInvalidEncodingException







|





|
<
<
<
<
<
|
>


|







462
463
464
465
466
467
468
469
470
471
472
473
474
475





476
477
478
479
480
481
482
483
484
485
486
487

- initWithFormat: (OFString*)fmt
       arguments: (va_list)args
{
	self = [super init];

	@try {
		int len;

		if (fmt == nil)
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		if ((len = of_vasprintf(&string, [fmt cString], args)) == -1)





			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		@try {
			length = len;

			switch (of_string_check_utf8(string, length)) {
			case 1:
				isUTF8 = YES;
				break;
			case -1:
				@throw [OFInvalidEncodingException