2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "iCalPerson.h"
26 @implementation iCalPerson
30 [self->partStat release];
33 [self->email release];
40 - (void)setCn:(NSString *)_s {
41 ASSIGNCOPY(self->cn, _s);
47 - (void)setEmail:(NSString *)_s {
48 ASSIGNCOPY(self->email, _s);
54 - (void)setRsvp:(NSString *)_s {
55 ASSIGNCOPY(self->rsvp, _s);
61 - (void)setXuid:(NSString *)_s {
62 ASSIGNCOPY(self->xuid, _s);
68 - (void)setRole:(NSString *)_s {
69 ASSIGNCOPY(self->role, _s);
75 - (void)setPartStat:(NSString *)_s {
76 ASSIGNCOPY(self->partStat, _s);
78 - (NSString *)partStat {
79 return self->partStat;
86 return [[self email] hash];
90 - (BOOL)isEqual:(id)_other {
93 if([_other class] != self->isa)
95 if([_other hash] != [self hash])
97 return [self isEqualToPerson:_other];
100 - (BOOL)isEqualToPerson:(iCalPerson *)_other {
101 if(![self hasSameEmailAddress:_other])
103 if(!IS_EQUAL([self cn], [_other cn], isEqualToString:))
105 if(!IS_EQUAL([self rsvp], [_other rsvp], isEqualToString:))
107 if(!IS_EQUAL([self partStat], [_other partStat], isEqualToString:))
109 if(!IS_EQUAL([self role], [_other role], isEqualToString:))
111 if(!IS_EQUAL([self xuid], [_other xuid], isEqualToString:))
116 - (BOOL)hasSameEmailAddress:(iCalPerson *)_other {
117 return IS_EQUAL([self email], [_other email], isEqualToString:);
122 - (NSString *)description {
125 ms = [NSMutableString stringWithCapacity:128];
126 [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
128 if (self->cn) [ms appendFormat:@" cn=%@", self->cn];
129 if (self->email) [ms appendFormat:@" email=%@", self->email];
130 if (self->role) [ms appendFormat:@" role=%@", self->role];
131 if (self->xuid) [ms appendFormat:@" uid=%@", self->xuid];
132 if (self->partStat) [ms appendFormat:@" status=%@", self->partStat];
133 if (self->rsvp) [ms appendFormat:@" rsvp=%@", self->rsvp];
135 [ms appendString:@">"];
139 @end /* iCalPerson */