SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions | Protected Member Functions
RWMimeMultipartType Class Reference

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

#include <rw/mime/RWMimeMultipartType.h>

Inheritance diagram for RWMimeMultipartType:
RWMimeContentType RWHandleBase RWMimeMultipartRelatedType

Public Member Functions

 RWMimeMultipartType (void)
 
 RWMimeMultipartType (const RWCString &subType, const RWCString &boundary="")
 
 RWMimeMultipartType (const RWMimeMultipartType &second)
 
 RWMimeMultipartType (const RWMimeContentType &second)
 
virtual ~RWMimeMultipartType (void)
 
RWCString getBoundary (void) const
 
RWMimeMultipartTypeoperator= (const RWMimeMultipartType &second)
 
void setBoundary (const RWCString &boundary)
 
- Public Member Functions inherited from RWMimeContentType
 RWMimeContentType (void)
 
 RWMimeContentType (const RWCString &mediaType, const RWCString &subType, const RWMimeParameterList &parameters=RWMimeParameterList())
 
 RWMimeContentType (const RWMimeContentType &second)
 
virtual ~RWMimeContentType (void)
 
RWCString asString (void) const
 
size_t findParameter (const RWCString &name, size_t start=0) const
 
void fromString (const RWCString &contentType)
 
RWCString getMediaType (void) const
 
RWMimeParameter getParameter (size_t i) const
 
size_t getParameterCount (void) const
 
RWCString getParameterValue (const RWCString &name, size_t start=0) const
 
RWCString getSubType (void) const
 
void insertParameter (const RWMimeParameter &parameter)
 
RWMimeContentTypeoperator= (const RWMimeContentType &second)
 
void removeAllParameters (void)
 
void removeParameter (size_t position)
 
void setParameterValue (const RWCString &name, const RWCString &value, size_t start=0)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator< (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Protected Member Functions

virtual bool checkType (const RWCString &mediaType, const RWCString &subType) const
 
- Protected Member Functions inherited from RWMimeContentType
RWMimeContentTypeImp & body (void) const
 
- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (void)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (const RWHandleBase &second)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

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
protectedvirtual

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.

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.