SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Represents a MIME part with the media type multipart
.
More...
#include <rw/mime/RWMimeMultipart.h>
Public Member Functions | |
RWMimeMultipart (void) | |
RWMimeMultipart (const RWMimeMultipartType &type) | |
RWMimeMultipart (const RWMimeMultipart &second) | |
RWMimeMultipart (const RWMimePart &second) | |
RWMimeMultipart & | operator= (const RWMimeMultipart &second) |
virtual | ~RWMimeMultipart (void) |
RWCString | getPreamble (void) const |
void | setPreamble (const RWCString &preamble) |
size_t | getPartCount (void) const |
RWMimePart | getPart (size_t position) const |
void | insertPart (const RWMimePart &part) |
void | insertPartAt (size_t position, const RWMimePart &part) |
void | removePartAt (size_t position) |
size_t | findPart (const RWMimeHeader &header, size_t start=0) const |
Protected Member Functions | |
RWMimeMultipartImp & | body (void) const |
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 the Multipurpose Internet Mail Extensions (MIME) as described in RFC 2045 - 2049.
RWMimeMultipart::RWMimeMultipart | ( | void | ) |
Default constructor. Constructs a MIME part with no headers and no body.
RWMimeMultipart::RWMimeMultipart | ( | const RWMimeMultipartType & | type | ) |
Content-Type constructor. Constructs an RWMimeMultipart with a Content-Type header that contains the value type.
RWMimeMultipart::RWMimeMultipart | ( | const RWMimeMultipart & | second | ) |
Copy constructor. Constructs a new handle to the body second refers to.
RWMimeMultipart::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::~RWMimeMultipart | ( | void | ) | [virtual] |
Destructor.
RWMimeMultipartImp& RWMimeMultipart::body | ( | void | ) | const [protected] |
Returns a reference to the underlying implementation.
Reimplemented from RWMimePart.
size_t RWMimeMultipart::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 RWMimeMultipart::getPart | ( | size_t | position | ) | const |
Retrieve the MIME part located at position. Throws RWBoundsErr if position is greater than or equal to getPartCount().
size_t RWMimeMultipart::getPartCount | ( | void | ) | const |
Returns the number of parts self contains.
RWCString RWMimeMultipart::getPreamble | ( | void | ) | const |
Returns self's preamble. The RWCString should contain 7-bit US-ASCII data.
void RWMimeMultipart::insertPart | ( | const RWMimePart & | part | ) |
Inserts part at the end of self's part collection.
void RWMimeMultipart::insertPartAt | ( | size_t | position, | |
const RWMimePart & | part | |||
) |
Inserts part into self's part collection at position. Throws RWBoundsErr if position is greater than getPartCount().
RWMimeMultipart& RWMimeMultipart::operator= | ( | const RWMimeMultipart & | second | ) |
Assignment operator. Makes self a handle identical to second.
void RWMimeMultipart::removePartAt | ( | size_t | position | ) |
Removes the part located at position from self's part collection. Throws RWBoundsErr if position is greater than or equal to getPartCount().
© 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.