GeoIpRequest Class Reference

#include <GeoIpRequest.h>

List of all members.

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

Detailed Description

Definition at line 28 of file GeoIpRequest.h.


Constructor & Destructor Documentation

GeoIpRequest::GeoIpRequest ( int  id  )  [inline]

Constructor

Definition at line 32 of file GeoIpRequest.h.


Member Function Documentation

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]
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().


Member Data Documentation

QString GeoIpRequest::_host [private]

Host: field value.

Definition at line 55 of file GeoIpRequest.h.

Referenced by createHeader(), and setHost().

int GeoIpRequest::_id [private]

Request identifier

Definition at line 54 of file GeoIpRequest.h.

Referenced by id().

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().


The documentation for this class was generated from the following files:
Generated on Mon Aug 30 23:09:54 2010 for Vidalia by  doxygen 1.6.3