SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions
RWMimeContentIdHeader Class Reference

Represents the Content-ID header of a MIME part. More...

#include <rw/mime/RWMimeContentIdHeader.h>

Inheritance diagram for RWMimeContentIdHeader:
RWMimeHeader RWHandleBase

Public Member Functions

 RWMimeContentIdHeader (void)
 
 RWMimeContentIdHeader (const RWCString &id)
 
 RWMimeContentIdHeader (const RWMimeContentIdHeader &second)
 
 RWMimeContentIdHeader (const RWMimeHeader &second)
 
virtual ~RWMimeContentIdHeader (void)
 
RWCString getId (void) const
 
RWMimeContentIdHeaderoperator= (const RWMimeContentIdHeader &second)
 
void setId (const RWCString &id)
 
- Public Member Functions inherited from RWMimeHeader
 RWMimeHeader (void)
 
 RWMimeHeader (const RWCString &label)
 
 RWMimeHeader (const RWMimeHeader &second)
 
virtual ~RWMimeHeader (void)
 
RWCString asString (void) const
 
void fromString (const RWCString &headerString)
 
RWCString getLabel (void) const
 
RWMimeHeaderoperator= (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
 
bool operator== (const RWHandleBase &second) const
 

Static Public Attributes

static const RWCString Label
 

Protected Member Functions

RWMimeStructuredHeaderImp & 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 (void)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (const RWHandleBase &second)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

Detailed Description

RWMimeContentIdHeader represents the Content-ID header of a MIME part. The header is designed to allow external references to a MIME part. Therefore, the MIME format requires that the value of the header be world-unique. For example, a MIME message might contain the Content-ID header:

Content-ID: <part.0014@roguewave.example>

In general, a MIME message contains one Content-ID header at the top level of the message. For multipart/alternative messages, the MIME specification suggests that each alternative have a different Content-ID header unless all alternatives contain equivalent information.

An instance of this class is a handle to a private, reference-counted body.

Reference
RWMimeContentIdHeader conforms to the Content-ID header requirements specified in RFC 2045, Section 7 (p. 26). For a discussion of Content-ID and multipart/alternative messages, see RFC 2046 Section 5.1.4 (p. 24).

Constructor & Destructor Documentation

RWMimeContentIdHeader::RWMimeContentIdHeader ( void  )

Default constructor. Constructs a Content-ID header with the empty string for a value. Since the empty string is not world-unique, a default-constructed RWMimeContentIdHeader does not meet the requirements of the MIME format.

Note
A header with an empty value does not meet the requirements for a Content-ID header.
RWMimeContentIdHeader::RWMimeContentIdHeader ( const RWCString id)

Constructs a Content-ID header with the value id. The RWCString should contain 7-bit US-ASCII data.

Note
This constructor cannot verify that the provided id is world-unique.
RWMimeContentIdHeader::RWMimeContentIdHeader ( const RWMimeContentIdHeader second)

Copy constructor. Constructs a new handle to the body second refers to.

RWMimeContentIdHeader::RWMimeContentIdHeader ( 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-ID".

virtual RWMimeContentIdHeader::~RWMimeContentIdHeader ( void  )
virtual

Destructor.

Member Function Documentation

RWMimeStructuredHeaderImp& RWMimeContentIdHeader::body ( void  ) const
protected

Returns a reference to the underlying implementation.

virtual bool RWMimeContentIdHeader::checkLabel ( const RWCString label) const
protectedvirtual

Returns true if label matches "Content-ID", false otherwise. The comparison is case-insensitive. The RWCString should contain 7-bit US-ASCII data.

Reimplemented from RWMimeHeader.

RWCString RWMimeContentIdHeader::getId ( void  ) const

Returns the content ID value of this header. The RWCString should contain 7-bit US-ASCII data.

RWMimeContentIdHeader& RWMimeContentIdHeader::operator= ( const RWMimeContentIdHeader second)

Assignment operator. Makes self a handle identical to second.

void RWMimeContentIdHeader::setId ( const RWCString id)

Sets the content ID value of this header. The RWCString should contain 7-bit US-ASCII data.

Note
This function cannot verify that the provided id is world-unique.

Member Data Documentation

const RWCString RWMimeContentIdHeader::Label
static

Static constant string containing "Content-ID", the label for a Content-ID header. The RWCString should contain 7-bit US-ASCII data.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.