libkmime

KMime Namespace Reference


Classes

class  CharFreq
class  Base64Codec
class  Rfc2047BEncodingCodec
class  IdentityCodec
class  SevenBitCodec
class  EightBitCodec
class  BinaryCodec
class  QuotedPrintableCodec
class  Rfc2047QEncodingCodec
class  Rfc2231EncodingCodec
class  UUCodec
class  Codec
 Abstract base class of codecs like base64 and quoted-printable.Codecs for common mail transfer encodings. More...
class  Decoder
 Stateful decoder class, modelled after QTextDecoder.Stateful CTE decoder class. More...
class  Encoder
 Stateful encoder class, modelled after QTextEncoder.Stateful encoder class. More...
class  Base
 Base class for messages in mime format It contains all the enums, static functions and parser-classes, that are needed for mime handling. More...
class  Content
 This class encapsulates a mime-encoded content. More...
class  Message
class  NewsArticle
class  DateFormatter
 class abstracting date formatting More...

Namespaces

namespace  HeaderParsing
namespace  Headers
namespace  MDN
namespace  Parser
namespace  Types

Functions

static bool isWS (char ch)
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)
const char * cachedCharset (const QCString &name) KDE_EXPORT
const char * cachedLanguage (const QCString &name) KDE_EXPORT
bool isUsAscii (const QString &s) KDE_EXPORT
QString decodeRFC2047String (const QCString &src, const char **usedCS, const QCString &defaultCS, bool forceCS) KDE_EXPORT
QCString encodeRFC2047String (const QString &src, const char *charset, bool addressHeader=false, bool allow8bitHeaders=false) KDE_EXPORT
QCString uniqueString () KDE_EXPORT
QCString multiPartBoundary () KDE_EXPORT
QCString extractHeader (const QCString &src, const char *name) KDE_EXPORT
QCString CRLFtoLF (const QCString &s) KDE_EXPORT
QCString CRLFtoLF (const char *s) KDE_EXPORT
QCString LFtoCRLF (const QCString &s) KDE_EXPORT
void removeQuots (QCString &str)
void removeQuots (QString &str)
void addQuotes (QCString &str, bool forceQuotes)
bool isOfSet (const uchar map[16], unsigned char ch)
bool isSpecial (char ch)
bool isTSpecial (char ch)
bool isAText (char ch)
bool isTText (char ch)
bool isEText (char ch)

Variables

static const uchar base64DecodeMap [128]
static const char base64EncodeMap [64]
static KStaticDeleter< QAsciiDict<
Codec > > 
sdAll
QStrIList c_harsetCache
QStrIList l_anguageCache
const uchar specialsMap [16]
const uchar tSpecialsMap [16]
const uchar aTextMap [16]
const uchar tTextMap [16]
const uchar eTextMap [16]
const uchar specialsMap [16]
const uchar tSpecialsMap [16]
const uchar aTextMap [16]
const uchar tTextMap [16]
const uchar eTextMap [16]

Function Documentation

KDE_EXPORT void KMime::addQuotes ( QCString &  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 459 of file kmime_util.cpp.

const char * KMime::cachedCharset ( const QCString &  name  ) 

Consult the charset cache.

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

Definition at line 48 of file kmime_util.cpp.

const char * KMime::cachedLanguage ( const QCString &  name  ) 

Consult the language cache.

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

Definition at line 59 of file kmime_util.cpp.

QCString 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

Definition at line 409 of file kmime_util.cpp.

QCString KMime::CRLFtoLF ( const QCString &  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 401 of file kmime_util.cpp.

QString KMime::decodeRFC2047String ( const QCString &  src,
const char **  usedCS,
const QCString &  defaultCS,
bool  forceCS 
)

Decode string src according to RFC2047 (ie.

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

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 124 of file kmime_util.cpp.

QCString KMime::encodeRFC2047String ( const QString &  src,
const char *  charset,
bool  addressHeader = false,
bool  allow8bitHeaders = false 
)

Encode 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 239 of file kmime_util.cpp.

QCString KMime::extractHeader ( const QCString &  src,
const char *  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 361 of file kmime_util.cpp.

bool KMime::isUsAscii ( const QString &  s  ) 

checks whether s contains any non-us-ascii characters

Definition at line 70 of file kmime_util.cpp.

QCString KMime::LFtoCRLF ( const QCString &  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 417 of file kmime_util.cpp.

QCString 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 354 of file kmime_util.cpp.

KDE_EXPORT 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 442 of file kmime_util.cpp.

KDE_EXPORT void KMime::removeQuots ( QCString &  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 425 of file kmime_util.cpp.

QCString 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 329 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 97 of file kmime_util.cpp.

const uchar KMime::base64DecodeMap[128] [static]

Initial value:

 {
  64, 64, 64, 64, 64, 64, 64, 64,  64, 64, 64, 64, 64, 64, 64, 64,
  64, 64, 64, 64, 64, 64, 64, 64,  64, 64, 64, 64, 64, 64, 64, 64,
  
  64, 64, 64, 64, 64, 64, 64, 64,  64, 64, 64, 62, 64, 64, 64, 63,
  52, 53, 54, 55, 56, 57, 58, 59,  60, 61, 64, 64, 64, 64, 64, 64,
  
  64,  0,  1,  2,  3,  4,  5,  6,   7,  8,  9, 10, 11, 12, 13, 14,
  15, 16, 17, 18, 19, 20, 21, 22,  23, 24, 25, 64, 64, 64, 64, 64,
  
  64, 26, 27, 28, 29, 30, 31, 32,  33, 34, 35, 36, 37, 38, 39, 40,
  41, 42, 43, 44, 45, 46, 47, 48,  49, 50, 51, 64, 64, 64, 64, 64
}

Definition at line 53 of file kmime_codec_base64.cpp.

const char KMime::base64EncodeMap[64] [static]

Initial value:

 {
  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
  'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
  'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
  'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
  'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
  'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
  'w', 'x', 'y', 'z', '0', '1', '2', '3',
  '4', '5', '6', '7', '8', '9', '+', '/'
}

Definition at line 67 of file kmime_codec_base64.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 113 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 81 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 89 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 105 of file kmime_util.cpp.

KDE Home | KDE Accessibility Home | Description of Access Keys