SourcePro® API Reference Guide

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

Represents the MIME-Version header of a MIME message. More...

#include <rw/mime/RWMimeVersionHeader.h>

Inheritance diagram for RWMimeVersionHeader:
RWMimeHeader RWHandleBase

Public Member Functions

 RWMimeVersionHeader (void)
 
 RWMimeVersionHeader (unsigned majorVersion, unsigned minorVersion)
 
 RWMimeVersionHeader (const RWMimeVersionHeader &second)
 
 RWMimeVersionHeader (const RWMimeHeader &second)
 
virtual ~RWMimeVersionHeader (void)
 
unsigned getMajorVersion (void) const
 
unsigned getMinorVersion (void) const
 
RWMimeVersionHeaderoperator= (const RWMimeVersionHeader &second)
 
void setVersion (unsigned majorVersion, unsigned minorVersion)
 
- 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

RWMimeVersionHeaderImp & 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

RWMimeVersionHeader represents the MIME-Version header of a MIME message. The header states the version of MIME to which the message conforms. The MIME specification requires that each MIME message contain a MIME-Version header.

Note
RFC 2045 specifies a version number of 1.0.

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

Reference
RWMimeVersionHeader conforms to the MIME-Version header requirements specified in RFC 2045, Section 4 (p.8).

Constructor & Destructor Documentation

RWMimeVersionHeader::RWMimeVersionHeader ( void  )

Default constructor. Constructs a header with the label "MIME-Version" and the value "1.0".

RWMimeVersionHeader::RWMimeVersionHeader ( unsigned  majorVersion,
unsigned  minorVersion 
)

Constructs a header with the label "MIME-Version" and a value constructed from majorVersion and minorVersion. For example, when majorVersion is 1 and minorVersion is 0, the new header contains the value "1.0".

RWMimeVersionHeader::RWMimeVersionHeader ( const RWMimeVersionHeader second)

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

RWMimeVersionHeader::RWMimeVersionHeader ( const RWMimeHeader second)

Conversion constructor. Constructs a new handle to the body second refers to. Throws RWMimeError if second does not have the label "MIME-Version".

virtual RWMimeVersionHeader::~RWMimeVersionHeader ( void  )
virtual

Destructor.

Member Function Documentation

RWMimeVersionHeaderImp& RWMimeVersionHeader::body ( void  ) const
protected

Returns a reference to the underlying implementation.

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

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

Reimplemented from RWMimeHeader.

unsigned RWMimeVersionHeader::getMajorVersion ( void  ) const

Returns the major version number of self's value. For example, when self's value is "1.0", returns 1.

unsigned RWMimeVersionHeader::getMinorVersion ( void  ) const

Returns the major version number of self's value. For example, when self's value is "1.0", returns 0.

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

Assignment operator. Makes self a copy of second.

void RWMimeVersionHeader::setVersion ( unsigned  majorVersion,
unsigned  minorVersion 
)

Sets the value of self to majorVersion and minorVersion. For example, when majorVersion is 1 and minorVersion is 0, self's value is set to "1.0".

Member Data Documentation

const RWCString RWMimeVersionHeader::Label
static

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

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