SourcePro® 2024.1 |
SourcePro® API Reference Guide |
Represents the Content-Type
header of a MIME part.
More...
#include <rw/mime/RWMimeContentTypeHeader.h>
Public Member Functions | |
RWMimeContentTypeHeader (const RWMimeContentType &contentType) | |
RWMimeContentTypeHeader (const RWMimeContentTypeHeader &second) | |
RWMimeContentTypeHeader (const RWMimeHeader &second) | |
RWMimeContentTypeHeader (void) | |
virtual | ~RWMimeContentTypeHeader (void) |
RWMimeContentType | getContentType (void) const |
RWMimeContentTypeHeader & | operator= (const RWMimeContentTypeHeader &second) |
void | setContentType (const RWMimeContentType &contentType) |
Public Member Functions inherited from RWMimeHeader | |
RWMimeHeader (const RWCString &label) | |
RWMimeHeader (const RWMimeHeader &second) | |
RWMimeHeader (void) | |
virtual | ~RWMimeHeader (void) |
RWCString | asString (void) const |
void | fromString (const RWCString &headerString) |
RWCString | getLabel (void) const |
RWMimeHeader & | operator= (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 |
Static Public Attributes | |
static const RWCString | Label |
Protected Member Functions | |
RWMimeContentTypeHeaderImp & | 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 (const RWHandleBase &second) | |
RWHandleBase (RWBodyBase *body) | |
RWHandleBase (RWStaticCtor) | |
RWHandleBase (void) | |
~RWHandleBase (void) | |
RWBodyBase & | body (void) const |
RWHandleBase & | operator= (const RWHandleBase &second) |
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
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::RWMimeContentTypeHeader | ( | void | ) |
Default constructor. Constructs a header with the label "Content-Type"
and an empty value.
RWMimeContentTypeHeader::RWMimeContentTypeHeader | ( | const RWMimeContentType & | contentType | ) |
Constructs a header with the label "Content-Type"
and the value contentType.
RWMimeContentTypeHeader::RWMimeContentTypeHeader | ( | const RWMimeContentTypeHeader & | second | ) |
Copy constructor. Constructs a new handle to the body second refers to.
RWMimeContentTypeHeader::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 |
Destructor
|
protected |
Returns a reference to the underlying implementation.
|
protectedvirtual |
Returns true
if label matches "Content-Type"
, false
otherwise. The comparison is case-insensitive. The RWCString should contain 7-bit US-ASCII data.
Reimplemented from RWMimeHeader.
RWMimeContentType RWMimeContentTypeHeader::getContentType | ( | void | ) | const |
Returns the value of this header as an RWMimeContentType.
RWMimeContentTypeHeader & RWMimeContentTypeHeader::operator= | ( | const RWMimeContentTypeHeader & | second | ) |
Assignment operator. Makes self a handle identical to second.
void RWMimeContentTypeHeader::setContentType | ( | const RWMimeContentType & | contentType | ) |
Sets the Content-Type this header contains to contentType.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |