#include <geoiprequest.h>
Public Member Functions | |
GeoIpRequest (int id) | |
void | setHost (QString host) |
void | setPage (QString page) |
void | setRequest (QList< QHostAddress > ips) |
bool | contains (QHostAddress ip) |
int | id () |
QByteArray | request () |
Private Member Functions | |
QHttpRequestHeader | createHeader () |
Private Attributes | |
int | _id |
QString | _host |
QString | _page |
QString | _request |
QList< QHostAddress > | _ips |
Definition at line 38 of file geoiprequest.h.
GeoIpRequest::GeoIpRequest | ( | int | id | ) | [inline] |
Constructor
Definition at line 42 of file geoiprequest.h.
void GeoIpRequest::setHost | ( | QString | host | ) | [inline] |
Sets the Host: field in this request's header.
Definition at line 45 of file geoiprequest.h.
References _host.
Referenced by GeoIpResolver::createRequest().
void GeoIpRequest::setPage | ( | QString | page | ) | [inline] |
Sets the page path in this request's header.
Definition at line 47 of file geoiprequest.h.
References _page.
Referenced by GeoIpResolver::createRequest().
void GeoIpRequest::setRequest | ( | QList< QHostAddress > | ips | ) |
Sets the list of IPs whose geo information we want to request.
Definition at line 58 of file geoiprequest.cpp.
References _ips, _request, and i().
Referenced by GeoIpResolver::createRequest().
bool GeoIpRequest::contains | ( | QHostAddress | ip | ) |
Returns true if this request contains ip.
Definition at line 84 of file geoiprequest.cpp.
References _ips.
Referenced by GeoIpResolver::disconnected().
int GeoIpRequest::id | ( | ) | [inline] |
Returns the request's identifier.
Definition at line 54 of file geoiprequest.h.
References _id.
Referenced by GeoIpResolver::disconnected(), GeoIpResolver::resolve(), and GeoIpResolver::socketError().
QByteArray GeoIpRequest::request | ( | ) |
Formats the request as an HTTP POST request
Formats the request as an HTTP POST request.
Definition at line 75 of file geoiprequest.cpp.
References _request, and createHeader().
Referenced by GeoIpResolver::connected().
QHttpRequestHeader GeoIpRequest::createHeader | ( | ) | [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 36 of file geoiprequest.cpp.
References _host, _page, _request, ZlibByteArray::isGzipSupported(), and ZlibByteArray::isZlibAvailable().
Referenced by request().
int GeoIpRequest::_id [private] |
QString GeoIpRequest::_host [private] |
Host: field value.
Definition at line 63 of file geoiprequest.h.
Referenced by createHeader(), and setHost().
QString GeoIpRequest::_page [private] |
Page giving us the geo ip information.
Definition at line 64 of file geoiprequest.h.
Referenced by createHeader(), and setPage().
QString GeoIpRequest::_request [private] |
Formatted Geo IP request string.
Definition at line 65 of file geoiprequest.h.
Referenced by createHeader(), request(), and setRequest().
QList<QHostAddress> GeoIpRequest::_ips [private] |
List of IP addresses in this request.
Definition at line 66 of file geoiprequest.h.
Referenced by contains(), and setRequest().