-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATAddrSpec.m
More file actions
79 lines (61 loc) · 1.21 KB
/
ATAddrSpec.m
File metadata and controls
79 lines (61 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
71
72
73
74
75
76
77
78
79
//
// ATAddrSpec.m
// ATMail
//
// Created by ‚“c@–¾Žj on 06/04/09.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
#import "ATAddrSpec.h"
@implementation ATAddrSpec
- (id)initWith:(NSString *)aLocalPart with:(NSString *)aDomain
{
[super init];
[self setLocalPart:aLocalPart];
[self setDomain:aDomain];
return self;
}
- (void)dealloc
{
[self setLocalPart:nil];
[self setDomain:nil];
[super dealloc];
}
- (void)encodeWithCoder:(NSCoder*)coder
{
[coder encodeObject:localPart forKey:@"localPart"];
[coder encodeObject:domain forKey:@"domain"];
}
- (id)initWithCoder:(NSCoder*)decoder
{
self = [super init];
[self setLocalPart:[decoder decodeObjectForKey:@"localPart"]];
[self setDomain:[decoder decodeObjectForKey:@"domain"]];
return self;
}
- (void)setLocalPart:(NSString *)aLocalPart
{
[localPart release];
localPart = [aLocalPart copy];
}
- (NSString *)localPart
{
return localPart;
}
- (void)setDomain:(NSString *)aDomain
{
[domain release];
domain = [aDomain copy];
}
- (NSString *)domain
{
return domain;
}
- (NSString *)value
{
return [NSString stringWithFormat:@"%@@%@", [self localPart], [self domain]];
}
- (NSString *)stringValue
{
return [self value];
}
@end