ObjFW  Diff

Differences From Artifact [1510166b61]:

To Artifact [37f60bba81]:


16
17
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

#include "config.h"

#include <stdlib.h>

#import "OFUnboundNamespaceException.h"
#import "OFString.h"


#import "common.h"

@implementation OFUnboundNamespaceException
+ (instancetype)exceptionWithClass: (Class)class
			 namespace: (OFString*)namespace

{
	return [[[self alloc] initWithClass: class
				  namespace: namespace] autorelease];
}

+ (instancetype)exceptionWithClass: (Class)class
			    prefix: (OFString*)prefix
{
	return [[[self alloc] initWithClass: class
				     prefix: prefix] autorelease];
}

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

	abort();
}

- initWithClass: (Class)class
      namespace: (OFString*)namespace

{
	self = [super initWithClass: class];

	@try {
		_namespace = [namespace copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- initWithClass: (Class)class
	 prefix: (OFString*)prefix
{
	self = [super initWithClass: class];

	@try {
		_prefix = [prefix copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_namespace release];
	[_prefix release];

	[super dealloc];
}

- (OFString*)description
{
	if (_namespace != nil)
		return [OFString stringWithFormat:
		    @"The namespace %@ is not bound in class %@", _namespace,
		    _inClass];
	else if (_prefix != nil)
		return [OFString stringWithFormat:
		    @"The prefix %@ is not bound to any namespace in class %@",
		    _prefix, _inClass];
	else
		return [OFString stringWithFormat:
		    @"A namespace or prefix is not bound in class %@",
		    _inClass];
}

- (OFString*)namespace
{
	OF_GETTER(_namespace, false)
}

- (OFString*)prefix
{
	OF_GETTER(_prefix, false)
}
@end







>






>


|
<
<
<
<
<
<
|
















>





<
<
<
<
|
<
<
<
<
<
<
<
<
<
<











|






<
|
|
<
<
<
<
<
<
<
<
<







|

|


16
17
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
71
72
73
74
75

76
77









78
79
80
81
82
83
84
85
86
87
88
89

#include "config.h"

#include <stdlib.h>

#import "OFUnboundNamespaceException.h"
#import "OFString.h"
#import "OFXMLElement.h"

#import "common.h"

@implementation OFUnboundNamespaceException
+ (instancetype)exceptionWithClass: (Class)class
			 namespace: (OFString*)namespace
			   element: (OFXMLElement*)element
{
	return [[[self alloc] initWithClass: class
				  namespace: namespace






				    element: element] autorelease];
}

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

	abort();
}

- initWithClass: (Class)class
      namespace: (OFString*)namespace
	element: (OFXMLElement*)element
{
	self = [super initWithClass: class];

	@try {
		_namespace = [namespace copy];




		_element = [element retain];










	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_namespace release];
	[_element release];

	[super dealloc];
}

- (OFString*)description
{

	return [OFString stringWithFormat:
	    @"The namespace %@ is not bound in class %@", _namespace, _inClass];









}

- (OFString*)namespace
{
	OF_GETTER(_namespace, false)
}

- (OFXMLElement*)element
{
	OF_GETTER(_element, false)
}
@end