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


A typical Gnutella CONNECT handshake has the form:
GNUTELLA CONNECT/<majorVersion>.<minorVersion>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.
Refer to the Qt's documentation on QHttpHeader to get more information about how to set and get header values.
Definition at line 53 of file RequestHeader.h.
Public Member Functions | |
| RequestHeader (const RequestHeader &header) | |
| Copy constructor. | |
| RequestHeader (const QString &str) | |
| Constructor. | |
| RequestHeader (int majorVer=0, int minorVer=6) | |
| Constructor. | |
| RequestHeader & | operator= (const RequestHeader &header) |
| Assignment operator. | |
| int | majorVersion () const |
| Gets the major protocol version. | |
| int | minorVersion () const |
| Gets the minor protocol version. | |
| 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 minot version field. | |
|
|
Copy constructor.
Definition at line 59 of file RequestHeader.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 RequestHeader.cpp. |
|
||||||||||||
|
Constructor. Creates and initialzes an object with majorVersion and minorVersion. To set some header field values call the corresonding functions of from the base class.
Definition at line 52 of file RequestHeader.cpp. |
|
|
Gets the major protocol version.
Definition at line 61 of file RequestHeader.h. |
|
|
Gets the minor protocol version.
Definition at line 62 of file RequestHeader.h. |
|
|
Assignment operator.
Definition at line 67 of file RequestHeader.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 84 of file RequestHeader.cpp. |
|
|
Generates and returns the complete header as text.
Reimplemented from Http::Header. Definition at line 107 of file RequestHeader.cpp. |
|
|
The major version field.
Definition at line 70 of file RequestHeader.h. |
|
|
The minot version field.
Definition at line 71 of file RequestHeader.h. |