Main Page | Class Hierarchy | Class List | File List | Class Members

EmailMessage Class Reference

#include <EmailMessage.h>

Inheritance diagram for EmailMessage:

MailHeader List of all members.

Public Member Functions

 EmailMessage ()
bool open (GInputStream *stream)
const QByteArray & contentType ()
const QString & text ()
size_t size () const
bool hasAttachments () const
 Attachments.

QStringList attachments ()
bool readAttachment (const QString &name, QByteArray &contents, QByteArray &contentType)
void setDeleteStream (bool isDelete=true)
void parseHeaderOnly (bool bOnly=true)

Static Public Member Functions

bool isHexString (const QByteArray &hex)
QString decodeNonAsciiText (GBufferString &text)
int encode (QByteArray &text, const GBufferString &encoding, bool bShortForm=false)

Protected Types

enum  contenttype { e_text = 0xA, e_multipart = 0xF, e_other = 0xD }

Protected Member Functions

void initParams ()
void init ()
void processParameter (GBufferString &paramText)
bool parseMimeBody ()
bool compareNoCase (const char *ca1, const char *ca2)
void parseContentType (GBufferString &paramString)
void parseFrom (GBufferString &paramString)
void parseDate (GBufferString &paramString)
void parseContentDisp (GBufferString &paramString, bool &bMulti, bool bTextEmpty, int boundaryPos, int &nameCounter)
void parseAddrList (QStringList &addrList, GBufferString &line)
void getExt (const QByteArray &contentType, QByteArray &extension)
void addAttachment ()
bool isUUencoded (GBufferString &line, QByteArray &filename)
void uudecode (bool extract, QByteArray &outData)

Protected Attributes

enum EmailMessage::contenttype enumConType_
GBufferedInputStream< GInputStream > readline_
GInputStream * emailStream_
QVector< AttachmentItem > attachments_
QString text_
QByteArray boundary_
QByteArray encoding_
QByteArray retContentType_
QByteArray contentType_
QByteArray charset_
qint64 boundaryPos_
bool bAutoDelete_
bool bParseHeaderOnly_
QString attachName_
qint64 attachPos_
bool bAddAttachment_

Detailed Description

EmailMessage helps with parsing raw bytes email messages, and extracting all necessary information (fast parsing)


Constructor & Destructor Documentation

EmailMessage::EmailMessage  ) 
 

EmailMessage helps with parsing raw bytes email messages, and extracting all necessary information


Member Function Documentation

QStringList EmailMessage::attachments  ) 
 

Returns:
list of filenames of available attachments.

const QByteArray & EmailMessage::contentType  ) 
 

Returns:
mime type of a message

QString EmailMessage::decodeNonAsciiText GBufferString &  text  )  [static]
 

Decode message header parameter text that has rfc1522 ( non Ascii ) format

int EmailMessage::encode QByteArray &  text,
const GBufferString &  encoding,
bool  bShortForm = false
[static]
 

Decode the text if encoding is quoted-printable or Base64

bool EmailMessage::hasAttachments  )  const
 

Attachments.

Returns:
true if email has attachments, otherwise false

bool EmailMessage::open GInputStream *  stream  ) 
 

Opens email message from InputStream

void EmailMessage::parseHeaderOnly bool  bOnly = true  ) 
 

if bOnly equals true

bool EmailMessage::parseMimeBody  )  [protected]
 

Treat Content of the MIME file, beforehand have read the main header and sets the enumConType_ member

bool EmailMessage::readAttachment const QString &  name,
QByteArray &  contents,
QByteArray &  contentType
 

Reads attachment specified with file name

Parameters:
name - Attachment file name
container to place contents of an attachment or empty byte array if no such file exists.

void EmailMessage::setDeleteStream bool  isDelete = true  ) 
 

Says delete or not stream in destructor

size_t EmailMessage::size  )  const
 

Returns:
email message size

const QString & EmailMessage::text  ) 
 

Returns:
message text


The documentation for this class was generated from the following files:
Generated on Tue Oct 16 10:00:38 2007 for EmailParser by doxygen 1.3.4