#include <writemime.h>
Public Member Functions | |
virtual void | setTextEncodePref (encoding ec) |
Set encoding preference for 8 bit text: either 8bit or quoted-printable. | |
virtual void | setCharSet (const char *cs) |
Set the character set for a TEXT body. | |
virtual int | setBody (const char *bp, int blen, type tp=TEXT, const char *stp="plain") |
Create body from data buffer. | |
virtual int | setBodyAttach (const char *filename, type tp=APPLICATION, const char *stp="octet-stream") |
Create body by attaching file (will be encoded in BASE64). | |
virtual int | size () |
Compute storage size, including final 0 byte. | |
virtual const char * | format () |
Return malloc'd, 0-terminated buffer of formatted contents. | |
virtual int | format (char *buf) |
Format into caller buffer, which must be at least size() bytes wide. |
int WriteMime::DiscreteEntity::setBody | ( | const char * | bp, | |
int | blen, | |||
type | tp = TEXT , |
|||
const char * | stp = "plain" | |||
) | [virtual] |
Create body from data buffer.
If the type is TEXT, the buffer transfer-encoding will be 7BIT if the data is ascii, or else either QP or 8BIT (depending on textencodepref).
If the type is not TEXT, the buffer will be encoded in BASE64.
bp | points to body text (no need for final 0, may be binary). | |
blen | is the input buffer size. | |
tp | MIME type for data. | |
stp | MIME subtype. |
References WriteMime::base64Encode(), WriteMime::qpEncode(), and WriteMime::Entity::seterror().
int WriteMime::DiscreteEntity::setBodyAttach | ( | const char * | filename, | |
type | tp = APPLICATION , |
|||
const char * | stp = "octet-stream" | |||
) | [virtual] |
Create body by attaching file (will be encoded in BASE64).
filename | file name. | |
tp | MIME type for data. | |
stp | MIME subtype. |
References WriteMime::Entity::addHeaderField(), and WriteMime::base64EncodeFile().