SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Represents Internet Message Format headers other than the headers defined by MIME. More...
#include <rw/mime/RWMimeGenericHeader.h>
Public Member Functions | |
RWMimeGenericHeader (void) | |
RWMimeGenericHeader (const RWCString &label, const RWCString &value) | |
RWMimeGenericHeader (const RWMimeGenericHeader &second) | |
RWMimeGenericHeader (const RWMimeHeader &second) | |
RWMimeGenericHeader & | operator= (const RWMimeGenericHeader &second) |
virtual | ~RWMimeGenericHeader (void) |
RWCString | getValue (void) const |
void | setValue (const RWCString &value) |
Protected Member Functions | |
virtual bool | checkLabel (const RWCString &label) const |
RWMimeUnstructuredHeaderImp & | body (void) const |
RWMimeGenericHeader represents Internet Message Format headers other than the headers defined by MIME. A header consists of a label and a value. MIME requires that both the label and value contain only printable characters in the US-ASCII character set. The name may not contain a colon. To create a header with a value in another character set, encode the value according to the guidelines in RFC 2047.
The label appears first in the header, and is separated from the value by a colon. So, the header line
From: Rudi Marquez <rudi_marqez@roguewave.com>
contains the label From
, a colon as a separator, and the value Rudi Marquez <rudi_marquez@roguewave.com>
. RWMimeGenericHeader represents this structure by containing a pair of strings, one string for the label and one string for the value.
This class only represents headers which are not defined in the MIME specification. For MIME headers, use the class corresponding to the header instead. The class enforces this constraint by refusing to accept a label for another header type. The constructors and assignment operator throw RWMimeError if the label provided is a label for any other header type.
An instance of this class is a handle to a private, reference-counted body.
RWMimeGenericHeader conforms to the header requirements specified in Section 2.2 (p. 7) of RFC 2822, the Internet Message Format specification. RFC 2822 is an update of RFC 822, which originally defined the format for Internet message headers.
RWMimeGenericHeader::RWMimeGenericHeader | ( | void | ) |
Default constructor. Constructs a header with an empty label and an empty value.
Constructs a header with the given label and value. Does not verify that the strings provided meet the requirements for an Internet Message Format header. Throws RWMimeError if label is the label for one of the other header classes. The RWCString should contain 7-bit US-ASCII data.
RWMimeGenericHeader::RWMimeGenericHeader | ( | const RWMimeGenericHeader & | second | ) |
Copy constructor. Constructs a new handle to the body second refers to.
RWMimeGenericHeader::RWMimeGenericHeader | ( | const RWMimeHeader & | second | ) |
Conversion constructor. Constructs a new handle to the body second refers to. Throws RWMimeError if the label of second is the label for one of the other header classes.
virtual RWMimeGenericHeader::~RWMimeGenericHeader | ( | void | ) | [virtual] |
Destructor.
RWMimeUnstructuredHeaderImp& RWMimeGenericHeader::body | ( | void | ) | const [protected] |
Returns a reference to the underlying implementation.
Reimplemented from RWMimeHeader.
virtual bool RWMimeGenericHeader::checkLabel | ( | const RWCString & | label | ) | const [protected, virtual] |
Returns true
if label is not the label for one of the other header classes, false
otherwise. The RWCString should contain 7-bit US-ASCII data.
Reimplemented from RWMimeHeader.
RWCString RWMimeGenericHeader::getValue | ( | void | ) | const |
Returns the value of this header. The RWCString should contain 7-bit US-ASCII data.
RWMimeGenericHeader& RWMimeGenericHeader::operator= | ( | const RWMimeGenericHeader & | second | ) |
Assignment operator. Makes self a handle identical to second. Throws RWMimeError if the label of second is the label for one of the other header classes.
© 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.