ObjFW  Diff

Differences From Artifact [c2b4bc6b4c]:

To Artifact [477577db36]:


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

#include <stdlib.h>

#import "OFInvalidJSONException.h"
#import "OFString.h"

@implementation OFInvalidJSONException
+ (instancetype)exceptionWithClass: (Class)class_
			      line: (size_t)line
{
	return [[[self alloc] initWithClass: class_
				       line: line] autorelease];
}

- init
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithClass: (Class)class_
	   line: (size_t)line_
{
	self = [super initWithClass: class_];

	line = line_;

	return self;
}

- (OFString*)description
{
	if (description != nil)
		return description;

	description = [[OFString alloc] initWithFormat:
	    @"The JSON representation class %@ tried to parse is invalid in "
	    @"line %zd!", inClass, line];

	return description;
}

- (size_t)line
{
	return line;
}
@end







|


|















|
|

|

|






|
|

|

|

|




|


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

#include <stdlib.h>

#import "OFInvalidJSONException.h"
#import "OFString.h"

@implementation OFInvalidJSONException
+ (instancetype)exceptionWithClass: (Class)class
			      line: (size_t)line
{
	return [[[self alloc] initWithClass: class
				       line: line] autorelease];
}

- init
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithClass: (Class)class
	   line: (size_t)line
{
	self = [super initWithClass: class];

	_line = line;

	return self;
}

- (OFString*)description
{
	if (_description != nil)
		return _description;

	_description = [[OFString alloc] initWithFormat:
	    @"The JSON representation class %@ tried to parse is invalid in "
	    @"line %zd!", _inClass, _line];

	return _description;
}

- (size_t)line
{
	return _line;
}
@end