]> err.no Git - sope/blob - sope-core/NGExtensions/NGExtensions/NGQuotedPrintableCoding.h
fixed -isAfternoon method
[sope] / sope-core / NGExtensions / NGExtensions / NGQuotedPrintableCoding.h
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21
22 #ifndef __NGExtensions_NGQuotedPrintableCoding_H__
23 #define __NGExtensions_NGQuotedPrintableCoding_H__
24
25 #import <Foundation/NSString.h>
26 #import <Foundation/NSData.h>
27 #include <NGExtensions/NGExtensionsDecls.h>
28
29 /*
30   Quoted Printable encoder/decoder
31
32   As specified in RFC 822.
33
34   TODO: explain what it does. It doesn't seem to decode a full line like
35           "=?iso-8859-1?q?Yannick=20DAmboise?="
36         but only turns "=20D" style encodings to their charcode.
37   Note: apparently sope-mime contains a category on NSData which provides a
38         method to decode the full value:
39           -decodeQuotedPrintableValueOfMIMEHeaderField:
40         (NGMimeMessageParser)
41 */
42
43 @interface NSString(QuotedPrintableCoding)
44
45 - (NSString *)stringByDecodingQuotedPrintable;
46 - (NSString *)stringByEncodingQuotedPrintable;
47
48 @end
49
50 @interface NSData(QuotedPrintableCoding)
51
52 /*
53   Decode a quoted printable encoded data. Returns nil if decoding failed.
54 */
55 - (NSData *)dataByDecodingQuotedPrintable;
56
57 /*
58   Decode data in quoted printable encoding. Returns nil if encoding failed.
59 */
60 - (NSData *)dataByEncodingQuotedPrintable;
61
62 @end
63
64 NGExtensions_EXPORT int
65 NGEncodeQuotedPrintable(const char *_src, unsigned _srcLen,
66                         char *_dest, unsigned _destLen);
67 NGExtensions_EXPORT int
68 NGDecodeQuotedPrintable(const char *_src, unsigned _srcLen,
69                         char *_dest, unsigned _destLen);
70
71 #endif /* __NGExtensions_NGQuotedPrintableCoding_H__ */