ObjFW  Diff

Differences From Artifact [5a68e86a25]:

To Artifact [d4c54a82d9]:


19
20
21
22
23
24
25

26


27
28
29
30
31
32
33
#define OF_SET_HASHTABLE_M

#import "OFSet_hashtable.h"
#import "OFMutableDictionary_hashtable.h"
#import "OFArray.h"
#import "OFString.h"
#import "OFNumber.h"

#import "OFAutoreleasePool.h"



@implementation OFSet_hashtable
- init
{
	self = [super init];

	@try {







>

>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#define OF_SET_HASHTABLE_M

#import "OFSet_hashtable.h"
#import "OFMutableDictionary_hashtable.h"
#import "OFArray.h"
#import "OFString.h"
#import "OFNumber.h"
#import "OFXMLElement.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"

@implementation OFSet_hashtable
- init
{
	self = [super init];

	@try {
106
107
108
109
110
111
112











































113
114
115
116
117
118
119
				forKey: firstObject
			       copyKey: NO];

		while ((object = va_arg(arguments, id)) != nil)
			[dictionary _setObject: one
					forKey: object
				       copyKey: NO];












































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








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
				forKey: firstObject
			       copyKey: NO];

		while ((object = va_arg(arguments, id)) != nil)
			[dictionary _setObject: one
					forKey: object
				       copyKey: NO];

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

	return self;
}

- initWithSerialization: (OFXMLElement*)element
{
	self = [self init];

	@try {
		OFAutoreleasePool *pool, *pool2;
		OFNumber *one;
		OFEnumerator *enumerator;
		OFXMLElement *child;

		pool = [[OFAutoreleasePool alloc] init];

		if ((![[element name] isEqual: @"OFSet"] &&
		    ![[element name] isEqual: @"OFMutableSet"]) ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException newWithClass: isa
							       selector: _cmd];

		one = [OFNumber numberWithSize: 1];

		enumerator = [[element children] objectEnumerator];
		pool2 = [[OFAutoreleasePool alloc] init];

		while ((child = [enumerator nextObject]) != nil) {
			if (![[child namespace] isEqual: OF_SERIALIZATION_NS])
				continue;

			[dictionary _setObject: one
					forKey: [child objectByDeserializing]
				       copyKey: NO];

			[pool2 releaseObjects];
		}

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