Inheritance diagram for Headers:

In the document tree representation of a message, a Headers object is an intermediate node, having both a parent node and several child nodes. The parent node is the Entity object that contains it. The child nodes are the Field objects in the list it manages. (See the man page for Node for a discussion of the tree representation of a message.)
Normally, you do not create a Headers object directly, but you access it through the Entity::headers() member function of Entity, which creates the Headers object for you.
You may use public methods in Headers for adding, removing, or accessing the Field objects it contains. Alternatively, you may use the convenience functions Headers provides. You may call the member functions to(), from(), contentType(), and other similar member functions to directly access the field bodies of the most common structured header fields. These member functions also create Field and FieldBody objects if necessary. For example, if you call to() to access the To header field body, and the To header field does not exist, the function will create it for you. You may call hasField() to check if a particular header field exists. For example, to check if the Content-Type header field exists, call the member function hasField("Content-Type"). You may call fieldBody() to directly access the field body of any header field. If the field does not exist, fieldBody() creates it.
Public Member Functions | |
| Headers () | |
| Default constructor. | |
| Headers (const Headers &other) | |
| Copy constructor. | |
| Headers (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~Headers () |
| Destructor. | |
| const Headers & | operator= (const Headers &other) |
| Assignment operator. | |
| virtual void | parse () |
| Parses the string representation. | |
| virtual void | assemble () |
| Assembles the string representation. | |
| virtual Node * | clone () const |
| Creates a copy of this object. | |
| int | numFields () const |
| Gets the number of header fields in the list. | |
| void | addField (Field *field) |
| Adds a header field to the end of the list. | |
| void | deleteAllFields () |
| Deletes all header fields in the list. | |
| Field & | fieldAt (int index) const |
| Gets the header field at the specified position in the list. | |
| void | insertFieldAt (int index, Field *field) |
| Inserts a header field at the specified position in the list. | |
| Field * | removeFieldAt (int index) |
| Removes the header field at the specified position in the list. | |
| bool | hasField (const char *fieldName) const |
| Returns true if the specified header field is present. | |
| FieldBody & | fieldBody (const char *fieldName) |
| Gets the field body of the specified header field. | |
| AddressList & | bcc () |
| Gets the field body of the Bcc header field. | |
| AddressList & | cc () |
| Gets the field body of the Cc header field. | |
| DateTime & | date () |
| Gets the field body of the Date header field. | |
| MailboxList & | from () |
| Gets the field body of the From header field. | |
| MsgId & | messageId () |
| Gets the field body of the Message-Id header field. | |
| Stamp & | received () |
| Gets the field body of the Received header field. | |
| AddressList & | replyTo () |
| Gets the field body of the Reply-To header field. | |
| AddressList & | resentBcc () |
| Gets the field body of the Resent-Bcc header field. | |
| AddressList & | resentCc () |
| Gets the field body of the Resent-Cc header field. | |
| DateTime & | resentDate () |
| Gets the field body of the Resent-Date header field. | |
| MailboxList & | resentFrom () |
| Gets the field body of the Resent-From header field. | |
| MsgId & | resentMessageId () |
| Gets the field body of the Resent-%Message-Id header field. | |
| AddressList & | resentReplyTo () |
| Gets the field body of the Resent-Reply-To header field. | |
| Mailbox & | resentSender () |
| Gets the field body of the Resent-Sender header field. | |
| AddressList & | resentTo () |
| Gets the field body of the Resent-To header field. | |
| Address & | returnPath () |
| Gets the field body of the Return-Path header field. | |
| Mailbox & | sender () |
| Gets the field body of the Sender header field. | |
| Text & | subject () |
| Gets the field body of the Subject header field. | |
| AddressList & | to () |
| Gets the field body of the To header field. | |
| MsgId & | contentId () |
| Gets the field body of the Content-Id header field. | |
| TransferEncodingType & | contentTransferEncoding () |
| Gets the field body of the Content-Transfer-Encoding header field. | |
| MediaType & | contentType () |
| Gets the field body of the Content-Type header field. | |
| DispositionType & | contentDisposition () |
| Gets the field body of the Content-Dispostion header field. | |
| Field * | findField (const char *fieldName) const |
| Searches for the specified field. | |
| int | findFieldPos (const char *fieldName) const |
| Searches for the specified field. | |
Static Public Member Functions | |
| Headers * | newHeaders () |
| Creates a new instance. | |
Static Public Attributes | |
| Headers *(* | sNewHeaders )() |
| Provides a class factory hook. | |
Protected Member Functions | |
| void | _copyFields (const Headers &headers) |
| Copies all header fields from another list. | |
| void | _addField (Field *field) |
| Adds a header field to the end of the list. | |
| void | _insertFieldAt (int index, Field *field) |
| Inserts a header field at the specified position in the list. | |
| Field * | _removeFieldAt (int index) |
| Removes the header field at the specified position in the list. | |
| void | _deleteAllFields () |
| Deletes all header fields in the list. | |
|
|
This constructor sets the Headers object's string representation to the empty string and sets its parent node to NULL. |
|
|
This constructor performs a deep copy of its argument. The parent node of the new Headers object is set to NULL.
|
|
||||||||||||
|
This constructor sets the Headers object's string representation to str and sets its parent node to parent. Normally, you call the virtual function parse() immediately after this constructor to create the broken-down representation.
|
|
|
Destructor |
|
|
Same as addField(), but does not set the is-modified flag.
|
|
|
Copies the list of Field objects from headers. Assumes the list in this Headers object is emtpy. Does not set the is-modified flag.
|
|
|
Same as deleteAllFields(), but does not set the is-modified flag.
|
|
||||||||||||
|
Same as insertFieldAt(), but does not set the is-modified flag.
|
|
|
Same as removeFieldAt(), but does not set the is-modified flag.
|
|
|
Adds field to the end of the header field list. The Headers destructor deletes the Field objects in the list.
|
|
|
This virtual function, inherited from Node, executes the assemble operation for Headers objects. The assemble operation creates or updates the string representation from the broken-down representation. For Headers objects, the assemble operation builds the string representation from its list of Field objects. Before it builds the string representation for the Headers object, this member function calls the assemble() member function of each Field object in its list. You should call this member function after you set or modify any of the contained header fields, and before you retrieve the string representation. This function clears the is-modified flag. Implements Node. |
|
|
Gets the field body of the Bcc header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Cc header field. If the field does not exist, the function creates it.
|
|
|
This virtual function, inherited from Node, creates a new Headers object that has the same value as this Headers object. The parent node of the new Headers object is set to NULL.
Implements Node. |
|
|
Gets the field body of the Content-Disposition header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Content-ID header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Content-Transfer-Encoding header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Content-Type header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Date header field. If the field does not exist, the function creates it.
|
|
|
Removes and deletes all Field objects in the header field list. |
|
|
Gets the Field object at position index in the header field list. The function's behavior is undefined if index is out of range. Valid values for index are 0 <= index < numFields().
|
|
|
Gets a reference to the FieldBody object for the header field with field name fieldName. If the header field does not exist, the function creates it. You may call hasField() to test if the header field exists without creating it.
|
|
|
Searches for a header field by its field name. If the field is not found, the function returns NULL.
|
|
|
Searches for a header field by its field name. If the function finds the field, it returns the index of the field. Otherwise, the function returns -1.
|
|
|
Gets the field body of the From header field. If the field does not exist, the function creates it.
|
|
|
Returns true if a field with the specified name exists.
|
|
||||||||||||
|
Inserts field into the header field list at position index. If index is zero, then the function inserts field into the first position in the list. If index equals numFields(), then the function inserts field into the last position in the list. If index is less than numFields(), then the function moves the Field objects at position index or greater to a higher position in the list. The Headers destructor deletes the Field objects in the list. The function's behavior is undefined if index is out of range. Valid values for index are 0 <= index <= numFields().
|
|
|
Gets the field body of the Message-ID header field. If the field does not exist, the function creates it.
|
|
|
Creates a new Headers object. If the static data member sNewHeaders is NULL, this member function creates a new Headers object and returns it. Otherwise, newHeaders() calls the user-supplied function that sNewHeaders points to and returns the object created by that function.
|
|
|
Gets the number of Field objects in the header field list.
|
|
|
Performs a deep copy of its argument. The parent node of this Headers object is not changed.
|
|
|
This virtual function, inherited from Node, executes the parse operation for Headers objects. The parse operation creates or updates the broken-down representation from the string representation. For Headers objects, the parse operation parses the string representation to create a list of Field objects. This member function also calls the parse() member function of each Field object in its list. You should call this member function after you set or modify the string representation, and before you access any of the contained header fields. This function clears the is-modified flag. Implements Node. |
|
|
Gets the field body of the Received header field. If the field does not exist, the function creates it.
|
|
|
Removes the Field object at position index from the header field list and returns it. If index is less than numFields()-1, then the function moves the Field objects at position (index + 1) or greater to a lower position in the list. The function's behavior is undefined if index is out of range. Valid values for index are 0 <= index < numFields().
|
|
|
Gets the field body of the Reply-To header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-Bcc header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-Cc header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-Date header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-From header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-%Message-ID header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-Reply-To header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-Sender header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Resent-To header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Return-Path header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Sender header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the Subject header field. If the field does not exist, the function creates it.
|
|
|
Gets the field body of the To header field. If the field does not exist, the function creates it.
|
|
|
If sNewHeaders is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of Headers.
|
Copyright © 2001-2007 Hunny Software, Inc. All rights reserved.