00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _OSGDATE_H_
00040 #define _OSGDATE_H_
00041
00042 #ifdef __sgi
00043 #pragma once
00044 #endif
00045
00046 #include <OSGConfig.h>
00047 #include <OSGBase.h>
00048 #include <OSGBaseTypes.h>
00049
00050 OSG_BEGIN_NAMESPACE
00051
00055 class OSG_BASE_DLLMAPPING Date
00056 {
00057
00058
00059 public:
00060
00061
00065 Date(void);
00066 Date(const Date &obj);
00067
00069
00073 virtual ~Date(void);
00074
00076
00080 void setSecond ( UInt32 second );
00081 UInt32 getSecond ( void );
00082
00083 void setMinute ( UInt32 minute );
00084 UInt32 getMinute ( void );
00085
00086 void setHour ( UInt32 hour );
00087 UInt32 getHour ( void );
00088
00089 void setDay ( UInt32 day );
00090 UInt32 getDay ( void );
00091
00092 void setYear ( Int32 year );
00093 Int32 getYear ( void );
00094
00095 void clear ( void );
00096 void setSystemDate( void );
00097
00098 void set (const Char8 *stringP );
00099
00100 bool isLeapYear ( void );
00101 bool valid ( void );
00102
00103 void set ( UInt32 day,
00104 UInt32 month,
00105 Int32 year,
00106 UInt32 hour = 0,
00107 UInt32 minute = 0,
00108 UInt32 second = 0);
00109
00111
00115 bool operator ==(const Date &other);
00116 bool operator !=(const Date &other);
00117 bool operator < (const Date &other);
00118
00120
00121 private:
00122
00123 UInt32 _second;
00124 UInt32 _minute;
00125 UInt32 _hour;
00126 UInt32 _day;
00127 UInt32 _month;
00128 UInt32 _year;
00129
00130
00131 friend
00132 std::ostream &operator <<( std::ostream &os,
00133 const Date &obj);
00134 friend
00135 std::istream &operator >>( std::istream &is,
00136 Date &obj);
00137 };
00138
00139 typedef Date* DateP;
00140
00141 std::ostream &operator <<(std::ostream &outStream, const Date &obj);
00142 std::istream &operator >>(std::istream &inStream, Date &obj);
00143
00144 OSG_END_NAMESPACE
00145
00146 #include <OSGDate.inl>
00147
00148 #endif // _OSGDATE_H_