Module: Internet Protocols Module Package: MIME
RWMimeContentTypeHeaderRWMimeHeaderRWHandleBase
body() checkLabel() |
getContentType() Label |
operator=() RWMimeContentTypeHeader() |
setContentType() ~RWMimeContentTypeHeader() |
#include <rw/mime/RWMimeContentTypeHeader.h>
RWMimeContentTypeHeader represents the Content-Type header of a MIME part. The header specifies the type of data the part contains so that a recipient can process the data correctly. A Content-Type contains two elements, a media type and a subtype. The media type describes the content in broad terms, while the subtype describes the specific content. The two-level hierarchy allows both flexibility and precision.
For example, a plain text email message generally has the content type text/plain, whereas an HTML document has the content type text/html, and an XML document has the content type text/xml. In all three cases, the basic format of the document is text, and the document can be considered text for many purposes (such as deciding whether the document can be usefully opened within a text editor). The subtype indicates the specific format of the text message. While an HTML document can be displayed as plain text, rendering the document in a browser or opening the document in an HTML editor may be more appropriate.
Some content types require other parameters which contain additional information. For example, the MIME specification requires all multipart content type values to contain a boundary parameter which specifies the delimiter for message parts. A complete Content-Type header for a multipart/mixed message
Content-Type: multipart/mixed; boundary=unique-string
has the label Content-Type and the value multipart/mixed; boundary=unique-string. The value itself contains the media type multipart, the subtype mixed, and a single parameter with the name boundary and the value unique-string.
Since the value of a Content-Type header has a complex structure, RWMimeContentType provides a convenient representation of a Content-Type value. See RWMimeContentType for details.
An instance of this class is a handle to a private, reference-counted body.
RWMimeContentTypeHeader conforms to the Content-Type header requirements specified in RFC 2045, Section 5. For details on the content types the MIME specification defines, see RFC 2046.
static const RWCString Label;
Static constant string containing "Content-Type", the label for a Content-Type header. The RWCString should contain 7-bit US-ASCII data.
RWMimeContentTypeHeader(void);
Default constructor. Constructs a header with the label "Content-Type" and an empty value.
NOTE -- A header with an empty value does not meet the requirements for a Content-Type header.
RWMimeContentTypeHeader(const RWMimeContentType& contentType);
Constructs a header with the label "Content-Type" and the value contentType.
RWMimeContentTypeHeader(const RWMimeContentTypeHeader& second);
Copy constructor. Constructs a new handle to the body second refers to.
RWMimeContentTypeHeader(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-Type".
virtual ~RWMimeContentTypeHeader(void);
Destructor.
RWMimeContentTypeHeader& operator=(const RWMimeContentTypeHeader& second);
Assignment operator. Makes self a handle identical to second.
RWMimeContentType getContentType(void) const;
Returns the value of this header as an RWMimeContentType.
void setContentType(const RWMimeContentType& contentType);
Sets the value of this header to contentType.
RWMimeContentTypeHeaderImp& body(void) const;
Returns a reference to the underlying implementation.
virtual bool checkLabel(const RWCString& label) const;
Returns true if label matches "Content-Type", 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.