29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
+
+
|
#import <ObjFW/OFOutOfMemoryException.h>
#import <ObjFW/macros.h>
#import "IRCUser.h"
@implementation IRCUser
@synthesize username = _username, nickname = _nickname, hostname = _hostname;
+ (instancetype)IRCUserWithString: (OFString*)string
{
return [[[self alloc] initWithString: string] autorelease];
}
- initWithString: (OFString*)string
{
|
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
107
108
109
110
111
112
113
|
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
[_nickname release];
[_username release];
[_hostname release];
[super dealloc];
}
- (OFString*)username
{
OF_GETTER(_username, true)
}
- (OFString*)nickname
{
OF_GETTER(_nickname, true)
}
- (OFString*)hostname
{
OF_GETTER(_hostname, true)
}
- copy
{
return [self retain];
}
- (OFString*)description
{
return [OFString stringWithFormat: @"%@!%@@%@",
_nickname, _username, _hostname];
}
@end
|