Module: Internet Protocols Module Package: MIME
RWMimeMultipartRWMimePartRWHandleBase
findPart() getPart() getPartCount() |
getPreamble() insertPart() insertPartAt() |
operator=() removePartAt() RWMimeMultipart() |
setPreamble() ~RWMimeMultipart() |
#include <rw/mime/RWMimeMultipart.h>
RWMimeMultipart represents a MIME part with the media type multipart. The MIME multipart media type indicates that the part may contain other MIME parts. An instance of this class contains a vector of RWMimePart objects. The class inherits general functionality from RWMimePart and provides functions for working with the vector of MIME parts.
The MIME specification requires that a multipart part contain a Content-Type header with a multipart media type and a boundary parameter. For example, the simple multipart MIME part:
Content-Type: multipart/mixed; boundary="__the_boundary__" --__the_boundary__ This is the first part, in plain text. --__the_boundary__ Content-Type: text/plain; charset=us-ascii This is the second part, also in plain text but with a Content-Type header. --__the_boundary__--
contains two plain text MIME parts. The value of the boundary parameter delimits each part. Therefore, an RWMimeMultipart object must contain a multipart Content-Type header to be converted to a string.
An instance of this class is a handle to a private, reference-counted body.
RWMimeMultipart provides an encapsulation of multipart MIME parts as described in RFCs 2045-2049.
RWMimeMultipart(void);
Default constructor. Constructs a MIME part with no headers and no body.
NOTE -- A default constructed RWMimeMultipart does not contain a Content-Type header.
RWMimeMultipart(const RWMimeMultipartType& type);
Content-Type constructor. Constructs an RWMimeMultipart with a Content-Type header that contains the value type.
RWMimeMultipart(const RWMimeMultipart& second);
Copy constructor. Constructs a new handle to the body second refers to.
RWMimeMultipart(const RWMimePart& second);
Conversion constructor. Constructs a new handle to the body second refers to. Throws RWMimeError if second is not a multipart message.
virtual ~RWMimeMultipart(void);
Destructor.
RWMimeMultipart& operator=(const RWMimeMultipart& second);
Assignment operator. Makes self a handle identical to second.
size_t findPart(const RWMimeHeader& header, size_t start = 0) const;
Returns the position of the first part in self's part collection that contains a header matching header. Begins searching at start. If no such part is present, returns RW_NPOS. Compares both the label and value of headers. Uses a case-insensitive string comparison for labels. For values, the comparison is defined by the header type. This function does not search the part collections of any RWMimeMultipart objects contained by self.
RWMimePart getPart(size_t position) const;
Retrieve the MIME part located at position. Throws RWBoundsErr if position is less than 0 or greater than getPartCount() - 1.
size_t getPartCount(void) const;
Returns the number of parts self contains.
RWCString getPreamble(void) const;
Returns self's preamble. The RWCString should contain 7-bit US-ASCII data.
void insertPart(const RWMimePart& part);
Inserts part at the end of self's part collection.
NOTE -- An RWMimeMultipart must not contain itself either directly or indirectly. A part that contains itself cannot be converted to a string.
void insertPartAt(size_t position, const RWMimePart& part);
Inserts part into self's part collection at position. Throws RWBoundsErr if position is less than 0 or greater than getPartCount().
NOTE -- An RWMimeMultipart must not contain itself either directly or indirectly. A part that contains itself cannot be converted to a string.
void removePartAt(size_t position);
Removes the part located at position from self's part collection. Throws RWBoundsErr if position is less than 0 or greater than getPartCount() - 1.
void setPreamble(const RWCString& preamble);
Sets self's preamble to preamble. The RWCString should contain 7-bit US-ASCII data.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.