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

Message Class Reference

Inheritance diagram for Message:

Entity Node List of all members.

Detailed Description

Message represents an RFC 2822/MIME message.

A message contains both a collection of header fields and a body. In the terminology of RFC 2045, the general term for the headers-body combination is entity. In Hunny MIME++, Message is a direct subclass of Entity, and therefore contains both a Headers object and a Body object.

In the document tree representation of a message, a Message object is almost always a root node, having child nodes but no parent node. The child nodes are the Headers object and the Body object it contains. A Message may sometimes be an intermediate node. In this special case, the parent node is a Body object of type "message/rfc822" and the Message object represents an encapsulated message.

To access the contained Headers object, use the inherited member function Entity::headers(). To access the contained Body object, use the inherited member function Entity::body().


Public Member Functions

 Message ()
 Default constructor.
 Message (const Message &other)
 Copy constructor.
 Message (const String &str, Node *parent=0)
 Constructor that takes an initial string and parent node.
virtual ~Message ()
 Destructor.
const Messageoperator= (const Message &other)
 Assignment operator.
virtual Nodeclone () const
 Creates a copy of this object.

Static Public Member Functions

MessagenewMessage ()
 Creates a new instance.

Static Public Attributes

Message *(* sNewMessage )()
 Provides a class factory hook.


Constructor & Destructor Documentation

Message  ) 
 

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

Message const Message other  ) 
 

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

Parameters:
other Message instance to copy

Message const String str,
Node parent = 0
 

This constructor sets the Message 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

~Message  )  [virtual]
 

Destructor


Member Function Documentation

Node * clone  )  const [virtual]
 

This virtual function, inherited from Node, creates a new Message object that has the same value as this Message object. The parent node of the new Message object is set to NULL.

Returns:
a copy of this object

Implements Node.

Message * newMessage  )  [static]
 

Creates a new Message object.

If the static data member sNewMessage is NULL, this member function creates a new Message object and returns it. Otherwise, newMessage() calls the user-supplied function that sNewMessage points to and returns the object created by that function.

Returns:
new Message instance
See also:
sNewMessage

const Message & operator= const Message other  ) 
 

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

Parameters:
other Message instance to copy


Member Data Documentation

Message *(* sNewMessage)()=0 [static]
 

If sNewMessage is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of Message.

See also:
newMessage()

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