Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Internet Protocols Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWMimeHeader

Module:  Internet Protocols Module   Package:  MIME


RWMimeHeaderRWHandleBase

Local Index

Members

Header File

#include <rw/mime/RWMimeHeader.h> 

Description

RWMimeHeader is a base class for classes that represent message headers as defined in the Internet Message format specification (RFC 2822). 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 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

contains the label From, a colon as a separator, and the value

The Internet Message Format does not define the structure or meaning of a value. Therefore, RWMimeHeader does not define an interface for working with a header value. Just as each individual header in the specification defines the structure and semantics of its value, each derived class implements its own interface for working with the header value.

An instance of RWMimeHeader is a handle to a private, reference-counted body. Note that the body is always a specific header implementation.

Classes that contain MIME headers collect the headers as instances of RWMimeHeader. Each derived class contains a conversion constructor which creates a new derived-class handle to the implementation of the RWMimeHeader. Conversion happens automatically when an RWMimeHeader is assigned to a handle of the appropriate type. For example,

In the code above, the getHeader() function returns an RWMimeHeader. Because RWMimeVersionHeader provides a conversion constructor from RWMimeHeader, the compiler automatically invokes that conversion constructor. The result is a completely typesafe assignment; no downcast is required. The conversion is also efficient, since the conversion constructor simply creates a new handle to the existing implementation.

Reference

RWMimeHeader conforms to the header requirements specified in Section 2.2 of the Internet Message Specification, RFC 2822. RFC 2822 is an update of RFC 822, which originally defined the format for Internet Message headers.

Public Constructor

RWMimeHeader(void);

NOTE -- A header with an empty label and an empty value does not meet the requirements of an Internet Message Format header.
RWMimeHeader(const RWCString& label);

NOTE -- A header with an empty value does not meet the requirements of an Internet Message Format header.
RWMimeHeader(const RWMimeHeader& second);

Public Destructor

virtual ~RWMimeHeader(void);

Public Member Operators

RWMimeHeader&
operator=(const RWMimeHeader& second);

Related Logical Operators

bool
operator==(const RWMimeHeader& first,
           const RWMimeHeader& second);
bool
operator!=(const RWMimeHeader& first,
           const RWMimeHeader& second);

Public Member Functions

RWCString
asString(void) const;
void
fromString(const RWCString& headerString);
RWCString
getLabel(void) const;

Protected Member Functions

RWMimeHeaderImp&
body(void) const;
virtual bool
checkLabel(const RWCString& label) const;


Previous fileTop of DocumentContentsIndex pageNext file

© 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.