ObjFW  Diff

Differences From Artifact [fdeb42d350]:

To Artifact [92f13cee04]:


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
#import "OFMalformedXMLException.h"
#import "OFString.h"
#import "OFXMLParser.h"

#import "common.h"

@implementation OFMalformedXMLException
+ (instancetype)exceptionWithClass: (Class)class_
			    parser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithClass: class_
				     parser: parser] autorelease];
}

- initWithClass: (Class)class_
	 parser: (OFXMLParser*)parser_
{
	self = [super initWithClass: class_];

	parser = [parser_ retain];

	return self;
}

- (void)dealloc
{
	[parser release];

	[super dealloc];
}

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

	if (parser != nil)
		description = [[OFString alloc] initWithFormat:
		    @"The parser in class %@ encountered malformed XML!",
		    inClass];
	else
		description = @"A parser encountered malformed XML!";

	return description;
}

- (OFXMLParser*)parser
{
	OF_GETTER(parser, NO)
}
@end







|


|



|
|

|

|






|






|
|

|
|
|
|

|

|




|


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
#import "OFMalformedXMLException.h"
#import "OFString.h"
#import "OFXMLParser.h"

#import "common.h"

@implementation OFMalformedXMLException
+ (instancetype)exceptionWithClass: (Class)class
			    parser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithClass: class
				     parser: parser] autorelease];
}

- initWithClass: (Class)class
	 parser: (OFXMLParser*)parser
{
	self = [super initWithClass: class];

	_parser = [parser retain];

	return self;
}

- (void)dealloc
{
	[_parser release];

	[super dealloc];
}

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

	if (_parser != nil)
		_description = [[OFString alloc] initWithFormat:
		    @"The XML parser in class %@ encountered malformed XML!",
		    _inClass];
	else
		_description = @"An XML parser encountered malformed XML!";

	return _description;
}

- (OFXMLParser*)parser
{
	OF_GETTER(_parser, NO)
}
@end