TreeFrogFramework  2.8
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
 
QByteArrayList 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)
 
int64_t contentLength () const
 
void setContentLength (int64_t 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

using RawHeaderPair = QPair< QByteArray, QByteArray >
 
using RawHeaderPairList = QList< RawHeaderPair >
 

Protected Member Functions

void parse (const QByteArray &header)
 

Protected Attributes

RawHeaderPairList _headerPairList
 
int64_t _contentLength {-1}
 

Detailed Description

The TInternetMessageHeader class contains internet message headers.

Member Typedef Documentation

◆ RawHeaderPair

using TInternetMessageHeader::RawHeaderPair = QPair<QByteArray, QByteArray>
protected

◆ RawHeaderPairList

Constructor & Destructor Documentation

◆ TInternetMessageHeader() [1/3]

TInternetMessageHeader::TInternetMessageHeader ( )
inline

Constructs an empty Internet message header.

◆ TInternetMessageHeader() [2/3]

TInternetMessageHeader::TInternetMessageHeader ( const TInternetMessageHeader other)

Copy constructor.

◆ TInternetMessageHeader() [3/3]

TInternetMessageHeader::TInternetMessageHeader ( const QByteArray &  str)

Constructs an Internet message header by parsing str.

◆ ~TInternetMessageHeader()

virtual TInternetMessageHeader::~TInternetMessageHeader ( )
inlinevirtual

Member Function Documentation

◆ addRawHeader()

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.

◆ clear()

void TInternetMessageHeader::clear ( )

Removes all the entries from the Internet message header.

◆ contentLength()

int64_t TInternetMessageHeader::contentLength ( ) const

Returns the value of the header field content-length.

◆ contentType()

QByteArray TInternetMessageHeader::contentType ( ) const

Returns the value of the header field content-type.

◆ date()

QByteArray TInternetMessageHeader::date ( ) const

Returns the value of the header field Date.

◆ hasRawHeader()

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

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

◆ isEmpty()

bool TInternetMessageHeader::isEmpty ( ) const

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

◆ operator=()

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

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

◆ parse()

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

Parses the header.

This function is for internal use only.

◆ rawHeader()

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.

◆ rawHeaderList()

QByteArrayList TInternetMessageHeader::rawHeaderList ( ) const

Returns a list of all raw headers.

◆ removeAllRawHeaders()

void TInternetMessageHeader::removeAllRawHeaders ( const QByteArray &  key)

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

◆ removeRawHeader()

void TInternetMessageHeader::removeRawHeader ( const QByteArray &  key)

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

◆ setContentLength()

void TInternetMessageHeader::setContentLength ( int64_t  len)

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

◆ setContentType()

void TInternetMessageHeader::setContentType ( const QByteArray &  type)

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

◆ setCurrentDate()

void TInternetMessageHeader::setCurrentDate ( )

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

◆ setDate() [1/2]

void TInternetMessageHeader::setDate ( const QByteArray &  date)

Sets the value of the header field Date to date.

◆ setDate() [2/2]

void TInternetMessageHeader::setDate ( const QDateTime &  dateTime)

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

◆ setRawHeader()

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.

◆ toByteArray()

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

◆ _contentLength

int64_t TInternetMessageHeader::_contentLength {-1}
mutableprotected

◆ _headerPairList

RawHeaderPairList TInternetMessageHeader::_headerPairList
protected

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