SourcePro® 2023.1 |
SourcePro® API Reference Guide |
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) | |
virtual | ~RWMimeMultipart (void) |
size_t | findPart (const RWMimeHeader &header, size_t start=0) const |
RWMimePart | getPart (size_t position) const |
size_t | getPartCount (void) const |
RWCString | getPreamble (void) const |
void | insertPart (const RWMimePart &part) |
void | insertPartAt (size_t position, const RWMimePart &part) |
RWMimeMultipart & | operator= (const RWMimeMultipart &second) |
void | removePartAt (size_t position) |
void | setPreamble (const RWCString &preamble) |
Public Member Functions inherited from RWMimePart | |
RWMimePart (void) | |
RWMimePart (const RWMimeContentType &type) | |
RWMimePart (const RWMimePart &second) | |
virtual | ~RWMimePart (void) |
RWCString | asString (void) const |
size_t | findHeader (const RWCString &label, size_t start=0) const |
void | fromString (const RWCString &partString) |
RWCString | getBody (void) const |
RWMimeHeader | getHeader (size_t position) const |
size_t | getHeaderCount (void) const |
void | insertHeader (const RWMimeHeader &header) |
void | insertHeaderAt (size_t position, const RWMimeHeader &header) |
bool | isMultipart (void) const |
RWMimePart & | operator= (const RWMimePart &second) |
void | removeHeaderAt (size_t position) |
void | setBody (const RWCString &body) |
Public Member Functions inherited from RWHandleBase | |
bool | isValid (void) const |
bool | operator!= (const RWHandleBase &second) const |
bool | operator< (const RWHandleBase &second) const |
bool | operator== (const RWHandleBase &second) const |
Protected Member Functions | |
RWMimeMultipartImp & | body (void) const |
Protected Member Functions inherited from RWMimePart | |
RWMimePartImp & | body (void) const |
Protected Member Functions inherited from RWHandleBase | |
RWHandleBase (void) | |
RWHandleBase (RWStaticCtor) | |
RWHandleBase (RWBodyBase *body) | |
RWHandleBase (const RWHandleBase &second) | |
~RWHandleBase (void) | |
RWBodyBase & | body (void) const |
RWHandleBase & | operator= (const RWHandleBase &second) |
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:
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::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 |
Destructor.
|
protected |
Returns a reference to the underlying implementation.
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 © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |