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
24 #include "NGMimeType.h"
26 #include <NGMime/NGMimePartParser.h>
28 @implementation NSData(DataPart)
32 - (NSEnumerator *)valuesOfHeaderFieldWithName:(NSString *)_name {
35 static NGMimeHeaderNames *Fields = NULL;
38 Fields = (NGMimeHeaderNames *)[NGMimePartParser headerFieldNames];
40 if ([_name isEqualToString:Fields->contentLength])
41 value = [NSNumber numberWithUnsignedInt:[self length]];
42 else if ([_name isEqualToString:Fields->contentType])
43 value = [self contentType];
44 else if ([_name isEqualToString:@"content-id"])
45 value = [self contentId];
46 else if ([_name isEqualToString:@"content-m5"])
47 value = [self contentMd5];
48 else if ([_name isEqualToString:@"content-language"])
49 value = [self contentLanguage];
52 return [[NSArray arrayWithObject:value] objectEnumerator];
56 - (NSEnumerator *)headerFieldNames {
60 - (void)setBody:(id)_body {
61 [self doesNotRecognizeSelector:_cmd];
69 - (NGMimeType *)contentType {
70 static NGMimeType *defType = nil;
72 defType = [[NGMimeType mimeType:@"application/octet"] retain];
75 - (NSString *)contentId {
79 - (NSArray *)contentLanguage {
82 - (NSString *)contentMd5 {
85 - (NSString *)encoding {
89 @end /* NSData(DataPart) */
91 @implementation NSMutableData(DataPart)
93 - (void)setBody:(id)_body {
97 @end /* NSMutableData(DataPart) */
99 void __link_NGPart(void) {