SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Friends
RWMimeParameterList Class Reference

Contains a bounds-checked vector of RWMimeParameter objects. More...

#include <rw/mime/RWMimeParameterList.h>

Public Member Functions

 RWMimeParameterList (void)
 
 RWMimeParameterList (const RWMimeParameterList &second)
 
 ~RWMimeParameterList (void)
 
RWCString asString (void) const
 
size_t findParameter (const RWCString &name, size_t start=0) const
 
void fromString (const RWCString &paramString)
 
RWMimeParameter getParameter (size_t i) const
 
size_t getParameterCount (void) const
 
RWCString getParameterValue (const RWCString &name, size_t start=0) const
 
void insertParameter (const RWMimeParameter &parameter)
 
RWMimeParameterListoperator= (const RWMimeParameterList &second)
 
void removeAllParameters (void)
 
void removeParameter (size_t position)
 
void setParameterValue (const RWCString &name, const RWCString &value, size_t start=0)
 

Friends

bool operator== (const RWMimeParameterList &first, const RWMimeParameterList &second)
 

Detailed Description

RWMimeParameterList contains a bounds-checked vector of RWMimeParameter objects.

Constructor & Destructor Documentation

RWMimeParameterList::RWMimeParameterList ( void  )

Default constructor. Constructs an empty parameter list.

RWMimeParameterList::RWMimeParameterList ( const RWMimeParameterList second)

Copy constructor. Constructs a new list as a deep copy of second.

RWMimeParameterList::~RWMimeParameterList ( void  )

Destructor.

Member Function Documentation

RWCString RWMimeParameterList::asString ( void  ) const

Returns a string representation of self. Throws RWMimeError if self cannot be represented as valid MIME. The RWCString should contain 7-bit US-ASCII data.

size_t RWMimeParameterList::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 start. Uses a case-insensitive comparison to match name. The RWCString should contain 7-bit US-ASCII data.

void RWMimeParameterList::fromString ( const RWCString paramString)

Parses paramString and populates self with the contents of paramString. Throws RWMimeParseError if the function cannot parse the contents of paramString. The RWCString should contain 7-bit US-ASCII data.

RWMimeParameter RWMimeParameterList::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 RWMimeParameterList::getParameterCount ( void  ) const

Returns the total number of parameters in self.

RWCString RWMimeParameterList::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. The RWCString should contain 7-bit US-ASCII data.

void RWMimeParameterList::insertParameter ( const RWMimeParameter parameter)

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

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

Assignment operator. Makes self a deep copy of second.

void RWMimeParameterList::removeAllParameters ( void  )

Removes all parameters from self.

void RWMimeParameterList::removeParameter ( size_t  position)

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

void RWMimeParameterList::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. Begins searching at start. If no such parameter exists, creates a new parameter and inserts the new parameter into self's parameter list. Matches parameter names using a case-insensitive string comparison. The RWCString should contain 7-bit US-ASCII data.

Friends And Related Function Documentation

bool operator== ( const RWMimeParameterList first,
const RWMimeParameterList second 
)
friend

Equality operator. Returns true if first and second are equal, false otherwise. Compares the number of parameters the objects contain, then compares each parameter in each object with the parameter of the same name in the other object. Uses a case-insensitive comparison for parameter name and a case-sensitive comparison for parameter value.

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