#include <geoipcacheitem.h>
Public Member Functions | |
GeoIpCacheItem () | |
GeoIpCacheItem (GeoIp geoip, QDateTime timestamp) | |
QHostAddress | ip () const |
GeoIp | geoip () const |
bool | isExpired () const |
QString | toString () const |
Static Public Member Functions | |
static GeoIpCacheItem | fromString (QString cacheString) |
Private Attributes | |
GeoIp | _geoip |
QDateTime | _timestamp |
Definition at line 36 of file geoipcacheitem.h.
GeoIpCacheItem::GeoIpCacheItem | ( | ) | [inline] |
GeoIpCacheItem::GeoIpCacheItem | ( | GeoIp | geoip, | |
QDateTime | timestamp | |||
) |
Constructor.
Definition at line 34 of file geoipcacheitem.cpp.
References _geoip, _timestamp, and geoip().
QHostAddress GeoIpCacheItem::ip | ( | ) | const [inline] |
Returns the IP of this cache item.
Definition at line 45 of file geoipcacheitem.h.
References _geoip, and GeoIp::ip().
GeoIp GeoIpCacheItem::geoip | ( | ) | const [inline] |
Returns the cached GeoIp object.
Definition at line 47 of file geoipcacheitem.h.
References _geoip.
Referenced by fromString(), and GeoIpCacheItem().
bool GeoIpCacheItem::isExpired | ( | ) | const |
Returns true if this cache item is expired.
Definition at line 67 of file geoipcacheitem.cpp.
References _timestamp.
Referenced by GeoIpCache::saveToDisk().
QString GeoIpCacheItem::toString | ( | ) | const |
Returns a string representing the contents of this cache item, suitable for writing to disk.
Definition at line 45 of file geoipcacheitem.cpp.
References _geoip, _timestamp, and GeoIp::toString().
Referenced by GeoIpCache::saveToDisk().
GeoIpCacheItem GeoIpCacheItem::fromString | ( | QString | cacheString | ) | [static] |
Returns a GeoIpCacheItem from a string as read from the cache that was written to disk.
Definition at line 55 of file geoipcacheitem.cpp.
References GeoIp::fromString(), geoip(), and GeoIpCacheItem().
Referenced by GeoIpCache::loadFromDisk().
GeoIp GeoIpCacheItem::_geoip [private] |
Cached GeoIp item.
Definition at line 59 of file geoipcacheitem.h.
Referenced by geoip(), GeoIpCacheItem(), ip(), and toString().
QDateTime GeoIpCacheItem::_timestamp [private] |
Time this item was cached.
Definition at line 60 of file geoipcacheitem.h.
Referenced by GeoIpCacheItem(), isExpired(), and toString().