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

KMIME Library

KMime Namespace Reference


Detailed Description

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


Classes

class  BoolFlags
 Provides a class for storing boolean values in single bytes. More...
class  KAutoDeleteHash
 The KAutoDeleteHash class is a convenience QHash subclass that provides automatic deletion of the values in the destructor. More...
class  CharFreq
 A class for performing basic data typing using frequency count heuristics. More...
class  Base64Codec
 A class representing the codec for Base64 as specified in RFC2045. More...
class  Rfc2047BEncodingCodec
 A class representing the codec for the B encoding as specified in RFC2047B. More...
class  IdentityCodec
 A class representing the Identify codec. More...
class  SevenBitCodec
 A class representing the codec for seven-bit-text. More...
class  EightBitCodec
 A class representing the codec for eight-bit-text. More...
class  BinaryCodec
 A class representing the codec for eight-bit-binary. More...
class  QuotedPrintableCodec
 A class representing the codec for QuotedPrintable as specified in RFC2045 (section 6.7). 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  UUCodec
 A class representing the UUEncode codec. More...
class  Codec
 An abstract base class of codecs for common mail transfer encodings. More...
class  Decoder
 Stateful CTE decoder class. More...
class  Encoder
 Stateful encoder class. 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  Message
 Represents a (email) message. More...

Functions

static char binToHex (uchar value)
static uchar highNibble (uchar ch)
static uchar lowNibble (uchar ch)
static bool keep (uchar ch)
static int QuotedPrintableDecoder_maxDecodedSizeFor (int insize, bool withCRLF)
static uchar uuDecode (uchar c)
QByteArray cachedCharset (const QByteArray &name)
QByteArray cachedLanguage (const QByteArray &name)
bool isUsAscii (const QString &s)
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 uniqueString ()
QByteArray multiPartBoundary ()
QByteArray unfoldHeader (const QByteArray &header)
int indexOfHeader (const QByteArray &src, const QByteArray &name, int &end, int &dataBegin, bool *folded)
QByteArray extractHeader (const QByteArray &src, const QByteArray &name)
void removeHeader (QByteArray &header, const QByteArray &name)
QByteArray CRLFtoLF (const QByteArray &s)
QByteArray LFtoCRLF (const QByteArray &s)
template<typename T>
void removeQuotesGeneric (T &str)
void removeQuots (QByteArray &str)
void removeQuots (QString &str)
void addQuotes (QByteArray &str, bool forceQuotes)
QByteArray CRLFtoLF (const char *s)

Variables

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

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.

Definition at line 464 of file kmime_util.cpp.

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 

Definition at line 51 of file kmime_util.cpp.

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 

Definition at line 64 of file kmime_util.cpp.

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

Definition at line 422 of file kmime_util.cpp.

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.

Definition at line 128 of file kmime_util.cpp.

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.

Definition at line 177 of file kmime_util.cpp.

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.

Definition at line 395 of file kmime_util.cpp.

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 

Definition at line 77 of file kmime_util.cpp.

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

Definition at line 429 of file kmime_util.cpp.

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

Definition at line 307 of file kmime_util.cpp.

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

Definition at line 459 of file kmime_util.cpp.

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

Definition at line 454 of file kmime_util.cpp.

QByteArray KMime::unfoldHeader ( const QByteArray &  header  ) 

Unfolds the given header if necessary.

Parameters:
header The header to unfold.

Definition at line 312 of file kmime_util.cpp.

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

Definition at line 280 of file kmime_util.cpp.


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"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
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