X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Ftiming%2Ftimezone.h;h=f5779fd374aca1f50c5aa5116f28840c90841e91;hb=6a7c2000027cd22eea603e936ddbad1a5bfc8b04;hp=5d3035d5b8f16637662d45bb5797963e25438a29;hpb=8be760b594f5e245e0a69efdef0baddab64193c8;p=simgear.git diff --git a/simgear/timing/timezone.h b/simgear/timing/timezone.h index 5d3035d5..f5779fd3 100644 --- a/simgear/timing/timezone.h +++ b/simgear/timing/timezone.h @@ -12,61 +12,96 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * **************************************************************************/ -/************************************************************************* +/** \file timezone.h * - * Timezone is derived from geocoord, and stores the timezone centerpoint, - * as well as the countrycode and the timezone descriptor. The latter is - * used in order to get the local time. + * Provides SGTimeZone and SGTimeZoneContainer * - ************************************************************************/ + */ #ifndef _TIMEZONE_H_ #define _TIMEZONE_H_ #include +#include #include -class Timezone : public GeoCoord +/** + * SGTimeZone is derived from geocoord, and stores the timezone centerpoint, + * as well as the countrycode and the timezone descriptor. The latter is + * used in order to get the local time. + * + */ + +class SGTimeZone : public SGGeoCoord { + private: - string countryCode; - string descriptor; + + std::string countryCode; + std::string descriptor; public: - Timezone() : - GeoCoord() - { - countryCode.erase(); - descriptor.erase(); + + /** + * Default constructor. + */ + SGTimeZone() : SGGeoCoord() + { + countryCode.erase(); + descriptor.erase(); }; - Timezone(float la, float lo, char* cc, char* desc); - Timezone(const char *infoString); - Timezone(const Timezone &other); - virtual ~Timezone() { }; - - virtual void print() { printf("%s", descriptor.c_str());}; - virtual const char * getDescription() { return descriptor.c_str(); }; + /** + * Build a timezone object with a specifed latitude, longitude, country + * code, and descriptor + * @param la latitude + * @param lo longitude + * @param cc country code + * @param desc descriptor + */ + SGTimeZone(float la, float lo, char* cc, char* desc); + + /** + * Build a timezone object from a textline in zone.tab + * @param infoString the textline from zone.tab + */ + SGTimeZone(const char *infoString); + + /** + * The copy constructor + * @param other the source object + */ + SGTimeZone(const SGTimeZone &other); + + /** + * Virutal destructor + */ + virtual ~SGTimeZone() { }; + + /** + * Return the descriptor string + * @return descriptor string (char array) + */ + virtual const char * getDescription() { return descriptor.c_str(); }; }; -/************************************************************************ - * Timezone container is derived from GeoCoordContainer, and has some +/** + * SGTimeZoneContainer is derived from SGGeoCoordContainer, and has some * added functionality. - ************************************************************************/ + */ -class TimezoneContainer : public GeoCoordContainer +class SGTimeZoneContainer : public SGGeoCoordContainer { public: - TimezoneContainer(const char *filename); - virtual ~TimezoneContainer(); + SGTimeZoneContainer(const char *filename); + virtual ~SGTimeZoneContainer(); };