#include <GeoIpRequest.h>
Public Member Functions | |
| GeoIpRequest (int id) | |
| void | setHost (const QString &host) |
| void | setPage (const QString &page) |
| void | setRequest (const QList< QHostAddress > &ips) |
| bool | contains (const QHostAddress &ip) const |
| int | id () const |
| int | size () const |
| QByteArray | request () const |
Private Member Functions | |
| QHttpRequestHeader | createHeader () const |
Private Attributes | |
| int | _id |
| QString | _host |
| QString | _page |
| QString | _request |
| QList< QHostAddress > | _ips |
Definition at line 28 of file GeoIpRequest.h.
| GeoIpRequest::GeoIpRequest | ( | int | id | ) | [inline] |
Constructor
Definition at line 32 of file GeoIpRequest.h.
| bool GeoIpRequest::contains | ( | const QHostAddress & | ip | ) | const |
Returns true if this request contains ip.
Definition at line 76 of file GeoIpRequest.cpp.
References _ips.
Referenced by GeoIpResolver::parseGeoIpResponse().
| QHttpRequestHeader GeoIpRequest::createHeader | ( | ) | const [private] |
Creates an HTTP header for this request.
Creates an HTTP POST header for this request, based on the Host, Page, and content-length values.
Definition at line 28 of file GeoIpRequest.cpp.
References _host, _page, _request, ZlibByteArray::isGzipSupported(), and ZlibByteArray::isZlibAvailable().
Referenced by request().
| int GeoIpRequest::id | ( | ) | const [inline] |
Returns the request's identifier.
Definition at line 44 of file GeoIpRequest.h.
References _id.
Referenced by GeoIpResolver::connected(), GeoIpResolver::disconnected(), GeoIpResolver::parseGeoIpResponse(), GeoIpResolver::resolve(), and GeoIpResolver::socketError().
| QByteArray GeoIpRequest::request | ( | ) | const |
Formats the request as an HTTP POST request
Formats the request as an HTTP POST request.
Definition at line 67 of file GeoIpRequest.cpp.
References _request, and createHeader().
Referenced by GeoIpResolver::connected().
| void GeoIpRequest::setHost | ( | const QString & | host | ) | [inline] |
Sets the Host: field in this request's header.
Definition at line 35 of file GeoIpRequest.h.
References _host.
Referenced by GeoIpResolver::createRequest().
| void GeoIpRequest::setPage | ( | const QString & | page | ) | [inline] |
Sets the page path in this request's header.
Definition at line 37 of file GeoIpRequest.h.
References _page.
Referenced by GeoIpResolver::createRequest().
| void GeoIpRequest::setRequest | ( | const QList< QHostAddress > & | ips | ) |
Sets the list of IPs whose geo information we want to request.
Definition at line 50 of file GeoIpRequest.cpp.
References _ips, _request, and i().
Referenced by GeoIpResolver::createRequest().
| int GeoIpRequest::size | ( | ) | const [inline] |
Returns the number of IP addresses contained in this request.
Definition at line 46 of file GeoIpRequest.h.
References _ips.
Referenced by GeoIpResolver::connected().
QString GeoIpRequest::_host [private] |
Host: field value.
Definition at line 55 of file GeoIpRequest.h.
Referenced by createHeader(), and setHost().
int GeoIpRequest::_id [private] |
QList<QHostAddress> GeoIpRequest::_ips [private] |
List of IP addresses in this request.
Definition at line 58 of file GeoIpRequest.h.
Referenced by contains(), setRequest(), and size().
QString GeoIpRequest::_page [private] |
Page giving us the geo ip information.
Definition at line 56 of file GeoIpRequest.h.
Referenced by createHeader(), and setPage().
QString GeoIpRequest::_request [private] |
Formatted Geo IP request string.
Definition at line 57 of file GeoIpRequest.h.
Referenced by createHeader(), request(), and setRequest().
1.6.3