rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::MimeHeaders Class Reference
[MIME Headers]

Contains a collection of MIME headers as described in RFC 2045. More...

#include <rwsf/message/MimeHeaders.h>

Inheritance diagram for rwsf::MimeHeaders:
rwsf::HandleBase

List of all members.

Public Types

typedef rwsf::HashMapIterator
< std::string, std::list
< std::string > * > 
Iterator

Public Member Functions

 MimeHeaders ()
 MimeHeaders (const MimeHeaders &second)
MimeHeadersoperator= (const MimeHeaders &second)
void clear ()
MimeHeaders copy () const
int size () const
bool find (const std::string &name, std::list< std::string > *&r) const
void set (const std::string &name, const std::string &s)
void add (const std::string &name, const std::string &s)
Iterator iterator () const
rwsf::Enumeration< std::string > enumeration () const
void remove (const std::string &name)
bool contains (const std::string &name) const
std::string marshal ()
void unmarshal (const std::string &in)

Detailed Description

This class contains a collection of MIME headers as described in RFC 2045. Headers are case-insensitive; so 'Accept' is the same as 'accept'.


Member Typedef Documentation

typedef rwsf::HashMapIterator<std::string, std::list<std::string>* > rwsf::MimeHeaders::Iterator

HashMapIterator is used for iterating over the MIME headers.


Constructor & Destructor Documentation

rwsf::MimeHeaders::MimeHeaders (  ) 

Creates a new MimeHeaders instance. A new instance does not contain any header values.

rwsf::MimeHeaders::MimeHeaders ( const MimeHeaders second  ) 

Creates a new MimeHeaders handle to the body instance of second.


Member Function Documentation

void rwsf::MimeHeaders::add ( const std::string &  name,
const std::string &  s 
)

Adds a header key/value pair to the collection of headers. If a key by the name of name already exists, then the value of s is added to the list of values associated with the name key.

void rwsf::MimeHeaders::clear (  ) 

Clears (removes) all headers.

bool rwsf::MimeHeaders::contains ( const std::string &  name  )  const

Returns true if a header matching name exists, otherwise false.

MimeHeaders rwsf::MimeHeaders::copy (  )  const

Returns a copy of this instance. The returned value is a deep copy and contains its own self contained data.

rwsf::Enumeration<std::string> rwsf::MimeHeaders::enumeration (  )  const

Returns an enumeration of the defined header names.

bool rwsf::MimeHeaders::find ( const std::string &  name,
std::list< std::string > *&  r 
) const

Retrieves the list of values matching the name header. If a matching header is found then true is returned and the list r is populated with the results. Otherwise false is returned and the value of r is unchanged.

Iterator rwsf::MimeHeaders::iterator (  )  const

Returns an iterator over the contained headers.

std::string rwsf::MimeHeaders::marshal (  ) 

Marshals the contained data out into a string of header key value pairs.

MimeHeaders& rwsf::MimeHeaders::operator= ( const MimeHeaders second  ) 

Associates this handle with the body instance of second. Returns a reference to self.

void rwsf::MimeHeaders::remove ( const std::string &  name  ) 

Removes the header name from the collection of headers.

void rwsf::MimeHeaders::set ( const std::string &  name,
const std::string &  s 
)

Sets the header matching the key name, with the value of s. If the name header does not exist, then the header is added to the collection of headers. Otherwise the value list associated with the header is cleared and replaced with s.

int rwsf::MimeHeaders::size (  )  const

Returns the number of header entries.

void rwsf::MimeHeaders::unmarshal ( const std::string &  in  ) 

Takes a string reference containing header values, such as:

soapAction: "example"

and unmarshals them into header entries.


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.