SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWMimeHeader &second)
 
 RWMimeVersionHeader (const RWMimeVersionHeader &second)
 
 RWMimeVersionHeader (unsigned majorVersion, unsigned minorVersion)
 
 RWMimeVersionHeader (void)
 
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 (const RWCString &label)
 
 RWMimeHeader (const RWMimeHeader &second)
 
 RWMimeHeader (void)
 
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
 

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 (const RWHandleBase &second)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (void)
 
 ~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() [1/4]

RWMimeVersionHeader::RWMimeVersionHeader ( void )

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

◆ RWMimeVersionHeader() [2/4]

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() [3/4]

RWMimeVersionHeader::RWMimeVersionHeader ( const RWMimeVersionHeader & second)

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

◆ RWMimeVersionHeader() [4/4]

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

◆ ~RWMimeVersionHeader()

virtual RWMimeVersionHeader::~RWMimeVersionHeader ( void )
virtual

Destructor.

Member Function Documentation

◆ body()

RWMimeVersionHeaderImp & RWMimeVersionHeader::body ( void ) const
protected

Returns a reference to the underlying implementation.

◆ checkLabel()

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.

◆ getMajorVersion()

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.

◆ getMinorVersion()

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.

◆ operator=()

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

Assignment operator. Makes self a copy of second.

◆ setVersion()

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

◆ Label

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.