Vidalia  0.3.1
Public Member Functions | Private Attributes | List of all members
GeoIpRecord Class Reference

#include <GeoIpRecord.h>

Public Member Functions

 GeoIpRecord ()
 
 GeoIpRecord (const QHostAddress &ip, float latitude, float longitude, const QString &country, const QString &countryCode)
 
 GeoIpRecord (const QHostAddress &ip, float latitude, float longitude, const QString &city, const QString &region, const QString &country, const QString &countryCode)
 
QHostAddress ip () const
 
float latitude () const
 
float longitude () const
 
QString city () const
 
QString region () const
 
QString country () const
 
QString countryCode () const
 
QString toString () const
 
bool isValid () const
 

Private Attributes

QHostAddress _ip
 
float _latitude
 
float _longitude
 
QString _city
 
QString _region
 
QString _country
 
QString _countryCode
 

Detailed Description

Definition at line 24 of file GeoIpRecord.h.

Constructor & Destructor Documentation

§ GeoIpRecord() [1/3]

GeoIpRecord::GeoIpRecord ( )

Default constructor. Creates an empty GeoIpRecord object.

Definition at line 26 of file GeoIpRecord.cpp.

References _latitude, and _longitude.

§ GeoIpRecord() [2/3]

GeoIpRecord::GeoIpRecord ( const QHostAddress &  ip,
float  latitude,
float  longitude,
const QString &  country,
const QString &  countryCode 
)

§ GeoIpRecord() [3/3]

GeoIpRecord::GeoIpRecord ( const QHostAddress &  ip,
float  latitude,
float  longitude,
const QString &  city,
const QString &  region,
const QString &  country,
const QString &  countryCode 
)

Member Function Documentation

§ city()

QString GeoIpRecord::city ( ) const
inline

Returns the name of the city associated with this IP address, if known. Otherwise, returns an empty QString.

Definition at line 59 of file GeoIpRecord.h.

References _city.

Referenced by GeoIpRecord().

§ country()

QString GeoIpRecord::country ( ) const
inline

Returns the full name of the country associated with this IP address or range of IP addresses, if known. Otherwise, returns an empty QString.

Definition at line 69 of file GeoIpRecord.h.

References _country.

Referenced by TorMapWidget::addRouter(), and GeoIpRecord().

§ countryCode()

QString GeoIpRecord::countryCode ( ) const
inline

Returns the ISO 3166-1 alpha-2 two-letter country code of the country associated with this IP address or range of IP addresses, if known. Otherwise, returns an empty QString.

Definition at line 75 of file GeoIpRecord.h.

References _countryCode, isValid(), and toString().

Referenced by GeoIpRecord(), and RouterListItem::setLocation().

§ ip()

QHostAddress GeoIpRecord::ip ( ) const
inline

Returns the IP address associated with this GeoIP object.

Definition at line 44 of file GeoIpRecord.h.

References _ip.

Referenced by NetViewer::addRouter(), and GeoIpRecord().

§ isValid()

bool GeoIpRecord::isValid ( ) const

Returns true if the GeoIpRecord object is valid. A valid GeoIpRecord object must have valid IP address, valid latitude and longitude coordinates and a two-letter country code.

Definition at line 56 of file GeoIpRecord.cpp.

References _ip, _latitude, _longitude, IS_VALID_LATITUDE, and IS_VALID_LONGITUDE.

Referenced by NetViewer::addRouter(), and countryCode().

§ latitude()

float GeoIpRecord::latitude ( ) const
inline

Returns the latitude portion of the geographic coordinates associated with this IP address or range of IP addresses.

Definition at line 49 of file GeoIpRecord.h.

References _latitude.

Referenced by TorMapImageView::addRouter(), TorMapWidget::addRouter(), and GeoIpRecord().

§ longitude()

float GeoIpRecord::longitude ( ) const
inline

Returns the longitude portion of the geographic coordinates associated with this IP address or range of IP addresses.

Definition at line 54 of file GeoIpRecord.h.

References _longitude.

Referenced by TorMapImageView::addRouter(), TorMapWidget::addRouter(), and GeoIpRecord().

§ region()

QString GeoIpRecord::region ( ) const
inline

Returns the full region name (e.g., state) in which this IP address resides, if known. Otherwise, returns an empty QString.

Definition at line 64 of file GeoIpRecord.h.

References _region.

Referenced by GeoIpRecord().

§ toString()

QString GeoIpRecord::toString ( ) const

Returns a human-readable string of city, region(state), and country. Some fields may be absent if they are not known. If no fields are known, this will return an empty QString.

Definition at line 64 of file GeoIpRecord.cpp.

References _city, _country, _countryCode, and _region.

Referenced by TorMapWidget::addRouter(), countryCode(), NetViewer::displayRouterInfo(), GeoIpDatabase::recordByAddr(), and RouterListItem::setLocation().

Member Data Documentation

§ _city

QString GeoIpRecord::_city
private

City in which this IP lives.

Definition at line 93 of file GeoIpRecord.h.

Referenced by city(), GeoIpRecord(), and toString().

§ _country

QString GeoIpRecord::_country
private

Country in which this IP lives.

Definition at line 95 of file GeoIpRecord.h.

Referenced by country(), GeoIpRecord(), and toString().

§ _countryCode

QString GeoIpRecord::_countryCode
private

ISO-3166-1 alpha-2 country code.

Definition at line 96 of file GeoIpRecord.h.

Referenced by countryCode(), GeoIpRecord(), and toString().

§ _ip

QHostAddress GeoIpRecord::_ip
private

IP address for this location.

Definition at line 90 of file GeoIpRecord.h.

Referenced by GeoIpRecord(), ip(), and isValid().

§ _latitude

float GeoIpRecord::_latitude
private

Latitudinal coordinate for this IP's location.

Definition at line 91 of file GeoIpRecord.h.

Referenced by GeoIpRecord(), isValid(), and latitude().

§ _longitude

float GeoIpRecord::_longitude
private

Longitudinal coordinate for this IP's location.

Definition at line 92 of file GeoIpRecord.h.

Referenced by GeoIpRecord(), isValid(), and longitude().

§ _region

QString GeoIpRecord::_region
private

State or district in which this IP lives.

Definition at line 94 of file GeoIpRecord.h.

Referenced by GeoIpRecord(), region(), and toString().


The documentation for this class was generated from the following files: