2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "NGMimeType.h"
25 #include <NGMime/NGMimePartParser.h>
27 @implementation NSData(DataPart)
31 - (NSEnumerator *)valuesOfHeaderFieldWithName:(NSString *)_name {
34 static NGMimeHeaderNames *Fields = NULL;
37 Fields = (NGMimeHeaderNames *)[NGMimePartParser headerFieldNames];
39 if ([_name isEqualToString:Fields->contentLength])
40 value = [NSNumber numberWithUnsignedInt:[self length]];
41 else if ([_name isEqualToString:Fields->contentType])
42 value = [self contentType];
43 else if ([_name isEqualToString:@"content-id"])
44 value = [self contentId];
45 else if ([_name isEqualToString:@"content-m5"])
46 value = [self contentMd5];
47 else if ([_name isEqualToString:@"content-language"])
48 value = [self contentLanguage];
51 return [[NSArray arrayWithObject:value] objectEnumerator];
55 - (NSEnumerator *)headerFieldNames {
59 - (void)setBody:(id)_body {
60 [self doesNotRecognizeSelector:_cmd];
68 - (NGMimeType *)contentType {
69 static NGMimeType *defType = nil;
71 defType = [[NGMimeType mimeType:@"application/octet-stream"] retain];
74 - (NSString *)contentId {
78 - (NSArray *)contentLanguage {
81 - (NSString *)contentMd5 {
84 - (NSString *)encoding {
88 @end /* NSData(DataPart) */
90 @implementation NSMutableData(DataPart)
92 - (void)setBody:(id)_body {
96 @end /* NSMutableData(DataPart) */
98 void __link_NGPart(void) {