diff options
Diffstat (limited to 'kweather/stationdatabase.h')
-rw-r--r-- | kweather/stationdatabase.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/kweather/stationdatabase.h b/kweather/stationdatabase.h new file mode 100644 index 0000000..1e020a9 --- /dev/null +++ b/kweather/stationdatabase.h @@ -0,0 +1,54 @@ +// +// +// C++ Interface: $MODULE$ +// +// Description: +// +// +// Author: ian reinhart geiser <geiseri@yahoo.com>, (C) 2003 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef STATIONDATABASE_H +#define STATIONDATABASE_H + +#include <qmap.h> +#include <qstring.h> + +#include <klocale.h> +#include <kstandarddirs.h> + +/** +This is the main database for mapping METAR codes to Station information. + +@author ian reinhart geiser +*/ + +class StationInfo; + +class StationDatabase +{ +public: + StationDatabase(const QString path = locate("data", "kweatherservice/stations.dat")); + ~StationDatabase(); + + QString stationNameFromID(const QString& id); + + QString stationLongitudeFromID( const QString &stationID); + + QString stationLatitudeFromID(const QString &stationID); + + QString stationCountryFromID( const QString &stationID); + + QString stationIDfromName( const QString &name ); + +private: + QMap<QString, StationInfo> theDB; + + bool loadStation( const QString & stationID ); + + const QString mPath; +}; + +#endif |