Module: Internet Protocols Module Package: MIME
RWMimeContentLocationHeaderRWMimeHeaderRWHandleBase
body() checkLabel() |
getURI() Label |
operator=() RWMimeContentLocationHeader() |
setURI() ~RWMimeContentLocationHeader() |
#include <rw/mime/RWMimeContentLocationHeader.h>
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.
RWMimeContentLocationHeader conforms to the Content-Location header requirements specified in RFC 2557, Section 4.2. RFC 1630 specifies the format for a URI.
static const RWCString Label;
Static constant string containing "Content-Location", the label for a Content-Location header. The RWCString should contain 7-bit US-ASCII data.
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(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(const RWMimeContentLocationHeader& second);
Copy constructor. Constructs a new handle to the body second refers to.
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();
Destructor.
RWMimeContentLocationHeader& operator=(const RWMimeContentLocationHeader& second);
Assignment operator. Makes self a handle identical to second.
RWCString getURI(void) const;
Returns the location URI contained within this header. The RWCString should contain 7-bit US-ASCII data.
void setURI(const RWCString& uri);
Sets the location URI contained within this header. The RWCString should contain 7-bit US-ASCII data.
RWMimeStructuredHeaderImp& body(void) const;
Returns a reference to the underlying implementation.
virtual bool checkLabel(const RWCString& label) const;
Returns true if label matches "Content-Location", false otherwise. The comparison is case-insensitive. The RWCString should contain 7-bit US-ASCII data.
© 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.