Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

date.h

00001 /***************************************************************************
00002                           calendar.cpp  -  description
00003                              -------------------
00004     begin                : Wed April 7 2004
00005     copyright            : (C) 2004 by Daroth-U
00006     email                : daroth-u@ifrance.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef DATE_H
00019 #define DATE_H
00020 
00021 //uncomment to debug
00022 //#define DEBUG_DATE
00023 
00024 #include "constants.h"
00025 
00031 class Date {
00032  private:    
00033      
00034   int sec;      // 0 to 59
00035   int min;      // 0 to 59
00036   int hour;     // 0 to 23  
00037   int day;      // 1 to 31 or 30 or 29
00038   int month;    // 1 to 12
00039   int year;     // -32000 to +32000      
00040 
00041   char dateString[100];  
00042   void buildDateString();    
00043   
00044  public:
00045  
00046   static int dayInMonth[13]; 
00047   static const char * monthName[13];
00048   static const char * dayName[8]; 
00049     
00050   void addSeconds(int nbSec);
00051   void addDate(Date d); 
00052   void setDate(int s, int m, int h, int day, int month, int year);
00053      
00054   inline int getYear()        { return year; }
00055   inline int getMonth()       { return month; }
00056   inline int getDay()         { return day; }
00057   inline int getHour()        { return hour;}
00058   inline int getMin()         { return min; }
00059   inline int getSec()         { return sec; }
00060   inline char * getDateString()   { buildDateString();return dateString; }
00061   void reset();    
00062   
00063   /*bool operator==(const Date &d);
00064   bool operator<=(const Date &d);
00065   bool operator<(const Date &d);*/
00066   
00067   bool isInferiorTo(Date d);
00068   bool isEqualTo(Date d);
00069   void print();
00070   bool isADayLater(Date date);
00071   
00072   Date();
00073   Date(int sec, int min, int hour, int day, int month, int year);
00074   ~Date();
00075   
00076  protected:
00077   
00078 
00079 };
00080 
00081 #endif

Generated on Thu Jun 16 21:50:42 2005 for scourge by  doxygen 1.4.0