attachmentHelper Class Reference

Retrieve attachment information from message parts. More...

List of all members.

Static Public Member Functions

static bool isBodyPartAnAttachment (ref< const bodyPart > part)
static ref< const attachmentgetBodyPartAttachment (ref< const bodyPart > part)
static const std::vector< ref
< const attachment > > 
findAttachmentsInMessage (ref< const message > msg)
static void addAttachment (ref< message > msg, ref< attachment > att)
static void addAttachment (ref< message > msg, ref< message > amsg)

Static Protected Member Functions

static const std::vector< ref
< const attachment > > 
findAttachmentsInBodyPart (ref< const bodyPart > part)
static ref< bodyPartfindBodyPart (ref< bodyPart > part, const mediaType &type)

Detailed Description

Retrieve attachment information from message parts.


Member Function Documentation

void addAttachment ( ref< message msg,
ref< message amsg 
) [static]

Add a message attachment to the specified message.

Parameters:
msg message into which to add the attachment
amsg message to attach

References attachmentHelper::addAttachment().

void addAttachment ( ref< message msg,
ref< attachment att 
) [static]

Add an attachment to the specified message.

Parameters:
msg message into which to add the attachment
att attachment to add

References vmime::fields::CONTENT_DISPOSITION, vmime::fields::CONTENT_TRANSFER_ENCODING, vmime::fields::CONTENT_TYPE, attachmentHelper::findBodyPart(), vmime::mediaTypes::MULTIPART, and vmime::mediaTypes::MULTIPART_MIXED.

Referenced by attachmentHelper::addAttachment().

const std::vector< ref< const attachment > > findAttachmentsInBodyPart ( ref< const bodyPart part  )  [static, protected]
const std::vector< ref< const attachment > > findAttachmentsInMessage ( ref< const message msg  )  [static]

Find all attachments contained in the specified message.

This is simply a recursive call to getBodyPartAttachment().

Parameters:
msg message in which to search
Returns:
a list of attachments found

References attachmentHelper::findAttachmentsInBodyPart().

ref< bodyPart > findBodyPart ( ref< bodyPart part,
const mediaType type 
) [static, protected]
ref< const attachment > getBodyPartAttachment ( ref< const bodyPart part  )  [static]

Return attachment information in the specified body part.

If the specified body part does not contain attachment information (ie. is not an attachment), NULL is returned.

Parameters:
part message part in which to search
Returns:
attachment found in the part, or NULL

References vmime::mediaTypes::APPLICATION, vmime::mediaTypes::APPLICATION_OCTET_STREAM, vmime::fields::CONTENT_TYPE, mediaType::getSubType(), mediaType::getType(), headerField::getValue(), attachmentHelper::isBodyPartAnAttachment(), vmime::mediaTypes::MESSAGE, and vmime::mediaTypes::MESSAGE_RFC822.

Referenced by attachmentHelper::findAttachmentsInBodyPart().

bool isBodyPartAnAttachment ( ref< const bodyPart part  )  [static]

The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2