1 /* -*- Mode: C++ -*- *****************************************************
3 * Written by Durk Talsma. Started July 1999.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 **************************************************************************/
23 * Provides SGTimeZone and SGTimeZoneContainer
33 #include <simgear/math/SGMath.hxx>
34 #include <simgear/math/SGGeod.hxx>
37 * SGTimeZone stores the timezone centerpoint,
38 * as well as the countrycode and the timezone descriptor. The latter is
39 * used in order to get the local time.
48 SGVec3d centerpoint; // centre of timezone, in cartesian coordinates
49 std::string countryCode;
50 std::string descriptor;
55 * Build a timezone object with a specifed latitude, longitude, country
56 * code, and descriptor
57 * @param pt centerpoint
58 * @param cc country code
59 * @param desc descriptor
61 SGTimeZone(const SGGeod& pt, char* cc, char* desc);
64 * Build a timezone object from a textline in zone.tab
65 * @param infoString the textline from zone.tab
67 SGTimeZone(const char *infoString);
70 * The copy constructor
71 * @param other the source object
73 SGTimeZone(const SGTimeZone &other);
76 * Return the descriptor string
77 * @return descriptor string (char array)
79 const char * getDescription() { return descriptor.c_str(); };
81 const SGVec3d& cartCenterpoint() const
91 class SGTimeZoneContainer
94 SGTimeZoneContainer(const char *filename);
95 ~SGTimeZoneContainer();
97 SGTimeZone* getNearest(const SGGeod& ref) const;
100 typedef std::vector<SGTimeZone*> TZVec;
106 #endif // _TIMEZONE_H_