• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KMIME Library

KMime Namespace Reference

Contains all the KMIME library global classes, objects, and functions. More...

Classes

class  Base64Codec
 A class representing the codec for Base64 as specified in RFC2045. More...
class  BinaryCodec
 A class representing the codec for eight-bit-binary. More...
class  BoolFlags
 Provides a class for storing boolean values in single bytes. More...
class  CharFreq
 A class for performing basic data typing using frequency count heuristics. More...
class  Codec
 An abstract base class of codecs for common mail transfer encodings. More...
class  Content
 A class that encapsulates MIME encoded Content. More...
class  ContentIndex
 A class to uniquely identify message parts (Content) in a hierarchy. More...
class  DateFormatter
 A class for abstracting date formatting. More...
class  Decoder
 Stateful CTE decoder class. More...
class  EightBitCodec
 A class representing the codec for eight-bit-text. More...
class  Encoder
 Stateful encoder class. More...
class  IdentityCodec
 A class representing the Identify codec. More...
class  KAutoDeleteHash
 The KAutoDeleteHash class is a convenience QHash subclass that provides automatic deletion of the values in the destructor. More...
class  Message
 Represents a (email) message. More...
class  QuotedPrintableCodec
 A class representing the codec for QuotedPrintable as specified in RFC2045 (section 6.7). More...
class  Rfc2047BEncodingCodec
 A class representing the codec for the B encoding as specified in RFC2047B. More...
class  Rfc2047QEncodingCodec
 A class representing the codec for the Q encoding as specified in RFC2047Q. More...
class  Rfc2231EncodingCodec
 A class representing the codec for RFC2231. More...
class  SevenBitCodec
 A class representing the codec for seven-bit-text. More...
class  UUCodec
 A class representing the UUEncode codec. More...

Functions

void addQuotes (QByteArray &str, bool forceQuotes)
static char binToHex (uchar value)
QByteArray cachedCharset (const QByteArray &name)
QByteArray cachedLanguage (const QByteArray &name)
QByteArray CRLFtoLF (const char *s)
QByteArray CRLFtoLF (const QByteArray &s)
QString decodeRFC2047String (const QByteArray &src)
QString decodeRFC2047String (const QByteArray &src, QByteArray &usedCS, const QByteArray &defaultCS=QByteArray(), bool forceCS=false)
QByteArray encodeRFC2047String (const QString &src, const QByteArray &charset, bool addressHeader=false, bool allow8bitHeaders=false)
QByteArray extractHeader (const QByteArray &src, const QByteArray &name)
QList< QByteArray > extractHeaders (const QByteArray &src, const QByteArray &name)
static uchar highNibble (uchar ch)
int indexOfHeader (const QByteArray &src, const QByteArray &name, int &end, int &dataBegin, bool *folded)
bool isUsAscii (const QString &s)
static bool keep (uchar ch)
QByteArray LFtoCRLF (const QByteArray &s)
static uchar lowNibble (uchar ch)
QByteArray multiPartBoundary ()
static int QuotedPrintableDecoder_maxDecodedSizeFor (int insize, bool withCRLF)
void removeHeader (QByteArray &header, const QByteArray &name)
void removeQuots (QString &str)
void removeQuots (QByteArray &str)
QByteArray unfoldHeader (const QByteArray &header)
QByteArray uniqueString ()
static uchar uuDecode (uchar c)

Variables

const uchar aTextMap [16]
QList< QByteArray > c_harsetCache
const uchar eTextMap [16]
QList< QByteArray > l_anguageCache
const uchar specialsMap [16]
const uchar tSpecialsMap [16]
const uchar tTextMap [16]

Detailed Description

Contains all the KMIME library global classes, objects, and functions.


Function Documentation

void KMime::addQuotes ( QByteArray &  str,
bool  forceQuotes 
)

Converts the given string into a quoted-string if the string contains any special characters (ie.

one of ()<>@,.;:[]=\).

Parameters:
str us-ascii string to work on.
forceQuotes if true, always add quote characters.
static char KMime::binToHex ( uchar  value  )  [inline, static]

Converts a 4-bit value into its hexadecimal characater representation.

So input of value [0,15] returns ['0','1',... 'F']. Input values greater than 15 will produce undesired results.

Parameters:
value is an unsigned character containing the 4-bit input value.

Definition at line 54 of file kmime_codec_qp.cpp.

QByteArray KMime::cachedCharset ( const QByteArray &  name  ) 

Consult the charset cache.

Only used for reducing mem usage by keeping strings in a common repository.

Parameters:
name 
QByteArray KMime::cachedLanguage ( const QByteArray &  name  ) 

Consult the language cache.

Only used for reducing mem usage by keeping strings in a common repository.

Parameters:
name 
QByteArray KMime::CRLFtoLF ( const char *  s  ) 

Converts all occurrences of "\r\n" (CRLF) in s to "\n" (LF).

This function is expensive and should be used only if the mail will be stored locally. All decode functions can cope with both line endings.

Parameters:
s source string containing CRLF's
Returns:
the string with CRLF's substitued for LF's
See also:
CRLFtoLF(const QCString&) LFtoCRLF
QByteArray KMime::CRLFtoLF ( const QByteArray &  s  ) 

Converts all occurrences of "\r\n" (CRLF) in s to "\n" (LF).

This function is expensive and should be used only if the mail will be stored locally. All decode functions can cope with both line endings.

Parameters:
s source string containing CRLF's
Returns:
the string with CRLF's substitued for LF's
See also:
CRLFtoLF(const char*) LFtoCRLF
QString KMime::decodeRFC2047String ( const QByteArray &  src  ) 

Decode string src according to RFC2047 (ie.

the =?charset?[qb]?encoded?= construct).

Parameters:
src source string.
Returns:
the decoded string.
QString KMime::decodeRFC2047String ( const QByteArray &  src,
QByteArray &  usedCS,
const QByteArray &  defaultCS = QByteArray(),
bool  forceCS = false 
)

Decodes string src according to RFC2047,i.e., the construct =?charset?[qb]?encoded?=.

Parameters:
src source string.
usedCS the detected charset is returned here
defaultCS the charset to use in case the detected one isn't known to us.
forceCS force the use of the default charset.
Returns:
the decoded string.
QByteArray KMime::encodeRFC2047String ( const QString &  src,
const QByteArray &  charset,
bool  addressHeader = false,
bool  allow8bitHeaders = false 
)

Encodes string src according to RFC2047 using charset charset.

Parameters:
src source string.
charset charset to use.
addressHeader if this flag is true, all special chars like <,>,[,],... will be encoded, too.
allow8bitHeaders if this flag is true, 8Bit headers are allowed.
Returns:
the encoded string.
QByteArray KMime::extractHeader ( const QByteArray &  src,
const QByteArray &  name 
)

Tries to extract the header with name name from the string src, unfolding it if necessary.

Parameters:
src the source string.
name the name of the header to search for.
Returns:
the first instance of the header name in src or a null QCString if no such header was found.
QList< QByteArray > KMime::extractHeaders ( const QByteArray &  src,
const QByteArray &  name 
)

Tries to extract the headers with name name from the string src, unfolding it if necessary.

Parameters:
src the source string.
name the name of the header to search for.
Returns:
all instances of the header name in src
Since:
4.2
static uchar KMime::highNibble ( uchar  ch  )  [inline, static]

Returns the high-order 4 bits of an 8-bit value in another 8-bit value.

Parameters:
ch is an unsigned character containing the 8-bit input value.

Definition at line 67 of file kmime_codec_qp.cpp.

bool KMime::isUsAscii ( const QString &  s  ) 

Checks whether s contains any non-us-ascii characters.

Parameters:
s 
static bool KMime::keep ( uchar  ch  )  [inline, static]

Returns true if the specified value is a not Control character or question mark; else true.

Parameters:
ch is an unsigned character containing the 8-bit input value.

Definition at line 86 of file kmime_codec_qp.cpp.

QByteArray KMime::LFtoCRLF ( const QByteArray &  s  ) 

Converts all occurrences of "\n" (LF) in s to "\r\n" (CRLF).

This function is expensive and should be used only if the mail will be transmitted as an RFC822 message later. All decode functions can cope with and all encode functions can optionally produce both line endings, which is much faster.

Parameters:
s source string containing CRLF's
Returns:
the string with CRLF's substitued for LF's
See also:
CRLFtoLF(const QCString&) LFtoCRLF
static uchar KMime::lowNibble ( uchar  ch  )  [inline, static]

Returns the low-order 4 bits of an 8-bit value in another 8-bit value.

Parameters:
ch is an unsigned character containing the 8-bit input value.

Definition at line 76 of file kmime_codec_qp.cpp.

QByteArray KMime::multiPartBoundary (  ) 

Constructs a random string (sans leading/trailing "--") that can be used as a multipart delimiter (ie.

as boundary parameter to a multipart/... content-type).

Returns:
the randomized string.
See also:
uniqueString
void KMime::removeQuots ( QString &  str  ) 

Removes quote (DQUOTE) characters and decodes "quoted-pairs" (ie.

backslash-escaped characters)

Parameters:
str the string to work on.
See also:
addQuotes
void KMime::removeQuots ( QByteArray &  str  ) 

Removes quote (DQUOTE) characters and decodes "quoted-pairs" (ie.

backslash-escaped characters)

Parameters:
str the string to work on.
See also:
addQuotes
QByteArray KMime::unfoldHeader ( const QByteArray &  header  ) 

Unfolds the given header if necessary.

Parameters:
header The header to unfold.
QByteArray KMime::uniqueString (  ) 

Uses current time, pid and random numbers to construct a string that aims to be unique on a per-host basis (ie.

for the local part of a message-id or for multipart boundaries.

Returns:
the unique string.
See also:
multiPartBoundary

Variable Documentation

const uchar KMime::aTextMap[16]
Initial value:
 {
  0x00, 0x00, 0x00, 0x00,
  0x5F, 0x35, 0xFF, 0xC5,
  0x7F, 0xFF, 0xFF, 0xE3,
  0xFF, 0xFF, 0xFF, 0xFE
}

Definition at line 105 of file kmime_util.cpp.

const uchar KMime::eTextMap[16]
Initial value:
 {
  0x00, 0x00, 0x00, 0x00,
  0x40, 0x35, 0xFF, 0xC0,
  0x7F, 0xFF, 0xFF, 0xE0,
  0x7F, 0xFF, 0xFF, 0xE0
}

Definition at line 121 of file kmime_util.cpp.

const uchar KMime::specialsMap[16]
Initial value:
 {
  0x00, 0x00, 0x00, 0x00, 
  0x20, 0xCA, 0x00, 0x3A, 
  0x80, 0x00, 0x00, 0x1C, 
  0x00, 0x00, 0x00, 0x00  
}

Definition at line 89 of file kmime_util.cpp.

const uchar KMime::tSpecialsMap[16]
Initial value:
 {
  0x00, 0x00, 0x00, 0x00, 
  0x20, 0xC9, 0x00, 0x3F, 
  0x80, 0x00, 0x00, 0x1C, 
  0x00, 0x00, 0x00, 0x00  
}

Definition at line 97 of file kmime_util.cpp.

const uchar KMime::tTextMap[16]
Initial value:
 {
  0x00, 0x00, 0x00, 0x00,
  0x5F, 0x36, 0xFF, 0xC0,
  0x7F, 0xFF, 0xFF, 0xE3,
  0xFF, 0xFF, 0xFF, 0xFE
}

Definition at line 113 of file kmime_util.cpp.

KMIME Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal