implements the MultiPartRelatedMessage class, a specialization of MultiPartMessage
More...
#include <Mime.qm.dox.h>
|
| addPart (data mime_data, string id, string content_type, *hash hdr) |
| adds a message part to the end of the list
|
|
| constructor (string boundary=MultiPartMessage::getBoundary()) |
| creates the object
|
|
hash< MessageInfo > | getMsgAndHeaders () |
| returns a hash of the message
|
|
| splicePart (data mime_data, string id, string content_type, *hash< auto > hdr) |
| adds a message part to the start of the list
|
|
| constructor (string mptype, string boundary=MultiPartMessage::getBoundary()) |
| creates the object
|
|
string | getBoundary () |
| returns the message boundary string used
|
|
abstract hash< MessageInfo > | getMsgAndHeaders () |
| returns a hash of the message
|
|
binary | serialize () |
| serializes the message with the Content-Type header first and returns a binary object ready to send over a socket
|
|
binary | serializeBody () |
| serializes the message body only and returns a binary object ready to send over a socket
|
|
int | size () |
| returns the number of parts in the message
|
|
|
static string | getBoundary () |
| returns a string embedded with the current timestamp designed to be used as MultiPart boundary string
|
|
static string | getRandomString (int len) |
| returns a string of random characters
|
|
static hash< MessageInfo > | parseBody (string boundary, data body, bool decode=True) |
| returns a hash representing a parsed multipart message body from a boundary string and body arguments
|
|
static binary | serializeHeaders (hash hdr) |
| serializes a header hash to a binary object
|
|
implements the MultiPartRelatedMessage class, a specialization of MultiPartMessage
◆ addPart()
Mime::MultiPartRelatedMessage::addPart |
( |
data |
mime_data, |
|
|
string |
id, |
|
|
string |
content_type, |
|
|
*hash |
hdr |
|
) |
| |
adds a message part to the end of the list
- Parameters
-
mime_data | the data for the part |
id | the multipart/related ID for the part |
content_type | the content_type for the part |
hdr | an optional hash of headers for the part |
- Exceptions
-
MULTIPART-RELATED-ERROR | if the id parameter is empty, this exception is thrown |
◆ constructor()
creates the object
- Parameters
-
boundary | the boundary to use between parts |
◆ getMsgAndHeaders()
hash< MessageInfo > Mime::MultiPartRelatedMessage::getMsgAndHeaders |
( |
| ) |
|
returns a hash of the message
- Returns
- a hash of the message with the following keys:
hdr:
a hash of header information
body:
a binary object of serialized message parts
◆ splicePart()
Mime::MultiPartRelatedMessage::splicePart |
( |
data |
mime_data, |
|
|
string |
id, |
|
|
string |
content_type, |
|
|
*hash< auto > |
hdr |
|
) |
| |
adds a message part to the start of the list
- Parameters
-
mime_data | the data for the part |
id | the multipart/related ID for the part |
content_type | the content_type for the part |
hdr | an optional hash of headers for the part |
- Exceptions
-
MULTIPART-RELATED-ERROR | if the id parameter is empty, this exception is thrown |