Http::ResponseHeader Class Reference

#include <ResponseHeader.h> [code]

Inherits Http::Header.

Inheritance diagram for Http::ResponseHeader:

Inheritance graph
[legend]
Collaboration diagram for Http::ResponseHeader:

Collaboration graph
[legend]
List of all members.

Detailed Description

Encapsulates the HTTP response message header.

Todo:
Revise this documentation:
This class is used by the QHttp class to report the header information that the client received from the server.

HTTP responses have a status code that indicates the status of the response. This code is a 3-digit integer result code (for details see to RFC 1945). In addition to the status code, you can also specify a human-readable text that describes the reason for the code ("reason phrase"). This class allows you to get the status code and the reason phrase.

Todo:
Properly implement implicit sharing of private data (passing the pointer to the private data to the ctor of the base class).
See also:
RequestHeader, HeaderReader, HeaderWriter

Definition at line 52 of file ResponseHeader.h.

Public Member Functions

 ResponseHeader ()
 ResponseHeader (const QString &str)
 ResponseHeader (int statusCode, const QString &reasonPhrase=QString(), int majorVer=1, int minorVer=1)
 ResponseHeader (const ResponseHeader &header)
 ~ResponseHeader ()
 Destructor.
ResponseHeaderoperator= (const ResponseHeader &header)
void setStatusLine (int statusCode, const QString &reasonPhrase=QString(), int majorVer=1, int minorVer=1)
int statusCode () const
QString reasonPhrase () const
int majorVersion () const
int minorVersion () const
QString toString () const

Protected Member Functions

bool parseLine (const QString &line, int number)

Private Attributes

auto_ptr< ResponseHeaderPrivated


Constructor & Destructor Documentation

ResponseHeader::ResponseHeader  ) 
 

Constructs an empty HTTP response header.

Definition at line 48 of file ResponseHeader.cpp.

ResponseHeader::ResponseHeader const QString &  str  ) 
 

Constructs a HTTP response header from the string str. The string is parsed and the information is set. The str should consist of one or more "\r\n" delimited lines; the first line should be the status-line (format: HTTP-version, space, status-code, space, reason-phrase); each of remaining lines should have the format key, colon, space, value.

Definition at line 92 of file ResponseHeader.cpp.

ResponseHeader::ResponseHeader int  statusCode,
const QString &  reasonPhrase = QString(),
int  majorVer = 1,
int  minorVer = 1
 

Definition at line 98 of file ResponseHeader.cpp.

ResponseHeader::ResponseHeader const ResponseHeader header  ) 
 

Constructs a copy of header.

Definition at line 57 of file ResponseHeader.cpp.

ResponseHeader::~ResponseHeader  ) 
 

Destructor.

Definition at line 67 of file ResponseHeader.cpp.


Member Function Documentation

int ResponseHeader::majorVersion  )  const
 

Returns the major protocol-version of the HTTP response header.

See also:
minorVersion() statusCode() reasonPhrase()

Definition at line 150 of file ResponseHeader.cpp.

int ResponseHeader::minorVersion  )  const
 

Returns the minor protocol-version of the HTTP response header.

See also:
majorVersion() statusCode() reasonPhrase()

Definition at line 160 of file ResponseHeader.cpp.

ResponseHeader & ResponseHeader::operator= const ResponseHeader header  ) 
 

Copies the contents of header into this ResponseHeader.

Definition at line 74 of file ResponseHeader.cpp.

bool ResponseHeader::parseLine const QString &  line,
int  number
[protected, virtual]
 

Reimplemented from Http::Header.

Definition at line 167 of file ResponseHeader.cpp.

QString ResponseHeader::reasonPhrase  )  const
 

Returns the reason phrase of the HTTP response header.

See also:
statusCode() majorVersion() minorVersion()

Definition at line 140 of file ResponseHeader.cpp.

void ResponseHeader::setStatusLine int  statusCode,
const QString &  reasonPhrase = QString(),
int  majorVersion = 1,
int  minorVersion = 1
 

Sets the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.

See also:
statusCode() reasonPhrase() majorVersion() minorVersion()

Definition at line 113 of file ResponseHeader.cpp.

int ResponseHeader::statusCode  )  const
 

Returns the status code of the HTTP response header.

See also:
reasonPhrase() majorVersion() minorVersion()

Definition at line 130 of file ResponseHeader.cpp.

QString ResponseHeader::toString  )  const [virtual]
 

Reimplemented from Http::Header.

Definition at line 198 of file ResponseHeader.cpp.


Member Data Documentation

auto_ptr<ResponseHeaderPrivate> Http::ResponseHeader::d [private]
 

Reimplemented from Http::Header.

Definition at line 84 of file ResponseHeader.h.


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