19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#import "OFXMLAttribute.h"
#import "OFString.h"
#import "OFDictionary.h"
#import "OFXMLElement.h"
#import "OFAutoreleasePool.h"
#import "OFInvalidArgumentException.h"
@implementation OFXMLAttribute
+ attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value
{
return [[[self alloc] initWithName: name
|
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#import "OFXMLAttribute.h"
#import "OFString.h"
#import "OFDictionary.h"
#import "OFXMLElement.h"
#import "OFAutoreleasePool.h"
#import "OFInvalidArgumentException.h"
#import "macros.h"
@implementation OFXMLAttribute
+ attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value
{
return [[[self alloc] initWithName: name
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
if (otherAttribute->ns != ns && ![otherAttribute->ns isEqual: ns])
return NO;
if (![otherAttribute->stringValue isEqual: stringValue])
return NO;
return YES;
}
- (OFXMLElement*)XMLElementBySerializing
{
OFAutoreleasePool *pool;
OFXMLElement *element;
element = [OFXMLElement elementWithName: @"object"
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
|
if (otherAttribute->ns != ns && ![otherAttribute->ns isEqual: ns])
return NO;
if (![otherAttribute->stringValue isEqual: stringValue])
return NO;
return YES;
}
- (uint32_t)hash
{
uint32_t hash;
OF_HASH_INIT(hash);
OF_HASH_ADD_INT32(hash, [name hash]);
OF_HASH_ADD_INT32(hash, [ns hash]);
OF_HASH_ADD_INT32(hash, [stringValue hash]);
OF_HASH_FINALIZE(hash);
return hash;
}
- (OFXMLElement*)XMLElementBySerializing
{
OFAutoreleasePool *pool;
OFXMLElement *element;
element = [OFXMLElement elementWithName: @"object"
|