ObjFW  Diff

Differences From Artifact [38c430eb6b]:

To Artifact [8b7a3db643]:


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

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

#import "OFInitializationFailedException.h"

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

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







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

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

#import "OFInitializationFailedException.h"

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

	@try {
		if (dictionary == nil)
			@throw [OFInitializationFailedException
			    exceptionWithClass: [self class]];
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	return self;
}

- (id)objectForKey: (id)key
{
	id object;

	if ([(OFObject*)key conformsToProtocol: @protocol(OFBridging)])
		key = [key NSObject];

	object = [_dictionary objectForKey: key];

	if ([(NSObject*)object conformsToProtocol: @protocol(NSBridging)])
		return [object OFObject];

	return object;
}

- (size_t)count
{
	return [_dictionary count];
}
@end







|




|










42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	return self;
}

- (id)objectForKey: (id)key
{
	id object;

	if ([(OFObject *)key conformsToProtocol: @protocol(OFBridging)])
		key = [key NSObject];

	object = [_dictionary objectForKey: key];

	if ([(NSObject *)object conformsToProtocol: @protocol(NSBridging)])
		return [object OFObject];

	return object;
}

- (size_t)count
{
	return [_dictionary count];
}
@end