Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGDate.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
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     /*==========================  PUBLIC  =================================*/
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     /*===========================  PRIVATE  ===============================*/
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_

Generated on Thu Aug 25 04:02:32 2005 for OpenSG by  doxygen 1.4.3