|
Yate
|
Abstract MIME data holder. More...
#include <yatemime.h>
Static Public Member Functions | |
| static MimeBody * | build (const char *buf, int len, const MimeHeaderLine &type) |
| static String * | getUnfoldedLine (const char *&buf, int &len) |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Protected Member Functions | |
| MimeBody (const String &type) | |
| MimeBody (const MimeHeaderLine &type) | |
| virtual void | buildBody () const =0 |
Protected Attributes | |
| DataBlock | m_body |
| ObjList | m_headers |
Abstract MIME data holder.
Abstract base class for holding Multipurpose Internet Mail Extensions data. Keeps a Content-Type header line with body type and parameters and any additional header lines the body may have. The body type contains lower case characters.
Constructor to be used only by derived classes. Converts the MIME type string to lower case
| type | The value of the Content-Type header line |
|
protected |
Constructor to be used only by derived classes. Builds this body from a header line. Converts the MIME type string to lower case
| type | The content type header line |
|
inline |
Append an additional header line to this body
| hdr | The header line to append |
References ObjList::append(), and MimeBody::m_headers.
Get the binary data of this MIME body without building it.
References MimeBody::m_body.
Referenced by MimeMultipartBody::appendBody(), and MimeMultipartBody::removeBody().
Method to build a MIME body from a type and data buffer. Unknown body types are built into a binary body. Exactly 1 leading CRLF is removed from the beginning of the buffer if found before building it
| buf | Pointer to buffer of data just after the body headers |
| len | Length of data in buffer |
| type | The header line declaring the body's content. Usually this is a Content-Type header line |
Method that is called internally to build the binary encoded body
Implemented in MimeMultipartBody, MimeSdpBody, MimeBinaryBody, MimeStringBody, and MimeLinesBody.
Build a string with this body's header lines
| buf | Destination string |
References MimeHeaderLine::buildHeaders(), MimeHeaderLine::buildLine(), and MimeBody::m_headers.
Duplicate this MIME body
Implemented in MimeMultipartBody, MimeSdpBody, MimeBinaryBody, MimeStringBody, and MimeLinesBody.
Remove a header parameter
| name | Parameter's name |
| header | Header whose parameter will be removed. Set to 0 to use the body's content type header |
| MimeHeaderLine * findHdr | ( | const String & | name, |
| const MimeHeaderLine * | start = 0 |
||
| ) | const |
Find an additional header line by its name. The names are compared case insensitive
| name | The name of the header to find |
| start | The starting point in the list. 0 to start from the beginning |
Retrieve the binary encoding of this MIME body. Build the body if empty. The body doesn't contain the Content-Type header or the additional headers
Get the first body that matches a requested type, descends into multiparts
| type | Name of the MIME type to search for |
RTTI method, get a pointer to a derived class given the class name
| name | Name of the class we are asking for |
Reimplemented from GenObject.
Reimplemented in MimeMultipartBody, MimeSdpBody, MimeBinaryBody, MimeStringBody, and MimeLinesBody.
Get a header parameter
| name | Parameter's name |
| header | Header whose parameter will be retrieved. Set to 0 to use the body's content type header |
|
inline |
Retrieve the MIME type of this body
Utility method, returns an unfolded line and advances the pointer
| buf | Reference to pointer to start of buffer data |
| len | Reference to variable holding buffer length |
Retrieve the additional headers of this MIME body (other then Content-Type)
References MimeBody::m_headers.
Check if this body is multipart (can hold other MIME bodies)
Reimplemented in MimeMultipartBody.
Check if this body is a Session Description Protocol
Reimplemented in MimeSdpBody.
|
inline |
Remove an additional header line from this body
| hdr | The header line to remove |
| delobj | True to delete the header, false to remove from list without deleting it |
References MimeBody::m_headers, and ObjList::remove().
Replace the value of an existing parameter or add a new one
| name | Parameter's name |
| value | Parameter's value |
| header | Header whose parameter will be changed. Set to 0 to use the body's content type header |
|
mutableprotected |
Block of binary data that buildBody() must fill
Referenced by MimeBody::body().
|
protected |
Additional body headers (other then Content-Type)
Referenced by MimeBody::appendHdr(), MimeBody::buildHeaders(), MimeBody::headers(), and MimeBody::removeHdr().