
Public Member Functions | |
| Node () | |
| Default constructor. | |
| Node (const Node &other) | |
| Copy constructor. | |
| Node (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~Node () |
| Destructor. | |
| const Node & | operator= (const Node &other) |
| Assignment operator. | |
| virtual void | parse ()=0 |
| Parses the string representation. | |
| virtual void | assemble ()=0 |
| Assembles the string representation. | |
| virtual Node * | clone () const =0 |
| Creates a copy of this object. | |
| void | setString (const String &str) |
| Sets the string representation. | |
| void | setString (const char *cstr) |
| Sets the string representation. | |
| const String & | getString () const |
| Gets the string representation. | |
| Node * | parent () const |
| Gets the parent node. | |
| void | setParent (Node *parent) |
| Sets the parent node. | |
| bool | isModified () const |
| Gets the is-modified flag. | |
| void | setModified () |
| Sets the is-modified flag. | |
| class Class & | class_ () const |
| Gets a reference to the singleton Class instance. | |
| void | _setString (const String &str) |
| Sets the string representation. | |
Protected Attributes | |
| String | mString |
| String representation | |
| bool | mIsModified |
| Is-modified flag. | |
| Node * | mParent |
| Parent node. | |
| class Class * | mClass |
| Pointer to the singleton Class instance. | |
Normally, you can ignore the is-modified flag. The assemble() function always checks the is-modified flag and returns immediately if the flag is cleared. The library uses the is-modified flag to optimize the assemble() function.
To maintain consistency in the tree, whenever a node's is-modified flag is set, the node requests its parent to also set its is-modified flag. In this way, an is-modified flag set anywhere in the tree always propagates to the root node.
| Node | ( | ) |
This constructor sets the Node 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 Node object is set to NULL.
| other | Node instance to copy |
This constructor sets the Node 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 |
| ~Node | ( | ) | [virtual] |
Destructor
| void _setString | ( | const String & | str | ) |
Sets the string representation.
This is an advanced function that the library itself uses. It is public so that developers may extend the library. Unlike setString(), this function does not set the is-modified flag of the parent node.
| str | new value for the string representation |
| void assemble | ( | ) | [pure virtual] |
This pure virtual function executes the assemble operation. The assemble operation creates or updates the string representation from the broken-down representation. The assemble operation is the opposite of the parse operation. Before creating or updating the string representation, the assemble operation invokes the assemble operation of each of its child nodes. If the is-modifed flag for a Node is cleared, the assemble() function will return immediately without calling the assemble() function of any of its child nodes, and without updating the string representation.
This function clears the is-modified flag.
Implemented in Parameter, FieldBody, MsgId, EncodedWord, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, MediaType, Field, Headers, Body, and Entity.
| class Class & class_ | ( | ) | const |
Gets a reference to the singleton Class instance.
The Class class provides run-time type information about objects in Hunny MIME++.
| Node * clone | ( | ) | const [pure virtual] |
Creates a new object that has the same type and value as this object.
Implemented in Parameter, FieldBody, MsgId, EncodedWord, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, MediaType, Field, Headers, Body, BodyPart, and Message.
| const String & getString | ( | ) | const |
Gets the string representation.
If the broken-down representation and the string representation are not consistent, you should call the assemble() member function before you call getString(), so that the string representation will be updated first.
| bool isModified | ( | ) | const |
Returns true if the is-modified flag is set.
Performs a deep copy of its argument. The parent node is not changed.
| other | instance to copy |
| Node * parent | ( | ) | const |
Gets the parent node.
| void parse | ( | ) | [pure virtual] |
This virtual function executes the parse operation. The parse operation creates or updates the broken-down representation from the string representation. The parse operation is the opposite of the assemble operation. In some derived classes, such as Headers, the parse operation also creates the child nodes of the object. (In the case of Headers, the child nodes are Field objects that represent the header fields contained in the headers.) The parse() member function calls the parse() member functions of all the object's child nodes.
This function clears the is-modified flag.
Implemented in Parameter, FieldBody, MsgId, EncodedWord, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, MediaType, Field, Headers, Body, and Entity.
| void setModified | ( | ) |
Sets the is-modified flag and requests the parent node to set its is-modified flag.
| void setParent | ( | Node * | parent | ) |
Sets the parent node.
| parent | the parent node |
| void setString | ( | const char * | cstr | ) |
| void setString | ( | const String & | str | ) |
Copyright © 2001-2009 Hunny Software, Inc. All rights reserved.