rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWMimeContentDisposition Class Reference
[MIME]

Represents the value of a Content-Disposition header of a MIME part. More...

#include <rw/mime/RWMimeContentDisposition.h>

Inheritance diagram for RWMimeContentDisposition:
RWHandleBase

List of all members.

Public Member Functions

 RWMimeContentDisposition (void)
 RWMimeContentDisposition (const RWCString &type, const RWCString &filename="")
 RWMimeContentDisposition (const RWMimeContentDisposition &second)
RWMimeContentDispositionoperator= (const RWMimeContentDisposition &second)
virtual ~RWMimeContentDisposition (void)
RWCString getType (void) const
void setType (const RWCString &type)
RWCString getFilename (void) const
void setFilename (const RWCString &filename)
RWCString asString (void) const
void fromString (const RWCString &dispositionValue)
size_t getParameterCount (void) const
RWMimeParameter getParameter (size_t i) const
RWCString getParameterValue (const RWCString &name, size_t start=0) const
void setParameterValue (const RWCString &name, const RWCString &value, size_t start=0)
void insertParameter (const RWMimeParameter &parameter)
void removeParameter (size_t position)
size_t findParameter (const RWCString &name, size_t start=0) const
void removeAllParameters (void)

Protected Member Functions

RWMimeContentDispositionImp & body (void) const

Private Member Functions

bool operator< (const RWHandleBase &second) const

Friends

bool operator== (const RWMimeContentDisposition &first, const RWMimeContentDisposition &second)
bool operator!= (const RWMimeContentDisposition &first, const RWMimeContentDisposition &second)

Detailed Description

RWMimeContentDisposition represents the value of a Content-Disposition header of a MIME part. The Content-Disposition specifies the way in which a recipient should present the part.

The value of a Content-Disposition header contains a disposition type and an optional filename parameter. This class provides a convenient interface for creating and working with Content-Disposition values.

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

Reference

RWMimeContentDisposition conforms to the "Content-Disposition" header requirements in RFC 1806.


Constructor & Destructor Documentation

RWMimeContentDisposition::RWMimeContentDisposition ( void   ) 

Default constructor. Constructs a value with no disposition type and no filename parameter.

Note:
A Content-Disposition value with no disposition type does not meet the requirements of RFC 1806.
RWMimeContentDisposition::RWMimeContentDisposition ( const RWCString type,
const RWCString filename = "" 
)

Constructs a value with the given disposition type type. If filename is not empty, adds a filename parameter with a value of filename to the new object. The RWCString should contain 7-bit US-ASCII data.

RWMimeContentDisposition::RWMimeContentDisposition ( const RWMimeContentDisposition second  ) 

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

virtual RWMimeContentDisposition::~RWMimeContentDisposition ( void   )  [virtual]

Destructor.


Member Function Documentation

RWCString RWMimeContentDisposition::asString ( void   )  const

Returns a string representation of self. The returned string is formatted as specified by RFC 1806 for a Content-Disposition header value. Throws RWMimeError if self cannot be represented as valid MIME. The RWCString should contain 7-bit US-ASCII data.

RWMimeContentDispositionImp& RWMimeContentDisposition::body ( void   )  const [protected]

Returns a reference to the underlying implementation.

Reimplemented from RWHandleBase.

size_t RWMimeContentDisposition::findParameter ( const RWCString name,
size_t  start = 0 
) const

Returns the index of the first parameter in the collection with a name matching name, or RW_NPOS if no parameter with that name is present. Begins searching at position start. Uses a case-insensitive comparison to match name. The RWCString should contain 7-bit US-ASCII data.

void RWMimeContentDisposition::fromString ( const RWCString dispositionValue  ) 

Populates self from dispositionValue. Throws RWMimeParseError if dispositionValue is not in the format of a Content-Disposition value.

A Content-Disposition value must contain a disposition type, and may contain a filename parameter. So, for example, inline;filename="bluebox.jpg" is a valid dispositionValue. The RWCString should contain 7-bit US-ASCII data.

RWCString RWMimeContentDisposition::getFilename ( void   )  const

Returns the value of self's filename parameter, or the empty string if no filename parameter is present.

RWMimeParameter RWMimeContentDisposition::getParameter ( size_t  i  )  const

Returns the parameter at the specified position. Throws RWBoundsErr if i is greater than or equal to getParameterCount().

size_t RWMimeContentDisposition::getParameterCount ( void   )  const

Returns the total number of parameters in self.

RWCString RWMimeContentDisposition::getParameterValue ( const RWCString name,
size_t  start = 0 
) const

Returns the value of the first parameter that contains a name matching name, or the empty string if no such parameter is present. Begins searching at start. Matches parameter names using a case-insensitive string comparison to match name. The RWCString should contain 7-bit US-ASCII data.

RWCString RWMimeContentDisposition::getType ( void   )  const

Returns self's disposition type. The RWCString should contain 7-bit US-ASCII data.

void RWMimeContentDisposition::insertParameter ( const RWMimeParameter parameter  ) 

Inserts parameter at the end of self's parameter list.

bool RWMimeContentDisposition::operator< ( const RWHandleBase second  )  const [private]

Required for collections based on Standard C++ Library collections. (Redefine this operator in derived classes, as necessary.) Throws no exceptions.

Reimplemented from RWHandleBase.

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

Assignment operator. Makes self a handle identical to second.

void RWMimeContentDisposition::removeAllParameters ( void   ) 

Removes all parameters from self.

void RWMimeContentDisposition::removeParameter ( size_t  position  ) 

Removes the parameter at the specified position. Throws RWBoundsErr if position is greater than or equal to getParameterCount().

void RWMimeContentDisposition::setFilename ( const RWCString filename  ) 

Sets the value of self's filename parameter. Does not validate filename.

void RWMimeContentDisposition::setParameterValue ( const RWCString name,
const RWCString value,
size_t  start = 0 
)

Changes the value of the first parameter that contains a name matching name to value. If no matching parameter exists, creates a new parameter and inserts the new parameter into self's parameter list. Begins searching at start. Matches parameter names using a case-insensitive string comparison. The RWCString should contain 7-bit US-ASCII data.

void RWMimeContentDisposition::setType ( const RWCString type  ) 

Sets self's disposition type. Does not validate type. The RWCString should contain 7-bit US-ASCII data.


Friends And Related Function Documentation

bool operator!= ( const RWMimeContentDisposition first,
const RWMimeContentDisposition second 
) [friend]

Inequality operator. Returns true if first is not equal to second, false otherwise. The function compares the disposition types using a case-insensitive string comparison. Compares the number of parameters each object contains then compares each parameter in each object to the parameter of the same name in the other object. Parameter comparisons use a case-insensitive comparison for parameter name and a case-sensitive comparison for parameter value.

bool operator== ( const RWMimeContentDisposition first,
const RWMimeContentDisposition second 
) [friend]

Equality operator. Returns true if first is equal to second, false otherwise. The function compares the disposition types using a case-insensitive string comparison. Compares the number of parameters each object contains then compares each parameter in each object to the parameter of the same name in the other object. Parameter comparisons use a case-insensitive comparison for parameter name and a case-sensitive comparison for parameter value.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

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