14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
* file.
*/
#include "config.h"
#import "OFXMLAttribute.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"
@implementation OFXMLAttribute
+ attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value
{
|
>
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
* file.
*/
#include "config.h"
#import "OFXMLAttribute.h"
#import "OFString.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"
@implementation OFXMLAttribute
+ attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value
{
|
67
68
69
70
71
72
73
74
|
return [[ns copy] autorelease];
}
- (OFString*)stringValue
{
return [[stringValue copy] autorelease];
}
@end
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
|
return [[ns copy] autorelease];
}
- (OFString*)stringValue
{
return [[stringValue copy] autorelease];
}
- (OFString*)stringBySerializing
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
OFMutableDictionary *dictionary = [OFMutableDictionary dictionary];
OFString *ret;
if (name != nil)
[dictionary setObject: name
forKey: @"name"];
if (ns != nil)
[dictionary setObject: ns
forKey: @"namespace"];
if (stringValue != nil)
[dictionary setObject: stringValue
forKey: @"stringValue"];
dictionary->isa = [OFDictionary class];
ret = [[OFString alloc]
initWithFormat: @"(class=OFXMLElement,version=0)<%@>",
[dictionary stringBySerializing]];
@try {
[pool release];
} @finally {
[ret autorelease];
}
return ret;
}
@end
|