]> git.mxchange.org Git - flightgear.git/blob - src/Time/timezone.h
Added first stab at a socket class.
[flightgear.git] / src / Time / timezone.h
1 /* -*- Mode: C++ -*- *****************************************************
2  * timezone.h
3  * Written by Durk Talsma. Started July 1999.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
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., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  **************************************************************************/
20
21 /*************************************************************************
22  *
23  * Timezone is derived from geocoord, and stores the timezone centerpoint,
24  * as well as the countrycode and the timezone descriptor. The latter is 
25  * used in order to get the local time. 
26  *
27  ************************************************************************/
28
29 #ifndef _TIMEZONE_H_
30 #define _TIMEZONE_H_
31
32 #include "geocoord.h"
33 #include <stdio.h>
34
35 class Timezone : public GeoCoord
36 {
37 private:
38   char* countryCode;
39   char* descriptor;
40
41 public:
42   Timezone() :
43     GeoCoord()
44     { 
45       countryCode = 0; 
46       descriptor = 0;
47     };
48   Timezone(float la, float lo, char* cc, char* desc);
49   Timezone(const char *infoString);
50   Timezone(const Timezone &other);
51   virtual ~Timezone() { delete [] countryCode; delete [] descriptor; };
52   
53
54   virtual void print() { printf("%s", descriptor);};
55   virtual char * getDescription() { return descriptor; };
56 };
57
58 /************************************************************************
59  * Timezone container is derived from GeoCoordContainer, and has some 
60  * added functionality.
61  ************************************************************************/
62
63 class TimezoneContainer : public GeoCoordContainer
64 {
65  public:
66   TimezoneContainer(const char *filename);
67   virtual ~TimezoneContainer();
68 };
69
70
71
72 #endif // _TIMEZONE_H_