Inheritance diagram for FieldBody:

In the document tree representation of a message, a FieldBody object may be either a leaf node, having a parent node but no child nodes, or an intermediate node, having both a parent node and one or more child nodes. The parent node is the Field object that contains it. The child nodes, if present, depend on the particular subclass of FieldBody. An AddressList object, for example, has Address objects as its child nodes.
Many header fields, such as the "Date" header field, have structured field bodies. For those header fields, the structured field body is represented by a subclass of FieldBody. Other header fields, such as the "Content-Description" header field, have unstructured field bodies. For those header fields, the unstructured field body is represented by the FieldBody class itself.
You may call the inherited member function getString() to get the text of the field body. Alternatively, you may call the member function text() to get the unfolded text of the field body. You may call the inherited member function setString() to set the text of the field body. Alternatively, you may call setText() to set the text and the library will fold long lines for you.
Some MIME parsers are broken in that they do not handle the folding of some fields properly. FieldBody folds its string representation by default. You can disable folding, however, by calling the setFoldingEnabled() member function. To determine if folding is enabled, call isFoldingEnabled().
Public Member Functions | |
| FieldBody () | |
| Default constructor. | |
| FieldBody (const FieldBody &other) | |
| Copy constructor. | |
| FieldBody (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~FieldBody () |
| Destructor. | |
| const FieldBody & | operator= (const FieldBody &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. | |
| const String & | text () const |
| Gets the unfolded text of the field body. | |
| void | setText (const String &text) |
| Sets the unfolded text of the field body. | |
| void | maybeFold () |
| Folds the string representation, if enabled. | |
| bool | isFoldingEnabled () const |
| Returns true if line folding is enabled. | |
| void | setFoldingEnabled (bool b) |
| Enables or disables line folding. | |
Static Public Member Functions | |
| String | fold (const String &unfolded, int offset) |
| Performs line folding on its argument. | |
| String | unfold (const String &folded) |
| Performs line unfolding on its argument. | |
| FieldBody * | newFieldBody () |
| Creates a new instance. | |
Static Public Attributes | |
| FieldBody *(* | sNewFieldBody )() |
| Provides a class factory hook. | |
|
|
This constructor sets the FieldBody 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 FieldBody object is set to NULL.
|
|
||||||||||||
|
This constructor sets the FieldBody 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 |
|
|
This virtual function, inherited from Node, executes the assemble operation for FieldBody objects. The assemble operation creates or updates the string representation from the broken-down representation. For FieldBody objects, the assemble operation does nothing, because FieldBody does not have a broken-down representation. (Subclasses of FieldBody, however, override this virtual function.) Implements Node. Reimplemented in MsgId, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, and MediaType. |
|
|
This virtual function, inherited from Node, creates a new FieldBody object that has the same value as this FieldBody object. The parent node of the new FieldBody object is set to NULL.
Implements Node. Reimplemented in MsgId, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, and MediaType. |
|
||||||||||||
|
Performs line folding on its argument. The parameter offset indicates how much space should be reserved in the first line for the header field name.
|
|
|
Returns a boolean indicating if the folding of this field body is enabled.
|
|
|
Folds the string representation, if line folding is enabled. This member function can be called from the assemble() member function of subclasses. |
|
|
Creates a new FieldBody object. If the static data member sNewFieldBody is NULL, this member function creates a new FieldBody object and returns it. Otherwise, newFieldBody() calls the user-supplied function that sNewFieldBody points to and returns the object created by that function.
|
|
|
Performs a deep copy of its argument. The parent node of this FieldBody object is not changed.
|
|
|
This virtual function, inherited from Node, executes the parse operation for FieldBody objects. The parse operation creates or updates the broken-down representation from the string representation. For FieldBody objects, the parse operation does nothing, because FieldBody does not have a broken-down representation. (Subclasses of FieldBody, however, override this virtual function.) Implements Node. Reimplemented in MsgId, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, and MediaType. |
|
|
Enables (b = true) or disables (b = false) the folding of this field body. The default is to fold fields.
|
|
|
Sets the unfolded text of the field body. Long lines in Internet mail must be "folded" according to RFC 2822. This function is a convenience function that folds the text in its argument and sets the folded text into the field body.
|
|
|
Gets the unfolded text of the field body. Long lines in Internet mail must be "folded" according to RFC 2822. This function is a convenience function that unfolds the text of the field body before returning it.
|
|
|
Performs line unfolding on its argument.
|
|
|
If sNewFieldBody is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of FieldBody.
|
Copyright © 2001-2007 Hunny Software, Inc. All rights reserved.