HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Types | Public Member Functions
rwsf::MimeHeaders Class Reference

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

#include <rwsf/message/MimeHeaders.h>

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

Public Types

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

Public Member Functions

 MimeHeaders ()
 
 MimeHeaders (const MimeHeaders &second)
 
void add (const std::string &name, const std::string &s)
 
void clear ()
 
bool contains (const std::string &name) const
 
MimeHeaders copy () const
 
rwsf::Enumeration< std::string > enumeration () const
 
bool find (const std::string &name, std::list< std::string > *&r) const
 
Iterator iterator () const
 
std::string marshal ()
 
MimeHeadersoperator= (const MimeHeaders &second)
 
void remove (const std::string &name)
 
void set (const std::string &name, const std::string &s)
 
int size () const
 
void unmarshal (const std::string &in)
 
- Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
 
bool operator!= (const HandleBase &second) const
 
bool operator== (const HandleBase &second) const
 

Additional Inherited Members

- Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (void)
 
 HandleBase (StaticCtor)
 
 HandleBase (BodyBase *body)
 
 HandleBase (const HandleBase &second)
 
virtual ~HandleBase (void)
 
BodyBase & body (void) const
 
HandleBaseoperator= (const HandleBase &second)
 

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 © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.