VMime
attachmentHelper Class Reference

Public Types

enum  FindOptions { INLINE_OBJECTS = (1 << 0) }
 

Static Public Member Functions

static bool isBodyPartAnAttachment (shared_ptr< const bodyPart > part, const unsigned int options=0)
 
static shared_ptr< const
attachment
getBodyPartAttachment (shared_ptr< const bodyPart > part, const unsigned int options=0)
 
static const std::vector
< shared_ptr< const attachment > > 
findAttachmentsInBodyPart (shared_ptr< const bodyPart > part, const unsigned int options=0)
 
static const std::vector
< shared_ptr< const attachment > > 
findAttachmentsInMessage (shared_ptr< const message > msg, const unsigned int options=0)
 
static void addAttachment (shared_ptr< message > msg, shared_ptr< attachment > att)
 
static void addAttachment (shared_ptr< message > msg, shared_ptr< message > amsg)
 

Static Protected Member Functions

static shared_ptr< bodyPartfindBodyPart (shared_ptr< bodyPart > part, const mediaType &type)
 

Detailed Description

Retrieve attachment information from message parts.

Member Enumeration Documentation

Options for use with the following functions: findAttachmentsInMessage, getBodyPartAttachment, and isBodyPartAnAttachment.

Enumerator
INLINE_OBJECTS 

Recognize and return inline objects.

The aim is to consider MHTML objects (parts with a "Content-Id" or a "Content-Location", such as inline images) as attachments.

Member Function Documentation

void addAttachment ( shared_ptr< message msg,
shared_ptr< attachment att 
)
static

Add an attachment to the specified message.

Parameters
msgmessage into which to add the attachment
attattachment 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().

void addAttachment ( shared_ptr< message msg,
shared_ptr< message amsg 
)
static

Add a message attachment to the specified message.

Parameters
msgmessage into which to add the attachment
amsgmessage to attach

References attachmentHelper::addAttachment().

const std::vector< shared_ptr< const attachment > > findAttachmentsInBodyPart ( shared_ptr< const bodyPart part,
const unsigned int  options = 0 
)
static

Find all attachments contained in the specified part and all its children parts.

This is simply a recursive call to getBodyPartAttachment().

Parameters
partpart in which to search
optionssearch options (see FindOptions)
Returns
a list of attachments found
const std::vector< shared_ptr< const attachment > > findAttachmentsInMessage ( shared_ptr< const message msg,
const unsigned int  options = 0 
)
static

Find all attachments contained in the specified message.

This is simply a recursive call to getBodyPartAttachment().

Parameters
msgmessage in which to search
optionssearch options (see FindOptions)
Returns
a list of attachments found
shared_ptr< bodyPart > findBodyPart ( shared_ptr< bodyPart part,
const mediaType type 
)
staticprotected
shared_ptr< const attachment > getBodyPartAttachment ( shared_ptr< const bodyPart part,
const unsigned int  options = 0 
)
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
partmessage part in which to search
optionssearch options (see FindOptions)
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(), vmime::mediaTypes::MESSAGE, and vmime::mediaTypes::MESSAGE_RFC822.

bool isBodyPartAnAttachment ( shared_ptr< const bodyPart part,
const unsigned int  options = 0 
)
static

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