SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions
RWMimeContentLocationHeader Class Reference

Represents the Content-Location header of a MIME part. More...

#include <rw/mime/RWMimeContentLocationHeader.h>

Inheritance diagram for RWMimeContentLocationHeader:
RWMimeHeader RWHandleBase

Public Member Functions

 RWMimeContentLocationHeader (void)
 
 RWMimeContentLocationHeader (const RWCString &uri)
 
 RWMimeContentLocationHeader (const RWMimeContentLocationHeader &second)
 
 RWMimeContentLocationHeader (const RWMimeHeader &second)
 
virtual ~RWMimeContentLocationHeader (void)
 
RWCString getURI (void) const
 
RWMimeContentLocationHeaderoperator= (const RWMimeContentLocationHeader &second)
 
void setURI (const RWCString &uri)
 
- Public Member Functions inherited from RWMimeHeader
 RWMimeHeader (void)
 
 RWMimeHeader (const RWCString &label)
 
 RWMimeHeader (const RWMimeHeader &second)
 
virtual ~RWMimeHeader (void)
 
RWCString asString (void) const
 
void fromString (const RWCString &headerString)
 
RWCString getLabel (void) const
 
RWMimeHeaderoperator= (const RWMimeHeader &second)
 
- 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
 

Static Public Attributes

static const RWCString Label
 

Protected Member Functions

RWMimeStructuredHeaderImp & body (void) const
 
virtual bool checkLabel (const RWCString &label) const
 
- Protected Member Functions inherited from RWMimeHeader
RWMimeHeaderImp & 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

RWMimeContentLocationHeader represents the Content-Location header of a MIME part. The Content-Location header declares a URI for the MIME part containing the header. When a part declares a URI, the part can be referenced from elsewhere in the message by using the URI. This header is specified for use in multipart/related messages, which typically contain an HTML document and a set of images referenced in that document.

For example, a MIME part containing an image can set the URI for the image with a Content-Location header:

Content-Location: images/logo.gif

An HTML document in the same message can reference the image using the URI:

<IMG SRC="images/logo.gif">

By setting a URI for each image within the message, the complete set of files needed to render an HTML document can be included in a message without changing the text of the HTML document.

The value of a Content-Location header must meet the format requirements for a URI. The value does not, however, need to indicate an actual resource reachable through the Internet.

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

Reference
RWMimeContentLocationHeader conforms to the Content-Location header requirements specified in RFC 2557, Section 4.2 (p. 7). RFC1630 specifies the format for a URI.

Constructor & Destructor Documentation

RWMimeContentLocationHeader::RWMimeContentLocationHeader ( void  )

Default constructor. Constructs a header with the label "Content-Location" and an empty value.

Note
A header with an empty value does not meet the requirements for a Content-Location header.
RWMimeContentLocationHeader::RWMimeContentLocationHeader ( const RWCString uri)

Constructs a header with the label "Content-Location" and the value uri. Does not validate uri. The RWCString should contain 7-bit US-ASCII data.

RWMimeContentLocationHeader::RWMimeContentLocationHeader ( const RWMimeContentLocationHeader second)

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

RWMimeContentLocationHeader::RWMimeContentLocationHeader ( const RWMimeHeader second)

Conversion constructor. Constructs a new handle to the body second refers to. Throws RWMimeError if second does not have the label "Content-Location".

virtual RWMimeContentLocationHeader::~RWMimeContentLocationHeader ( void  )
virtual

Destructor.

Member Function Documentation

RWMimeStructuredHeaderImp& RWMimeContentLocationHeader::body ( void  ) const
protected

Returns a reference to the underlying implementation.

virtual bool RWMimeContentLocationHeader::checkLabel ( const RWCString label) const
protectedvirtual

Returns true if label matches "Content-Location", false otherwise. The comparison is case-insensitive. The RWCString should contain 7-bit US-ASCII data.

Reimplemented from RWMimeHeader.

RWCString RWMimeContentLocationHeader::getURI ( void  ) const

Returns the location URI contained within this header. The RWCString should contain 7-bit US-ASCII data.

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

Assignment operator. Makes self a handle identical to second.

void RWMimeContentLocationHeader::setURI ( const RWCString uri)

Sets the location URI contained within this header. The RWCString should contain 7-bit US-ASCII data.

Member Data Documentation

const RWCString RWMimeContentLocationHeader::Label
static

Static constant string containing "Content-Location", the label for a Content-Location header. The RWCString should contain 7-bit US-ASCII data.

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