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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "IRCChannel.h"
@implementation IRCChannel
@synthesize name;
+ channelWithName: (OFString*)name
{
return [[[self alloc] initWithName: name] autorelease];
}
- initWithName: (OFString*)name_
{
self = [super init];
@try {
name = [name_ copy];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[name release];
[super dealloc];
}
- (OFString*)description
{
return name;
}
@end
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "IRCChannel.h"
@implementation IRCChannel
@synthesize name, users;
+ channelWithName: (OFString*)name
{
return [[[self alloc] initWithName: name] autorelease];
}
- initWithName: (OFString*)name_
{
self = [super init];
@try {
name = [name_ copy];
users = [[OFMutableSet alloc] init];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[name release];
[users release];
[super dealloc];
}
- (OFString*)description
{
return name;
}
- (void)IRC_addUser: (OFString*)user
{
[users addObject: user];
}
- (void)IRC_removeUser: (OFString*)user
{
[users removeObject: user];
}
@end
|