Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Net::MessageHeader Class Reference

#include <MessageHeader.h>

Inheritance diagram for Poco::Net::MessageHeader:

Poco::Net::NameValueCollection Poco::Net::HTTPMessage Poco::Net::MailMessage Poco::Net::HTTPRequest Poco::Net::HTTPResponse Poco::Net::HTTPServerRequest Poco::Net::HTTPServerResponse

List of all members.


Detailed Description

A collection of name-value pairs that are used in various internet protocols like HTTP and SMTP.

The name is case-insensitive.

There can be more than one name-value pair with the same name.

MessageHeader supports writing and reading the header data in RFC 2822 format.

Definition at line 54 of file MessageHeader.h.


Public Types

typedef HeaderMap::const_iterator ConstIterator
typedef std::multimap
< std::string, std::string,
ILT > 
HeaderMap
typedef HeaderMap::iterator Iterator

Public Member Functions

void add (const std::string &name, const std::string &value)
 Sets the value of the (first) name-value pair with the given name.
ConstIterator begin () const
void clear ()
 Removes all name-value pairs with the given name.
bool empty () const
ConstIterator end () const
void erase (const std::string &name)
ConstIterator find (const std::string &name) const
const std::string & get (const std::string &name, const std::string &defaultValue) const
const std::string & get (const std::string &name) const
 Adds a new name-value pair with the given name and value.
bool has (const std::string &name) const
 MessageHeader (const MessageHeader &messageHeader)
 Creates the MessageHeader.
MessageHeaderoperator= (const MessageHeader &messageHeader)
 Destroys the MessageHeader.
const std::string & operator[] (const std::string &name) const
 Swaps the NameValueCollection with another one.
virtual void read (std::istream &istr)
void set (const std::string &name, const std::string &value)
int size () const
 Returns true iff the header does not have any content.
void swap (NameValueCollection &nvc)
 Assigns the name-value pairs of another NameValueCollection to this one.
virtual void write (std::ostream &ostr) const
 Assigns the content of another MessageHeader.
virtual ~MessageHeader ()

Static Public Member Functions

static void quote (const std::string &value, std::string &result, bool allowSpace=false)
static void splitElements (const std::string &s, std::vector< std::string > &elements, bool ignoreEmpty=true)
static void splitParameters (const std::string::const_iterator &begin, const std::string::const_iterator &end, NameValueCollection &parameters)
static void splitParameters (const std::string &s, std::string &value, NameValueCollection &parameters)

Private Types

enum  Limits { MAX_NAME_LENGTH = 256, MAX_VALUE_LENGTH = 4096 }
 Limits for basic sanity checks when reading a header. More...

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index