KMIME Library
Go to the documentation of this file.
60 #ifndef __KMIME_CODECS__
61 #define __KMIME_CODECS__
63 #include <QtCore/QByteArray>
67 #include "kmime_export.h"
71 template <
class Key,
class T>
class KAutoDeleteHash;
88 static void cleanupCodec();
101 static Codec *codecForName(
const char *name );
108 static Codec *codecForName(
const QByteArray &name );
118 virtual int maxEncodedSizeFor(
int insize,
bool withCRLF=
false )
const = 0;
128 virtual int maxDecodedSizeFor(
int insize,
bool withCRLF=
false )
const = 0;
137 virtual Encoder *makeEncoder(
bool withCRLF=
false )
const = 0;
146 virtual Decoder *makeDecoder(
bool withCRLF=
false )
const = 0;
182 virtual bool encode(
const char* &scursor,
const char *
const send,
183 char* &dcursor,
const char *
const dend,
184 bool withCRLF=
false )
const;
220 virtual bool decode(
const char* &scursor,
const char *
const send,
221 char* &dcursor,
const char *
const dend,
222 bool withCRLF=
false )
const;
234 virtual QByteArray encode(
const QByteArray &src,
bool withCRLF=
false )
const;
246 virtual QByteArray decode(
const QByteArray &src,
bool withCRLF=
false )
const;
251 virtual const char *name()
const = 0;
262 static void fillDictionary();
352 : mWithCRLF( withCRLF ) {}
369 virtual bool decode(
const char* &scursor,
const char *
const send,
370 char* &dcursor,
const char *
const dend ) = 0;
380 virtual bool finish(
char* &dcursor,
const char *
const dend ) = 0;
384 const bool mWithCRLF;
404 : mOutputBufferCursor( 0 ), mWithCRLF( withCRLF ) {}
421 virtual bool encode(
const char* &scursor,
const char *
const send,
422 char* &dcursor,
const char *
const dend ) = 0;
431 virtual bool finish(
char* &dcursor,
const char *
const dend ) = 0;
451 bool write(
char ch,
char* &dcursor,
const char *
const dend )
453 if ( dcursor != dend ) {
460 <<
"KMime::Encoder: internal buffer overflow!";
461 mOutputBuffer[ mOutputBufferCursor++ ] = ch;
485 bool writeCRLF(
char* &dcursor,
const char *
const dend )
488 write(
'\r', dcursor, dend );
490 return write(
'\n', dcursor, dend );
504 uchar mOutputBufferCursor;
505 const bool mWithCRLF;
511 #endif // __KMIME_CODECS__
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:45 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.