
Public Member Functions | |
| Entity () | |
| Default constructor. | |
| Entity (const Entity &other) | |
| Copy constructor. | |
| Entity (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~Entity () |
| Destructor. | |
| const Entity & | operator= (const Entity &other) |
| Assignment operator. | |
| virtual void | parse () |
| Parses the string representation. | |
| virtual void | assemble () |
| Assembles the string representation. | |
| class Headers & | headers () const |
| Gets the header fields of the entity. | |
| class Body & | body () const |
| Gets the body of the entity. | |
In the document tree representation of a message, an Entity object may be either a root node, having child nodes but no parent node, or an intermediate node, having both a parent node and child nodes. An Entity object that is a root node should be a Message object. If an Entity object is an intermediate node, its parent should be a Body object. The child nodes of an Entity object are the Headers and Body objects it contains.
Since Entity is an abstract base class, you cannot create instances of it directly. Entity has two derived classes, Message and BodyPart, which are concrete classes.
To access the contained Headers object, use the member function headers(). To access the contained Body object, use the member function body().
| Entity | ( | ) |
This constructor sets the Entity 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 Entity object is set to NULL.
| other | Entity instance to copy |
This constructor sets the Entity 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.
| str | initial value for the string representation | |
| parent | parent node for this object |
| ~Entity | ( | ) | [virtual] |
Destructor
| void assemble | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the assemble operation for Entity objects. The assemble operation creates or updates the string representation from the broken-down representation. For Entity objects, the assemble operation builds the string representation from the contained Headers and Body objects. Before it builds the string representation for the Entity object, this member function calls the assemble() member functions of the contained Headers and Body objects.
You should call this member function after you modify either the contained headers or body, and before you retrieve the string representation.
This function clears the is-modified flag.
Implements Node.
| Body & body | ( | ) | const |
Gets the body of the entity.
| Headers & headers | ( | ) | const |
Gets the header fields of the entity.
Performs a deep copy of its argument. The parent node of this Entity object is not changed.
| other | Entity instance to copy |
| void parse | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the parse operation for Entity objects. The parse operation creates or updates the broken-down representation from the string representation. For Entity objects, the parse operation parses the string representation and sets the values of the Headers and Body objects it contains. This member function also calls the parse() member functions of the contained Headers and Body objects.
You should call this member function after you set or modify the string representation, and before you access either the contained headers or body.
This function clears the is-modified flag.
Implements Node.
Copyright © 2001-2009 Hunny Software, Inc. All rights reserved.