Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

  1. // FaxTime.h: interface for the CFaxTime class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_FAXTIME_H__00A7FD8D_0FBC_4CA3_8187_836431261D07__INCLUDED_)
  5. #define AFX_FAXTIME_H__00A7FD8D_0FBC_4CA3_8187_836431261D07__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class CFaxDuration : public CTimeSpan
  10. {
  11. public:
  12. CFaxDuration () : CTimeSpan () {}
  13. CFaxDuration (time_t time) : CTimeSpan (time) {}
  14. virtual ~CFaxDuration () {}
  15. CString FormatByUserLocale () const;
  16. int Compare(const CFaxDuration & other) const
  17. { return (other == *this) ? 0 : ((*this < other) ? -1 : 1); }
  18. void Zero()
  19. { *this = CFaxDuration (0); }
  20. };
  21. class CFaxTime : public CTime
  22. {
  23. public:
  24. CFaxTime() : CTime () {}
  25. CFaxTime( const CFaxTime& timeSrc ) : CTime (timeSrc) {}
  26. CFaxTime( time_t time ) : CTime (time) {}
  27. CFaxTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 ) :
  28. CTime (nYear, nMonth, nDay, nHour, nMin, nSec, nDST)
  29. {}
  30. CFaxTime( WORD wDosDate, WORD wDosTime, int nDST = -1 ) : CTime (wDosDate, wDosTime, nDST)
  31. {}
  32. CFaxTime( const SYSTEMTIME& sysTime, int nDST = -1 ) : CTime (sysTime, nDST) {}
  33. CFaxTime( const FILETIME& fileTime, int nDST = -1 ) : CTime (fileTime, nDST) {}
  34. virtual ~CFaxTime() {}
  35. CString FormatByUserLocale (BOOL bLocal = FALSE) const;
  36. const CFaxTime &operator = (const SYSTEMTIME &SysTime)
  37. { *this = CFaxTime (SysTime); return *this; }
  38. CFaxDuration operator -( CFaxTime rhs ) const
  39. { return CFaxDuration(GetTime() - rhs.GetTime ()); }
  40. int Compare(const CFaxTime & other) const
  41. { return (other == *this) ? 0 : ((*this < other) ? -1 : 1); }
  42. void Zero()
  43. { *this = CFaxTime (0); }
  44. };
  45. #endif // !defined(AFX_FAXTIME_H__00A7FD8D_0FBC_4CA3_8187_836431261D07__INCLUDED_)