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

BodyPart Class Reference

Inheritance diagram for BodyPart:

Entity Node List of all members.

Detailed Description

BodyPart represents a body part, as described in RFC 2045 and RFC 2046. A body part is an entity, so it has a collection of header fields and a body. A body part is different from a message in that a body part is contained in a multipart body.

In Hunny MIME++, BodyPart is a subclass of the abstract class Entity; therefore, it contains both a Headers object and a Body object. 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().

In the document tree representation of a message, a BodyPart is an intermediate node. Its parent node is the Body object that contains it. Its child nodes are the Headers and Body objects it contains.


Public Member Functions

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

Static Public Member Functions

BodyPartnewBodyPart ()
 Creates a new instance.

Static Public Attributes

BodyPart *(* sNewBodyPart )()
 Provides a class factory hook.


Constructor & Destructor Documentation

BodyPart  ) 
 

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

BodyPart const BodyPart other  ) 
 

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

Parameters:
other BodyPart instance to copy

BodyPart const String str,
Node parent = 0
 

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

~BodyPart  )  [virtual]
 

Destructor


Member Function Documentation

Node * clone  )  const [virtual]
 

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

Returns:
a copy of this object

Implements Node.

BodyPart * newBodyPart  )  [static]
 

Creates a new BodyPart object.

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

Returns:
new BodyPart instance
See also:
sNewBodyPart

const BodyPart & operator= const BodyPart other  ) 
 

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

Parameters:
other BodyPart instance to copy


Member Data Documentation

BodyPart *(* sNewBodyPart)()=0 [static]
 

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

See also:
newBodyPart()

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