KMIME Library
#include <kmime_codec_identity.h>
Public Member Functions | |
| ~IdentityCodec () | |
| virtual bool | decode (const char *&scursor, const char *const send, char *&dcursor, const char *const dend, bool withCRLF=false) const |
| QByteArray | decode (const QByteArray &src, bool withCRLF=false) const |
| virtual bool | encode (const char *&scursor, const char *const send, char *&dcursor, const char *const dend, bool withCRLF=false) const |
| QByteArray | encode (const QByteArray &src, bool withCRLF=false) const |
| Decoder * | makeDecoder (bool withCRLF=false) const |
| Encoder * | makeEncoder (bool withCRLF=false) const |
| int | maxDecodedSizeFor (int insize, bool withCRLF) const |
| int | maxEncodedSizeFor (int insize, bool withCRLF) const |
| Public Member Functions inherited from KMime::Codec | |
| virtual | ~Codec () |
| virtual const char * | name () const =0 |
Protected Member Functions | |
| IdentityCodec () | |
| Protected Member Functions inherited from KMime::Codec | |
| Codec () | |
Additional Inherited Members | |
| Static Public Member Functions inherited from KMime::Codec | |
| static Codec * | codecForName (const char *name) |
| static Codec * | codecForName (const QByteArray &name) |
Detailed Description
A class representing the Identify codec.
Definition at line 48 of file kmime_codec_identity.h.
Constructor & Destructor Documentation
◆ IdentityCodec()
|
inlineprotected |
Constructs the Identity codec.
Definition at line 55 of file kmime_codec_identity.h.
◆ ~IdentityCodec()
|
inline |
Destroys the codec.
Definition at line 61 of file kmime_codec_identity.h.
Member Function Documentation
◆ decode() [1/2]
|
virtual |
Convenience wrapper that can be used for small chunks of data when you can provide a large enough buffer.
The default implementation creates a Decoder and uses it.
Decodes a chunk of bytes starting at scursor and extending to send into the buffer described by dcursor and dend.
This function doesn't support chaining of blocks. The returned block cannot be added to, but you don't need to finalize it, too.
Example usage (in contains the input data):
KMime::Codec *codec = KMime::Codec::codecForName( "base64" ); kFatal( !codec ) << "no base64 codec found!?"; QByteArray out( in.size() ); // good guess for any encoding... QByteArray::Iterator iit = in.begin(); QByteArray::Iterator oit = out.begin(); if ( !codec->decode( iit, in.end(), oit, out.end() ) ) { kDebug() << "output buffer too small"; return; } kDebug() << "Size of decoded data:" << oit - out.begin();
- Parameters
-
scursor is a pointer to the start of the input buffer. send is a pointer to the end of the input buffer. dcursor is a pointer to the start of the output buffer. dend is a pointer to the end of the output buffer. withCRLF if true, make the newlines CRLF; else use LF.
- Returns
- false if the decoded data didn't fit into the output buffer; true otherwise.
Reimplemented from KMime::Codec.
Definition at line 220 of file kmime_codecs.cpp.
◆ decode() [2/2]
|
virtual |
QByteArray Codec::decode()
Reimplemented from KMime::Codec.
Definition at line 104 of file kmime_codec_identity.cpp.
◆ encode() [1/2]
|
virtual |
Convenience wrapper that can be used for small chunks of data when you can provide a large enough buffer.
The default implementation creates an Encoder and uses it.
Encodes a chunk of bytes starting at scursor and extending to send into the buffer described by dcursor and dend.
This function doesn't support chaining of blocks. The returned block cannot be added to, but you don't need to finalize it, too.
Example usage (in contains the input data):
KMime::Codec *codec = KMime::Codec::codecForName( "base64" ); kFatal( !codec ) << "no base64 codec found!?"; QByteArray out( in.size()*1.4 ); // crude maximal size of b64 encoding QByteArray::Iterator iit = in.begin(); QByteArray::Iterator oit = out.begin(); if ( !codec->encode( iit, in.end(), oit, out.end() ) ) { kDebug() << "output buffer too small"; return; } kDebug() << "Size of encoded data:" << oit - out.begin();
- Parameters
-
scursor is a pointer to the start of the input buffer. send is a pointer to the end of the input buffer. dcursor is a pointer to the start of the output buffer. dend is a pointer to the end of the output buffer. withCRLF if true, make the newlines CRLF; else use LF.
- Returns
- false if the encoded data didn't fit into the output buffer; true otherwise.
Reimplemented from KMime::Codec.
Definition at line 182 of file kmime_codecs.cpp.
◆ encode() [2/2]
|
virtual |
QByteArray Codec::encode()
Reimplemented from KMime::Codec.
Definition at line 98 of file kmime_codec_identity.cpp.
◆ makeDecoder()
|
virtual |
Implements KMime::Codec.
Definition at line 77 of file kmime_codec_identity.cpp.
◆ makeEncoder()
|
virtual |
Implements KMime::Codec.
Definition at line 72 of file kmime_codec_identity.cpp.
◆ maxDecodedSizeFor()
|
inlinevirtual |
Implements KMime::Codec.
Definition at line 95 of file kmime_codec_identity.h.
◆ maxEncodedSizeFor()
|
inlinevirtual |
Implements KMime::Codec.
Definition at line 82 of file kmime_codec_identity.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Thu Jul 24 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.