Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_MailAttachment Class Reference

A helper class to handle e-mail attachments for use in CP_MailMessages.

List of all members.

Public Member Functions

Constructor / Destructor
 CP_MailAttachment ()
 Constructor.
 CP_MailAttachment (const CP_MailAttachment &inAttachment)
virtual ~CP_MailAttachment ()
 Destructor.
operators
CP_MailAttachmentoperator= (const CP_MailAttachment &inAttachment)
void Attach (const CP_FileSystemSpec &inAttachmentSpec)
Getters
CP_String GetHeader ()
CP_String GetTitle ()
CP_String GetFileName ()
const CP_HandleBlockGetData () const
UInt32 GetDataLength ()
CP_String GetContentType ()
CP_String GetContentEncoding ()
CP_DataEncoderGetEncoder ()
Setters
void SetTitle (const CP_String &inTitle)
void SetEncoder (CP_DataEncoder *inEncoder)
void SetData (CP_HandleBlock *inData, bool inTransferOwnership=false)
void SetContentType (CP_String inContentType)
void SetStringContents (const CP_String &inContents, CP_String inContentType=kCP_Header_DefaultContentType)

Protected Attributes

CP_String fTitle
CP_FileSystemSpec fAttachmentSpec
CP_String fContentType
CP_DataEncoderfEncoder
CP_HandleBlockfData
bool fDataOwned
CP_String fMIMEVers
CP_String fBoundary

Private Member Functions

Initialization
void Init ()


Constructor & Destructor Documentation

CP_MailAttachment::CP_MailAttachment  ) 
 

Constructor.

Exceptions:
none 

CP_MailAttachment::CP_MailAttachment const CP_MailAttachment inAttachment  ) 
 

Copy constructor.

Parameters:
inAttachment CP_MailAttachment to copy the data from.
Exceptions:
none 

CP_MailAttachment::~CP_MailAttachment  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_MailAttachment & CP_MailAttachment::operator= const CP_MailAttachment inAttachment  ) 
 

Assignment operator.

Parameters:
inAttachment CP_MailAttachment to copy the fields from.
Exceptions:
none 
Returns:
CP_MailAttachment& A reference to ourselves.

void CP_MailAttachment::Attach const CP_FileSystemSpec inAttachmentSpec  ) 
 

Attach the data pointed to by inAttachmentSpec. This method will open the file, read and compress it, and then store the compressed data in a CP_HandleBlock object. NOTE: This method will throw an exception if it cannot correctly get and encode the data.

Parameters:
inAttachmentSpec The CP_FileSystemSpec of the file to attach.
Exceptions:
none 
Returns:
UInt32 The length of the data.

CP_String CP_MailAttachment::GetHeader  ) 
 

Return the MIME encoding header for this attachment.

Exceptions:
none 
Returns:
CP_String The header for this attachment.

CP_String CP_MailAttachment::GetTitle  ) 
 

Returns the title of this attachment.

Exceptions:
none 
Returns:
CP_String Title of the attachment.

CP_String CP_MailAttachment::GetFileName  ) 
 

Returns the file name of this attachment.

Exceptions:
none 
Returns:
CP_String File name of the attachment.

const CP_HandleBlock* CP_MailAttachment::GetData  )  const
 

Returns the data of this attachment.

Exceptions:
none 
Returns:
cnst CP_HandleBlock * Data of the attachment.

UInt32 CP_MailAttachment::GetDataLength  ) 
 

Returns the data length of our data.

Parameters:
UInt32 The data length of our data.
Exceptions:
none 
Returns:
UInt32 The length of the data.

CP_String CP_MailAttachment::GetContentType  ) 
 

Returns the MIME content of this attachment.

Exceptions:
none 
Returns:
CP_String MIME content of the attachment.

CP_String CP_MailAttachment::GetContentEncoding  ) 
 

Return the type of encoding used for this attachments data.

Exceptions:
none 
Returns:
CP_String The encoding for this attachment.

CP_DataEncoder* CP_MailAttachment::GetEncoder  ) 
 

Returns the CP_DataEncoder used to encode this attachment.

Exceptions:
none 
Returns:
CP_DataEncoder Data encoder used to encode the attachment.

void CP_MailAttachment::SetTitle const CP_String inTitle  ) 
 

Sets the title for this attachment.

Parameters:
inTitle The title for the attachment.
Exceptions:
none 
Returns:
void

void CP_MailAttachment::SetEncoder CP_DataEncoder inEncoder  ) 
 

Sets the data encoder for this attachment.

Parameters:
inEncoder The data encoder for the attachment.
Exceptions:
none 
Returns:
void

void CP_MailAttachment::SetData CP_HandleBlock inData,
bool  inTransferOwnership = false
 

Sets the data for this attachment.

Parameters:
inData The data for the attachment.
inTransferOwnership Pass true to transfer ownership if the CP_DataHandleBlock, or false if this object should leave the handle block alone.
Exceptions:
none 
Returns:
void

void CP_MailAttachment::SetContentType CP_String  inContentType  ) 
 

Sets the content type for this attachment.

Parameters:
inContentType The content type for the attachment.
Exceptions:
none 
Returns:
void

void CP_MailAttachment::SetStringContents const CP_String inContents,
CP_String  inContentType = kCP_Header_DefaultContentType
 

Sets the content for this attachment from the passed in string.

Parameters:
inContents The contents for the attachment.
inContentType The type of content.
Exceptions:
none 
Returns:
void

void CP_MailAttachment::Init  )  [private]
 

Finish initializing this object.

Exceptions:
none 
Returns:
void


Member Data Documentation

CP_String CP_MailAttachment::fTitle [protected]
 

Name (title) of the attachment.

CP_FileSystemSpec CP_MailAttachment::fAttachmentSpec [protected]
 

CP_FileSystemSpec for the file containing the attachment data.

CP_String CP_MailAttachment::fContentType [protected]
 

CP_DataEncoder* CP_MailAttachment::fEncoder [protected]
 

CP_DataEncoder used to encode the data for this object.

CP_HandleBlock* CP_MailAttachment::fData [protected]
 

CP_HandleBlock object containing the data of this attachment.

bool CP_MailAttachment::fDataOwned [protected]
 

Are we responsible for freeing the fData object?

CP_String CP_MailAttachment::fMIMEVers [protected]
 

MIME version of the attachment.

CP_String CP_MailAttachment::fBoundary [protected]
 

Boundary marker for the attachment.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:49 2005 for CPLAT by  doxygen 1.4.0