2 Copyright (C) 2005 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
22 #include "NGImap4MailboxInfo.h"
25 @implementation NGImap4MailboxInfo
27 - (id)initWithURL:(NSURL *)_url folderName:(NSString *)_name
28 selectDictionary:(NSDictionary *)_dict
30 if (_dict == nil || (_url == nil && _name == nil)) {
35 if ((self = [super init])) {
36 self->timestamp = [[NSDate alloc] init];
37 self->url = [_url copy];
38 self->name = [_name copy];
39 self->allowedFlags = [[_dict objectForKey:@"flags"] copy];
40 self->access = [[_dict objectForKey:@"access"] copy];
41 self->recent = [[_dict objectForKey:@"recent"] unsignedIntValue];
46 return [self initWithURL:nil folderName: nil selectDictionary:nil];
50 [self->timestamp release];
53 [self->allowedFlags release];
54 [self->access release];
60 - (NSDate *)timestamp {
61 return self->timestamp;
69 - (NSArray *)allowedFlags {
70 return self->allowedFlags;
72 - (NSString *)access {
75 - (unsigned int)recent {
81 - (void)appendAttributesToDescription:(NSMutableString *)_ms {
82 if (self->name) [_ms appendFormat:@" name=%@", self->name];
83 if (self->access) [_ms appendFormat:@" access=%@", self->access];
85 if (self->recent != 0) [_ms appendFormat:@" recent=%d", self->recent];
87 [_ms appendFormat:@" flags=%@",
88 [[self allowedFlags] componentsJoinedByString:@","]];
91 - (NSString *)description {
94 ms = [NSMutableString stringWithCapacity:64];
95 [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
96 [self appendAttributesToDescription:ms];
97 [ms appendString:@">"];
101 @end /* NGImap4MailboxInfo */