SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWMimeMultipartRelatedType Class Reference

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

#include <rw/mime/RWMimeMultipartRelatedType.h>

Inheritance diagram for RWMimeMultipartRelatedType:
RWMimeMultipartType RWMimeContentType RWHandleBase

Public Member Functions

 RWMimeMultipartRelatedType (const RWCString &type, const RWCString &start="", const RWCString &start_info="", const RWCString &boundary="")
 
 RWMimeMultipartRelatedType (const RWMimeContentType &second)
 
 RWMimeMultipartRelatedType (const RWMimeMultipartRelatedType &second)
 
 RWMimeMultipartRelatedType (void)
 
virtual ~RWMimeMultipartRelatedType (void)
 
RWCString getStart (void) const
 
RWCString getStartInfo (void) const
 
RWCString getType (void) const
 
RWMimeMultipartRelatedTypeoperator= (const RWMimeMultipartRelatedType &second)
 
void setStart (const RWCString &contentId)
 
void setStartInfo (const RWCString &startInfo)
 
void setType (const RWCString &type)
 
- Public Member Functions inherited from RWMimeMultipartType
 RWMimeMultipartType (const RWCString &subType, const RWCString &boundary="")
 
 RWMimeMultipartType (const RWMimeContentType &second)
 
 RWMimeMultipartType (const RWMimeMultipartType &second)
 
 RWMimeMultipartType (void)
 
virtual ~RWMimeMultipartType (void)
 
RWCString getBoundary (void) const
 
RWMimeMultipartTypeoperator= (const RWMimeMultipartType &second)
 
void setBoundary (const RWCString &boundary)
 
- Public Member Functions inherited from RWMimeContentType
 RWMimeContentType (const RWCString &mediaType, const RWCString &subType, const RWMimeParameterList &parameters=RWMimeParameterList())
 
 RWMimeContentType (const RWMimeContentType &second)
 
 RWMimeContentType (void)
 
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
 

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 (const RWHandleBase &second)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (void)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

Detailed Description

RWMimeMultipartRelatedType represents a Content-Type value with the media type multipart and the subtype related. A multipart/related MIME part contains a set of other MIME parts intended for use as a whole. For example, a single multipart/related message can contain an HTML page and the images referenced in the page.

A multipart/related Content-Type value includes parameters describing how the recipient should process the message.

  • The start parameter declares the Content-ID of the part which a recipient should process first. For example, a message containing an HTML page and images uses the Content-ID of the HTML page as the value of the start parameter. This parameter is optional. If the parameter is not present, the first part in the message will be processed first.
  • The type parameter declares the Content-Type of the part which a recipient should process first. For example, a message containing an HTML page and images uses "text/html" as the value of the type parameter.
  • The start-info parameter provides additional information to the receiving application. For example, a typical use of this parameter is to provide command-line arguments for the receiving application. This parameter is optional and should only be used when the message is intended for a specific application.
  • The boundary parameter contains a string used to separate the parts of the message.

RWMimeMultipartRelatedType inherits general purpose functions for working with a parameter list and convenience functions for working with the boundary parameter. The class provides functions for working with the type parameter, the start parameter, and the start-info parameter.

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

Reference
RWMimeMultipartRelatedType conforms to the requirements in RFC 2837 for the value of a multipart/related Content-Type header.

Constructor & Destructor Documentation

◆ RWMimeMultipartRelatedType() [1/4]

RWMimeMultipartRelatedType::RWMimeMultipartRelatedType ( void )

Default constructor. Constructs a multipart/related Content-Type value. The new value does not contain a type parameter, a start parameter, or a start-info parameter. The constructor creates a boundary value using RWMimeUtils::getUniqueBoundary().

Note
A default-constructed RWMimeMultipartRelatedType is invalid. A multipart/related content type must contain a type parameter.

◆ RWMimeMultipartRelatedType() [2/4]

RWMimeMultipartRelatedType::RWMimeMultipartRelatedType ( const RWCString & type,
const RWCString & start = "",
const RWCString & start_info = "",
const RWCString & boundary = "" )

Constructs a multipart/related Content-Type value with the given parameters. If no argument is provided for start or start_info, the new value does not contain a start parameter or a start-info parameter. If no boundary is provided, the constructor creates a boundary value using RWMimeUtils::getUniqueBoundary(). The RWCString should contain 7-bit US-ASCII data.

Note
The multipart/related specification requires the value of the type parameter to match the actual Content-Type of the document to be processed first. The constructor itself cannot enforce this requirement.

◆ RWMimeMultipartRelatedType() [3/4]

RWMimeMultipartRelatedType::RWMimeMultipartRelatedType ( const RWMimeMultipartRelatedType & second)

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

◆ RWMimeMultipartRelatedType() [4/4]

RWMimeMultipartRelatedType::RWMimeMultipartRelatedType ( const RWMimeContentType & second)

Conversion constructor. Constructs a new handle to the body second refers to. Throws RWMimeParseError if second is not a multipart/related content type.

◆ ~RWMimeMultipartRelatedType()

virtual RWMimeMultipartRelatedType::~RWMimeMultipartRelatedType ( void )
virtual

Destructor.

Member Function Documentation

◆ checkType()

virtual bool RWMimeMultipartRelatedType::checkType ( const RWCString & mediaType,
const RWCString & subType ) const
protectedvirtual

Returns true if mediaType matches "multipart" and subType matches "related". Both comparisons are case-insensitive. The RWCString should contain 7-bit US-ASCII data.

Reimplemented from RWMimeMultipartType.

◆ getStart()

RWCString RWMimeMultipartRelatedType::getStart ( void ) const

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

◆ getStartInfo()

RWCString RWMimeMultipartRelatedType::getStartInfo ( void ) const

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

◆ getType()

RWCString RWMimeMultipartRelatedType::getType ( void ) const

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

◆ operator=()

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

Assignment operator. Makes self a handle identical to second.

◆ setStart()

void RWMimeMultipartRelatedType::setStart ( const RWCString & contentId)

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

Note
The multipart/related specification requires the value of the start parameter to match the Content-ID of a part contained in the MIME message. The function itself cannot enforce this requirement.

◆ setStartInfo()

void RWMimeMultipartRelatedType::setStartInfo ( const RWCString & startInfo)

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

◆ setType()

void RWMimeMultipartRelatedType::setType ( const RWCString & type)

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

Note
The multipart/related specification requires the value of the type parameter to match the actual Content-Type of the document to be processed first. The function itself cannot enforce this requirement.

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