Vidalia
0.2.21
|
#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 ®ion, 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 |
Definition at line 24 of file GeoIpRecord.h.
GeoIpRecord::GeoIpRecord | ( | ) |
Default constructor. Creates an empty GeoIpRecord object.
Definition at line 26 of file GeoIpRecord.cpp.
References _latitude, and _longitude.
GeoIpRecord::GeoIpRecord | ( | const QHostAddress & | ip, |
float | latitude, | ||
float | longitude, | ||
const QString & | country, | ||
const QString & | countryCode | ||
) |
Definition at line 32 of file GeoIpRecord.cpp.
References _country, _countryCode, _ip, _latitude, _longitude, country(), countryCode(), ip(), latitude(), and longitude().
GeoIpRecord::GeoIpRecord | ( | const QHostAddress & | ip, |
float | latitude, | ||
float | longitude, | ||
const QString & | city, | ||
const QString & | region, | ||
const QString & | country, | ||
const QString & | countryCode | ||
) |
Definition at line 42 of file GeoIpRecord.cpp.
References _city, _country, _countryCode, _ip, _latitude, _longitude, _region, city(), country(), countryCode(), ip(), latitude(), longitude(), and region().
|
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().
|
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().
|
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.
Referenced by GeoIpRecord(), and RouterListItem::setLocation().
|
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().
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().
|
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().
|
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().
|
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().
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(), NetViewer::displayRouterInfo(), GeoIpDatabase::recordByAddr(), and RouterListItem::setLocation().
|
private |
City in which this IP lives.
Definition at line 93 of file GeoIpRecord.h.
Referenced by city(), GeoIpRecord(), and toString().
|
private |
Country in which this IP lives.
Definition at line 95 of file GeoIpRecord.h.
Referenced by country(), GeoIpRecord(), and toString().
|
private |
ISO-3166-1 alpha-2 country code.
Definition at line 96 of file GeoIpRecord.h.
Referenced by countryCode(), GeoIpRecord(), and toString().
|
private |
IP address for this location.
Definition at line 90 of file GeoIpRecord.h.
Referenced by GeoIpRecord(), ip(), and isValid().
|
private |
Latitudinal coordinate for this IP's location.
Definition at line 91 of file GeoIpRecord.h.
Referenced by GeoIpRecord(), isValid(), and latitude().
|
private |
Longitudinal coordinate for this IP's location.
Definition at line 92 of file GeoIpRecord.h.
Referenced by GeoIpRecord(), isValid(), and longitude().
|
private |
State or district in which this IP lives.
Definition at line 94 of file GeoIpRecord.h.
Referenced by GeoIpRecord(), region(), and toString().