Class Hierarchy   Class Index   Method Index  

CHMdateTimeClass.h

00001 #ifndef __CHM_DATE_TIME_CLASS_H__
00002 #define __CHM_DATE_TIME_CLASS_H__
00003 //------------------------------------------------------------------------
00004 // Copyright (C) 1997-2007 iNTERFACEWARE Inc.  All Rights Reserved
00005 //
00006 // Module: CHMdateTimeClass
00007 //
00008 // Author: Greg Norman
00009 // Revision: $Revision: 1.21 $
00010 //
00011 // Last Edit Date: $Date: 2008-01-21 20:06:33 $
00012 // Source: $Source: /home/cvs/cvsroot/CHM/CHMdateTimeClass.h,v $
00013 //---------------------------------------------------------------------------
00014 #include <CHM/CHMminimumInclude.h>
00015 #include <time.h>
00016 
00017 class CHMdateTimePrivate;
00018 class CHMstring;
00019 
00024 class CHMdateTime 
00025 {
00026 public:
00028    CHMdateTime();
00029 
00031    CHMdateTime(time_t Time);
00032 
00035    explicit CHMdateTime(CHMdateTimeHandle Handle);
00036 
00038    CHMdateTime(const CHMdateTime& Orig);
00039 
00041    virtual ~CHMdateTime();
00042 
00044    CHMdateTime& operator=(time_t Time);
00045 
00047    CHMdateTime& operator=(const CHMdateTime& Orig);
00048 
00053    DATE Date() const;
00054 
00057    const CHMdateTimeHandle DateTimeHandle() const;
00058 
00060    int Day() const;
00061   
00063    int DayOfWeek() const;
00064 
00066    int DayOfYear() const; 
00067 
00070    CHMstring Dump() const;
00071 
00073    int Hour() const; 
00074 
00078    CHMboolean IsNull() const;
00079 
00081    int Minute() const; 
00082 
00084    int Month() const;
00085 
00087    static CHMdateTime Now();
00088 
00090    int Second() const;
00091 
00093    double SecondFraction() const;
00094 
00097    CHMboolean SetDate(int nYear, int nMonth, int nDay);
00098 
00100    void SetDate(DATE NewValue);
00101 
00104    CHMboolean SetDateTime(int nYear, int nMonth, int nDay,
00105                           int nHour, int nMin,   int nSec);
00106 
00108    void setNull();
00109 
00111    void SetSecondFraction(double Value);
00112 
00115    CHMboolean SetTime(int nHour, int nMin, int nSec);
00116   
00118    void SetZone(short Value);
00119    
00121    int Year() const;
00122 
00124    short Zone() const;
00125 
00126    // This function is deprecated. Use Dump instead. 
00127    // See manual for migration guide.
00128    //
00129    //void PrintOn(ostream& Stream) const;
00130 
00131 private:
00132    CHMdateTimePrivate* pMember;
00133 };
00134 
00135 // This function is deprecated. Use Dump instead. 
00136 // See manual for migration guide.
00137 //
00138 // ostream& operator<<(ostream& Stream, const CHMdateTime& DateTime);
00139 
00140 #endif // end of defensive include