21 #include <tqdatastream.h>
28 : mLatitude( 91 ), mLongitude( 181 ), mValidLat( false ), mValidLong( false )
40 if ( latitude >= -90 && latitude <= 90 ) {
56 if ( longitude >= -180 && longitude <= 180 ) {
72 return mValidLat && mValidLong;
75 bool Geo::operator==(
const Geo &g )
const
79 if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude )
return true;
83 bool Geo::operator!=(
const Geo &g )
const
87 if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude )
return false;
93 return "(" + TQString::number(mLatitude) +
"," + TQString::number(mLongitude) +
")";
96 TQDataStream &KABC::operator<<( TQDataStream &s,
const Geo &geo )
98 return s << (float)geo.mLatitude << (
float)geo.mLongitude;
101 TQDataStream &KABC::operator>>( TQDataStream &s,
Geo &geo )
103 s >> geo.mLatitude >> geo.mLongitude;
105 geo.mValidLat =
true;
106 geo.mValidLong =
true;