25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#import "autorelease.h"
#import "macros.h"
@implementation OFXMLAttribute
+ (instancetype)attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)value
{
return [[[self alloc] initWithName: name
namespace: ns
stringValue: value] autorelease];
}
- initWithName: (OFString*)name_
namespace: (OFString*)ns_
stringValue: (OFString*)value
{
self = [super init];
@try {
name = [name_ copy];
ns = [ns_ copy];
stringValue = [value copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#import "autorelease.h"
#import "macros.h"
@implementation OFXMLAttribute
+ (instancetype)attributeWithName: (OFString*)name
namespace: (OFString*)ns
stringValue: (OFString*)stringValue
{
return [[[self alloc] initWithName: name
namespace: ns
stringValue: stringValue] autorelease];
}
+ (instancetype)attributeWithName: (OFString*)name
stringValue: (OFString*)stringValue
{
return [[[self alloc] initWithName: name
stringValue: stringValue] autorelease];
}
- initWithName: (OFString*)name_
stringValue: (OFString*)stringValue_
{
return [self initWithName: name_
namespace: nil
stringValue: stringValue_];
}
- initWithName: (OFString*)name_
namespace: (OFString*)ns_
stringValue: (OFString*)stringValue_
{
self = [super init];
@try {
name = [name_ copy];
ns = [ns_ copy];
stringValue = [stringValue_ copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
|