TreeFrogFramework  1.18
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
TInternetMessageHeader Class Reference

#include <tinternetmessageheader.h>

Inheritance diagram for TInternetMessageHeader:
Inheritance graph
[legend]

Public Member Functions

 TInternetMessageHeader ()
 
 TInternetMessageHeader (const TInternetMessageHeader &other)
 
 TInternetMessageHeader (const QByteArray &str)
 
virtual ~TInternetMessageHeader ()
 
bool hasRawHeader (const QByteArray &key) const
 
QByteArray rawHeader (const QByteArray &key) const
 
QList< QByteArray > rawHeaderList () const
 
void setRawHeader (const QByteArray &key, const QByteArray &value)
 
void addRawHeader (const QByteArray &key, const QByteArray &value)
 
void removeAllRawHeaders (const QByteArray &key)
 
void removeRawHeader (const QByteArray &key)
 
bool isEmpty () const
 
void clear ()
 
QByteArray contentType () const
 
void setContentType (const QByteArray &type)
 
uint contentLength () const
 
void setContentLength (int len)
 
QByteArray date () const
 
void setDate (const QByteArray &date)
 
void setDate (const QDateTime &dateTime)
 
void setCurrentDate ()
 
virtual QByteArray toByteArray () const
 
TInternetMessageHeaderoperator= (const TInternetMessageHeader &other)
 

Protected Types

typedef QPair< QByteArray, QByteArray > RawHeaderPair
 
typedef QList< RawHeaderPairRawHeaderPairList
 

Protected Member Functions

void parse (const QByteArray &header)
 

Protected Attributes

RawHeaderPairList headerPairList
 

Detailed Description

The TInternetMessageHeader class contains internet message headers.

Member Typedef Documentation

typedef QPair<QByteArray, QByteArray> TInternetMessageHeader::RawHeaderPair
protected

Constructor & Destructor Documentation

TInternetMessageHeader::TInternetMessageHeader ( )
inline

Constructs an empty Internet message header.

TInternetMessageHeader::TInternetMessageHeader ( const TInternetMessageHeader other)

Copy constructor.

TInternetMessageHeader::TInternetMessageHeader ( const QByteArray &  str)

Constructs an Internet message header by parsing str.

virtual TInternetMessageHeader::~TInternetMessageHeader ( )
inlinevirtual

Member Function Documentation

void TInternetMessageHeader::addRawHeader ( const QByteArray &  key,
const QByteArray &  value 
)

Sets the raw header key to be of value value.

If key was previously set, it is added multiply.

void TInternetMessageHeader::clear ( )

Removes all the entries from the Internet message header.

uint TInternetMessageHeader::contentLength ( ) const

Returns the value of the header field content-length.

QByteArray TInternetMessageHeader::contentType ( ) const

Returns the value of the header field content-type.

QByteArray TInternetMessageHeader::date ( ) const

Returns the value of the header field Date.

bool TInternetMessageHeader::hasRawHeader ( const QByteArray &  key) const

Returns true if the Internet message header has an entry with the given key; otherwise returns false.

bool TInternetMessageHeader::isEmpty ( ) const

Returns true if the Internet message header is empty; otherwise returns false.

TInternetMessageHeader & TInternetMessageHeader::operator= ( const TInternetMessageHeader other)

Assigns other to this internet message header and returns a reference to this header.

void TInternetMessageHeader::parse ( const QByteArray &  header)
protected

Parses the header.

This function is for internal use only.

QByteArray TInternetMessageHeader::rawHeader ( const QByteArray &  key) const

Returns the raw value for the entry with the given key.

If no entry has this key, an empty byte array is returned.

QList< QByteArray > TInternetMessageHeader::rawHeaderList ( ) const

Returns a list of all raw headers.

void TInternetMessageHeader::removeAllRawHeaders ( const QByteArray &  key)

Removes all the entries with the key key from the HTTP header.

void TInternetMessageHeader::removeRawHeader ( const QByteArray &  key)

Removes the entries with the key key from the HTTP header.

void TInternetMessageHeader::setContentLength ( int  len)

Sets the value of the header field content-length to len.

void TInternetMessageHeader::setContentType ( const QByteArray &  type)

Sets the value of the header field content-type to type.

void TInternetMessageHeader::setCurrentDate ( )

Sets the value of the header field Date to the current date/time.

void TInternetMessageHeader::setDate ( const QByteArray &  date)

Sets the value of the header field Date to date.

void TInternetMessageHeader::setDate ( const QDateTime &  dateTime)

Sets the value of the header field Date to localTime as the local time on the computer.

void TInternetMessageHeader::setRawHeader ( const QByteArray &  key,
const QByteArray &  value 
)

Sets the raw header key to be of value value.

If key was previously set, it is overridden.

QByteArray TInternetMessageHeader::toByteArray ( ) const
virtual

Sets the value of the header field Date to utc as Coordinated Universal Time.

Returns a byte array representation of the Internet message header.

Reimplemented in THttpResponseHeader, THttpRequestHeader, and THttpHeader.

Member Data Documentation

RawHeaderPairList TInternetMessageHeader::headerPairList
protected

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