Module: Internet Protocols Module Package: MIME
RWMimeGenericHeaderRWMimeHeaderRWHandleBase
#include <rw/mime/RWMimeGenericHeader.h>
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 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(void);
Default constructor. Constructs a header with an empty label and an empty value.
NOTE -- A header with an empty label and an empty value does not meet the requirements of an Internet Message Format header.
RWMimeGenericHeader(const RWCString& label, const RWCString& 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(const RWMimeGenericHeader& second);
Copy constructor. Constructs a new handle to the body second refers to.
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(void);
Destructor.
RWMimeHeader& 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.
RWCString getValue(void) const;
Returns the value of this header. The RWCString should contain 7-bit US-ASCII data.
void setValue(const RWCString& value);
Sets the value of this header to value. The RWCString should contain 7-bit US-ASCII data.
RWMimeUnstructuredHeaderImp& body(void) const;
Returns a reference to the underlying implementation.
virtual bool checkLabel(const RWCString& label) const;
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.
© 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.