#include <ResponseHeader.h> [code]
Inherits Http::Header.
Inheritance diagram for Gnutella::Handshaking::ResponseHeader:


A typical Gnutella CONNECT handshake has the form:
GNUTELLA/<majorVersion>.<minorVersion> <statusCode> <reasonPhrase> CRLF Handshake-Header1: header value 1 CRLF ... Handshake-HeaderN: header value N CRLF CRLF
Objects of this class are used in the HandshakeConnection class to facilitate header exchange during the handshaking phase of a Gnutella connection.
Definition at line 52 of file ResponseHeader.h.
Public Member Functions | |
| ResponseHeader () | |
| ResponseHeader (const ResponseHeader &header) | |
| Copy constructor. | |
| ResponseHeader (const QString &str) | |
| Constructor. | |
| ResponseHeader (int code, const QString &phrase, int majorVer=0, int minorVer=6) | |
| Constructor. | |
| ResponseHeader & | operator= (const ResponseHeader &header) |
| Assignment operator. | |
| int | majorVersion () const |
| Gets the protocol's major version. | |
| int | minorVersion () const |
| Gets the protocol's minor version. | |
| int | statusCode () const |
| Gets the response's status code. | |
| QString | reasonPhrase () const |
| Gets the response's reason phrase. | |
| QString | toString () const |
| Generates and returns the complete header as text. | |
Protected Member Functions | |
| bool | parseLine (const QString &line, int number) |
| Parses a single header line. | |
Private Attributes | |
| int | majorVersion_ |
| The major version field. | |
| int | minorVersion_ |
| The minor version field. | |
| int | statusCode_ |
| The response's status code. | |
| QString | reasonPhrase_ |
| The response's reason phrase. | |
|
|
Definition at line 63 of file ResponseHeader.h. |
|
|
Copy constructor.
Definition at line 60 of file ResponseHeader.cpp. |
|
|
Constructor. Creates and initalizes an object by parsing the str. You can get the values of the parsed header fields by calling the corresponding functions from the base class HttpHeader.
Definition at line 37 of file ResponseHeader.cpp. |
|
||||||||||||||||||||
|
Constructor. Creates and initialzes an object with code, phrase, majorVersion and minorVersion. To set some header field values call the corresonding functions of from the base class.
Definition at line 52 of file ResponseHeader.cpp. |
|
|
Gets the protocol's major version.
Definition at line 71 of file ResponseHeader.h. |
|
|
Gets the protocol's minor version.
Definition at line 72 of file ResponseHeader.h. |
|
|
Assignment operator.
Definition at line 68 of file ResponseHeader.cpp. |
|
||||||||||||
|
Parses a single header line. Parses a single header line. This is a virtual function overridden here to parse just the first line of the header differently than if it were pure HTTP, but not Gnutella. The other lines are parsed by the base class implementation.
Reimplemented from Http::Header. Definition at line 87 of file ResponseHeader.cpp. |
|
|
Gets the response's reason phrase.
Definition at line 74 of file ResponseHeader.h. |
|
|
Gets the response's status code.
Definition at line 73 of file ResponseHeader.h. |
|
|
Generates and returns the complete header as text.
Reimplemented from Http::Header. Definition at line 117 of file ResponseHeader.cpp. |
|
|
The major version field.
Definition at line 82 of file ResponseHeader.h. |
|
|
The minor version field.
Definition at line 83 of file ResponseHeader.h. |
|
|
The response's reason phrase.
Definition at line 85 of file ResponseHeader.h. |
|
|
The response's status code.
Definition at line 84 of file ResponseHeader.h. |