Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Node Class Reference

Inheritance diagram for Node:

Body EncodedWord Entity Field FieldBody Headers Parameter BodyPart Message Address AddressList DateTime DispositionType MailboxList MediaType MsgId Stamp Text TransferEncodingType List of all members.

Detailed Description

Node is the root of an inheritance hierarchy that includes many classes in Hunny MIME++. All classes that represent MIME document components are subclasses of Node. The Node class defines important features that are inherited by these subclasses. These features are the following:


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 Nodeoperator= (const Node &other)
 Assignment operator.
virtual void parse ()=0
 Parses the string representation.
virtual void assemble ()=0
 Assembles the string representation.
virtual Nodeclone () 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 StringgetString () const
 Gets the string representation.
Nodeparent () 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.
const class Classclass_ () 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.
NodemParent
 Parent node.
const class ClassmClass
 Pointer to the singleton Class instance.


Constructor & Destructor Documentation

Node  ) 
 

This constructor sets the Node object's string representation to the empty string and sets its parent node to NULL.

Node const Node other  ) 
 

This constructor performs a deep copy of its argument. The parent node of the new Node object is set to NULL.

Parameters:
other Node instance to copy

Node const String str,
Node parent = 0
 

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.

Parameters:
str initial value for the string representation
parent parent node for this object

~Node  )  [virtual]
 

Destructor


Member Function Documentation

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.

Parameters:
str new value for the string representation
See also:
setString()

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.

See also:
parse().

Implemented in Parameter, FieldBody, MsgId, EncodedWord, Text, Mailbox, AddressList, MailboxList, Group, DateTime, DispositionType, Stamp, TransferEncodingType, MediaType, Field, Headers, Body, and Entity.

const 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++.

Returns:
singleton Class instance

Node * clone  )  const [pure virtual]
 

Creates a new object that has the same type and value as this object.

Returns:
a clone of 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.

Returns:
the string representation
See also:
assemble().

bool isModified  )  const
 

Returns true if the is-modified flag is set.

Returns:
true if the is-modified flag is set

const Node & operator= const Node other  ) 
 

Performs a deep copy of its argument. The parent node is not changed.

Parameters:
other instance to copy

Node * parent  )  const
 

Gets the parent node.

Returns:
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.

See also:
assemble().

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.

Parameters:
parent the parent node

void setString const char *  cstr  ) 
 

Sets the string representation.

cstr must be NUL-terminated.

Normally, you call the virtual function parse() immediately after this function to update the broken-down representation.

Parameters:
cstr new value for the string representation
See also:
parse()

void setString const String str  ) 
 

Sets the string representation.

Normally, you call the virtual function parse() immediately after this function to update the broken-down representation.

Parameters:
str new value for the string representation
See also:
parse()

Copyright © 2001-2007 Hunny Software, Inc. All rights reserved.