rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWMimeMultipartType Class Reference
[MIME]

Represents a Content-Type value with the media type multipart. More...

#include <rw/mime/RWMimeMultipartType.h>

Inheritance diagram for RWMimeMultipartType:
RWMimeContentType RWHandleBase RWMimeMultipartRelatedType

List of all members.

Public Member Functions

 RWMimeMultipartType (void)
 RWMimeMultipartType (const RWCString &subType, const RWCString &boundary="")
 RWMimeMultipartType (const RWMimeMultipartType &second)
 RWMimeMultipartType (const RWMimeContentType &second)
RWMimeMultipartTypeoperator= (const RWMimeMultipartType &second)
virtual ~RWMimeMultipartType (void)
RWCString getBoundary (void) const
void setBoundary (const RWCString &boundary)

Protected Member Functions

virtual bool checkType (const RWCString &mediaType, const RWCString &subType) const

Detailed Description

RWMimeMultipartType represents a Content-Type value with the media type multipart. As the name implies, the body of a multipart MIME part contains other MIME parts. The MIME specification requires that the header for a multipart Content-Type header contain a boundary parameter. The value of that parameter forms the boundary between the contained parts. For example, the message below specifies a multipart/alternative Content-Type with the boundary uniquestring.

 MIME-Version: 1.0
 Content-Type: multipart/alternative; boundary=uniquestring
 From: Rudi Marquez <rudi_marquez@roguewave.com>
 To: Andy Roture <roture@example.org>
 Date: Tue, 30 Oct 2001 08:00:53 -0700 (PDT)
 Subject: A multipart/alternative message

 Preamble text.

 --uniquestring
 Content-Type: text/plain; charset=US-ASCII

 The message (in plain text).
 --uniquestring
 Content-Type: text/html; charset=US-ASCII

 The message (in bold HTML text).
 --uniquestring--

This class inherits general purpose functions for working with a parameter list and provides convenience functions for working with the boundary parameter.

An instance of this class is a handle to a private, reference-counted body.

Reference

RWMimeMultipartType conforms to the multipart Content-Type header requirements specified in RFC 2046, section 5.1 (p. 12).


Constructor & Destructor Documentation

RWMimeMultipartType::RWMimeMultipartType ( void   ) 

Default constructor. Constructs a multipart Content-Type value with the subtype "mixed". The value contains a boundary parameter with a boundary created by RWMimeUtils::getUniqueBoundary().

RWMimeMultipartType::RWMimeMultipartType ( const RWCString subType,
const RWCString boundary = "" 
)

Constructs a multipart Content-Type value with the subtype subType. The value contains a boundary parameter with the value boundary. If no boundary is provided, a boundary value is created using RWMimeUtils::getUniqueBoundary(). The RWCString should contain 7-bit US-ASCII data.

RWMimeMultipartType::RWMimeMultipartType ( const RWMimeMultipartType second  ) 

Copy constructor. Constructs a new handle to the body second refers to.

RWMimeMultipartType::RWMimeMultipartType ( const RWMimeContentType second  ) 

Conversion constructor. Constructs a new handle to the body second refers to. Throws RWMimeError if the media type of second is not "multipart".

virtual RWMimeMultipartType::~RWMimeMultipartType ( void   )  [virtual]

Destructor.


Member Function Documentation

virtual bool RWMimeMultipartType::checkType ( const RWCString mediaType,
const RWCString subType 
) const [protected, virtual]

Returns true if mediaType is "multipart". The RWCString should contain 7-bit US-ASCII data.

Reimplemented from RWMimeContentType.

Reimplemented in RWMimeMultipartRelatedType.

RWCString RWMimeMultipartType::getBoundary ( void   )  const

Returns the value of self's boundary parameter, or an empty string if self does not contain a boundary parameter. The RWCString should contain 7-bit US-ASCII data.

RWMimeMultipartType& RWMimeMultipartType::operator= ( const RWMimeMultipartType second  ) 

Assignment operator. Makes self a handle identical to second.

void RWMimeMultipartType::setBoundary ( const RWCString boundary  ) 

Sets the value of self's boundary parameter. The RWCString should contain 7-bit US-ASCII data.

Note:
The RWMimeUtils::getUniqueBoundary() function generates boundary strings.
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.