ObjFW  Diff

Differences From Artifact [3e5d86d339]:

To Artifact [d1ad9f6edf]:


14
15
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
14
15
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







+




-
+








-
+
-







 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import <Foundation/NSDictionary.h>

#import "OFNSDictionary.h"
#import "OFNSEnumerator.h"

#import "NSBridging.h"
#import "OFBridging.h"

#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"

@implementation OFNSDictionary
- (instancetype)initWithNSDictionary: (NSDictionary *)dictionary
{
	self = [super init];

	@try {
		if (dictionary == nil)
			@throw [OFInitializationFailedException
			@throw [OFInvalidArgumentException exception];
			    exceptionWithClass: self.class];

		_dictionary = [dictionary retain];
	} @catch (id e) {
		[self release];
		@throw e;
	}

65
66
67
68
69
70
71






72
65
66
67
68
69
70
71
72
73
74
75
76
77
78







+
+
+
+
+
+

	return object;
}

- (size_t)count
{
	return _dictionary.count;
}

- (OFEnumerator *)keyEnumerator
{
	return [[[OFNSEnumerator alloc]
	    initWithNSEnumerator: [_dictionary keyEnumerator]] autorelease];
}
@end