GeoIp Class Reference

#include <geoip.h>

List of all members.

Public Member Functions

 GeoIp ()
 GeoIp (QHostAddress ip, float latitude, float longitude, QString city, QString state, QString country)
QString toString () const
QHostAddress ip () const
float latitude () const
float longitude () const
QString city () const
QString state () const
QString country () const
QString toLocation () const
bool isEmpty () const

Static Public Member Functions

static GeoIp fromString (QString geoip)

Private Attributes

QHostAddress _ip
float _latitude
float _longitude
QString _city
QString _state
QString _country


Detailed Description

Definition at line 35 of file geoip.h.


Constructor & Destructor Documentation

GeoIp::GeoIp (  )  [inline]

Default constructor

Definition at line 39 of file geoip.h.

Referenced by fromString().

GeoIp::GeoIp ( QHostAddress  ip,
float  latitude,
float  longitude,
QString  city,
QString  state,
QString  country 
)

Constructor

Definition at line 34 of file geoip.cpp.

References _city, _country, _ip, _latitude, _longitude, and _state.


Member Function Documentation

GeoIp GeoIp::fromString ( QString  geoip  )  [static]

Creates a GeoIp object from a string.

Definition at line 51 of file geoip.cpp.

References city(), country(), GeoIp(), ip(), latitude(), longitude(), and state().

Referenced by GeoIpCacheItem::fromString(), and GeoIpResponse::GeoIpResponse().

QString GeoIp::toString (  )  const

Builds a comma-delimited string of GeoIp fields.

Definition at line 73 of file geoip.cpp.

References _city, _country, _ip, _latitude, _longitude, and _state.

Referenced by GeoIpCacheItem::toString().

QHostAddress GeoIp::ip (  )  const [inline]

Returns the IP address for this object.

Definition at line 51 of file geoip.h.

References _ip.

Referenced by GeoIpCache::cache(), GeoIpResolver::disconnected(), fromString(), GeoIpCacheItem::ip(), and NetViewer::resolved().

float GeoIp::latitude (  )  const [inline]

Returns the latitude coordinate for this IP.

Definition at line 53 of file geoip.h.

References _latitude.

Referenced by fromString(), and NetViewer::resolved().

float GeoIp::longitude (  )  const [inline]

Returns the longitude coordinate for this IP.

Definition at line 55 of file geoip.h.

References _longitude.

Referenced by fromString(), and NetViewer::resolved().

QString GeoIp::city (  )  const [inline]

Returns the city in which this IP lives.

Definition at line 57 of file geoip.h.

References _city.

Referenced by fromString().

QString GeoIp::state (  )  const [inline]

Returns the state or district in which this IP lives.

Definition at line 59 of file geoip.h.

References _state.

Referenced by fromString().

QString GeoIp::country (  )  const [inline]

Returns the country in which this IP lives.

Definition at line 61 of file geoip.h.

References _country.

Referenced by fromString().

QString GeoIp::toLocation (  )  const

Returns a human-readable string of city, region(state), and country.

Definition at line 95 of file geoip.cpp.

References _city, _country, _state, and i().

Referenced by NetViewer::resolved().

bool GeoIp::isEmpty (  )  const

Returns true if the GeoIp object is invalid.

Definition at line 88 of file geoip.cpp.

References _ip, _latitude, and _longitude.

Referenced by GeoIpResponse::GeoIpResponse().


Member Data Documentation

QHostAddress GeoIp::_ip [private]

IP address for this location.

Definition at line 69 of file geoip.h.

Referenced by GeoIp(), ip(), isEmpty(), and toString().

float GeoIp::_latitude [private]

Latitudinal coordinate for this IP's location.

Definition at line 70 of file geoip.h.

Referenced by GeoIp(), isEmpty(), latitude(), and toString().

float GeoIp::_longitude [private]

Longitudinal coordinate for this IP's location.

Definition at line 71 of file geoip.h.

Referenced by GeoIp(), isEmpty(), longitude(), and toString().

QString GeoIp::_city [private]

City in which this IP lives.

Definition at line 72 of file geoip.h.

Referenced by city(), GeoIp(), toLocation(), and toString().

QString GeoIp::_state [private]

State or district in which this IP lives.

Definition at line 73 of file geoip.h.

Referenced by GeoIp(), state(), toLocation(), and toString().

QString GeoIp::_country [private]

Country in which this IP lives.

Definition at line 74 of file geoip.h.

Referenced by country(), GeoIp(), toLocation(), and toString().


The documentation for this class was generated from the following files:
Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0