/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2006 SKYRIX Software AG
+ Copyright (C) 2006 Helge Hess
This file is part of SOPE.
NSString *separator;
BOOL isEndOfStream;
- IMP readByte;
+ int (*readByte)(id, SEL);
}
+ (id)readerForMBox:(NSString *)_path;
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2006 SKYRIX Software AG
+ Copyright (C) 2006 Helge Hess
This file is part of SOPE.
self->readByte =
[self->source respondsToSelector:@selector(methodForSelector:)]
- ? [(NSObject *)self->source methodForSelector:@selector(readByte)]
+ ? (int(*)(id, SEL))[(NSObject *)self->source
+ methodForSelector:@selector(readByte)]
: NULL;
}
return self;
- (NSString *)description {
return [NSString stringWithFormat:@"<%@[0x%p] source=%@ endOfStream=%@",
- NSStringFromClass([self class]), (unsigned)self,
+ NSStringFromClass([self class]), self,
self->source, self->isEndOfStream ? @"YES" : @"NO"];
}
static inline int __readByte(NGMBoxReader *self) {
return (self->readByte)
- ? (int)self->readByte(self->source, @selector(readByte))
+ ? self->readByte(self->source, @selector(readByte))
: [self->source readByte];
}
_readBytes(_data, @selector(appendBytes:length:), &c, 1);
}
-@end
+@end /* NGMBoxReader */
- (NSString *)description {
return [StrClass stringWithFormat:@"<%@[0x%p]>",
- NSStringFromClass([self class]),
- (unsigned)self];
+ NSStringFromClass([self class]), self];
}
@end /* NGMailAddressParser */
return nil;
}
-// description
+/* description */
- (NSString *)description {
return [NSString stringWithFormat:@"<POP3Client[0x%p]: socket=%@>",
- (unsigned)self, [self socket]];
+ self, [self socket]];
}
-@end
+@end /* NGPop3Client */
- (NSString *)description {
return [NSString stringWithFormat:@"<Pop3Reply[0x%p]: positive=%s line=%@>",
- (unsigned)self,
+ self,
[self isPositive] ? "YES" : "NO",
[self line]];
}
- (NSString *)description {
return [NSString stringWithFormat:@"<Pop3MsgInfo[0x%p]: number=%i size=%i>",
- (unsigned)self, [self messageNumber], [self size]];
+ self, [self messageNumber], [self size]];
}
@end /* NGPop3Response */
return NO;
}
-// description
+/* description */
- (NSString *)description {
return [NSString stringWithFormat:@"<SMTP-Client[0x%p]: socket=%@>",
- (unsigned)self, [self socket]];
+ self, [self socket]];
}
-@end
+@end /* NGSmtpClient */
}
}
-// description
+/* description */
- (NSString *)description {
return [NSString stringWithFormat:
@"<MimeContentLengthHeaderFieldParser: object=0x%p>",
- (unsigned)self];
+ self];
}
@end /* NGMimeContentLengthHeaderFieldParser */
return [NGMimeType mimeType:typeString];
}
-// description
+/* description */
- (NSString *)description {
return [NSString stringWithFormat:
@"<MimeContentTypeHeaderFieldParser: object=0x%p>",
- (unsigned)self];
+ self];
}
@end /* NGMimeContentTypeHeaderFieldParser */
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2006 SKYRIX Software AG
+ Copyright (C) 2006 Helge Hess
This file is part of SOPE.
}
- (id)initWithDefaultParser:(id<NGMimeHeaderFieldParser>)_parser {
if ((self = [super init])) {
- self->fieldNameToParser = [[NSMutableDictionary alloc] initWithCapacity:32];
+ self->fieldNameToParser =
+ [[NSMutableDictionary alloc] initWithCapacity:32];
[self setDefaultParser:_parser];
}
return self;
[super dealloc];
}
-// accessors
+/* accessors */
- (void)setParser:(id<NGMimeHeaderFieldParser>)_parser
forField:(NSString *)_name {
[self defaultParser]];
keys = [self->fieldNameToParser keyEnumerator];
- while ((key = [keys nextObject])) {
- id value = [self->fieldNameToParser objectForKey:key];
+ while ((key = [keys nextObject]) != nil) {
+ id value;
+ value = [self->fieldNameToParser objectForKey:key];
[copy setParser:value forField:key];
}
return copy;
}
-// description
+/* description */
- (NSString *)description {
return [NSString stringWithFormat:
@"<HeaderFieldParserSet: id=0x%p map=%@ default=%@>",
- (unsigned)self, self->fieldNameToParser,
+ self, self->fieldNameToParser,
[self defaultParser]];
}
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2006 SKYRIX Software AG
+ Copyright (C) 2006 Helge Hess
This file is part of SOPE.
return [NSString stringWithFormat:
@"<MimeStringHeaderFieldParser: id=0x%p"
@" removesComments=%s>",
- (unsigned)self, self->removeComments ? "YES" : "NO"];
+ self, self->removeComments ? "YES" : "NO"];
}
@end /* NGMimeStringHeaderFieldParser */