• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • Contact Us
 

KMIME Library

  • KMime
  • Encoder
Public Member Functions | Protected Types | Protected Member Functions
KMime::Encoder Class Reference

#include <kmime_codecs.h>

Inherited by KMime::Base64Encoder, KMime::IdentityEnDecoder, KMime::QuotedPrintableEncoder, and KMime::Rfc2047QEncodingEncoder.

List of all members.

Public Member Functions

virtual ~Encoder ()
virtual bool encode (const char *&scursor, const char *const send, char *&dcursor, const char *const dend)=0
virtual bool finish (char *&dcursor, const char *const dend)=0

Protected Types

enum  { maxBufferedChars = 8 }

Protected Member Functions

 Encoder (bool withCRLF=false)
bool flushOutputBuffer (char *&dcursor, const char *const dend)
bool write (char ch, char *&dcursor, const char *const dend)
bool writeCRLF (char *&dcursor, const char *const dend)

Detailed Description

Stateful encoder class.

Stateful encoder class, modeled after QTextEncoder.


Member Enumeration Documentation

anonymous enum [protected]

The maximum number of characters permitted in the output buffer.

Enumerator:
maxBufferedChars 

Eight.

Definition at line 437 of file kmime_codecs.h.


Constructor & Destructor Documentation

KMime::Encoder::Encoder ( bool  withCRLF = false) [inline, explicit, protected]

Protected constructor.

Use KMime::Codec::makeEncoder if you want one.

Parameters:
withCRLFif true, make the newlines CRLF; else use LF.

Definition at line 403 of file kmime_codecs.h.

virtual KMime::Encoder::~Encoder ( ) [inline, virtual]

Destroys the encoder.

Definition at line 410 of file kmime_codecs.h.


Member Function Documentation

virtual bool KMime::Encoder::encode ( const char *&  scursor,
const char *const  send,
char *&  dcursor,
const char *const  dend 
) [pure virtual]

Encodes a chunk of data, maintaining state information between calls.

See KMime::Codec for calling conventions.

Parameters:
scursoris a pointer to the start of the input buffer.
sendis a pointer to the end of the input buffer.
dcursoris a pointer to the start of the output buffer.
dendis a pointer to the end of the output buffer.
virtual bool KMime::Encoder::finish ( char *&  dcursor,
const char *const  dend 
) [pure virtual]

Call this method to finalize the output stream.

Writes all remaining data and resets the encoder. See KMime::Codec for calling conventions.

Parameters:
dcursoris a pointer to the start of the output buffer.
dendis a pointer to the end of the output buffer.
bool KMime::Encoder::flushOutputBuffer ( char *&  dcursor,
const char *const  dend 
) [protected]

Writes characters from the output buffer to the output stream.

Implementations of encode and finish should call this at the very beginning and for each iteration of the while loop.

Parameters:
dcursoris a pointer to the start of the output buffer.
dendis a pointer to the end of the output buffer.
Returns:
true if all chars could be written, false otherwise

Definition at line 214 of file kmime_codecs.cpp.

bool KMime::Encoder::write ( char  ch,
char *&  dcursor,
const char *const  dend 
) [inline, protected]

Writes character ch to the output stream or the output buffer, depending on whether or not the output stream has space left.

Parameters:
chis the character to write.
dcursoris a pointer to the start of the output buffer.
dendis a pointer to the end of the output buffer.
Returns:
true if written to the output stream; else false if buffered.

Definition at line 451 of file kmime_codecs.h.

bool KMime::Encoder::writeCRLF ( char *&  dcursor,
const char *const  dend 
) [inline, protected]

Convenience function.

Outputs LF or CRLF, based on the state of mWithCRLF.

Parameters:
dcursoris a pointer to the start of the output buffer.
dendis a pointer to the end of the output buffer.

Definition at line 485 of file kmime_codecs.h.


The documentation for this class was generated from the following files:
  • kmime_codecs.h
  • kmime_codecs.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:34 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMIME Library

Skip menu "KMIME Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal