diff options
Diffstat (limited to 'plugins/UserInfoEx/src/classMTime.h')
-rw-r--r-- | plugins/UserInfoEx/src/classMTime.h | 99 |
1 files changed, 50 insertions, 49 deletions
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index 2964a0dc3c..78ff1b23dd 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -22,22 +22,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
class MTime {
- SYSTEMTIME _SysTime;
- BYTE _isLocal;
+ SYSTEMTIME _SysTime;
+ bool _isLocal;
- LONG _Offset(TIME_ZONE_INFORMATION *tzi);
+ LONG _Offset(TIME_ZONE_INFORMATION *tzi);
public:
// contruction
MTime();
- MTime(SYSTEMTIME &st, const BYTE bIsLocal);
- MTime(FILETIME &ft, const BYTE bIsLocal);
- MTime(LARGE_INTEGER &li, const BYTE bIsLocal);
+ MTime(SYSTEMTIME &st, bool bIsLocal);
+ MTime(FILETIME &ft, bool bIsLocal);
+ MTime(LARGE_INTEGER &li, bool bIsLocal);
MTime(DWORD dwStamp);
MTime(const MTime& mtime);
// checks
- __inline BYTE IsLocal() const { return _isLocal; };
+ __inline bool IsLocal() const { return _isLocal; }
BYTE IsValid() const;
BYTE IsLeapYear() const;
@@ -49,60 +49,61 @@ public: // get value from class
LARGE_INTEGER LargeInt() const;
- FILETIME FileTime() const;
- DWORD TimeStamp() const;
- SYSTEMTIME SystemTime() const { return _SysTime; };
- WORD DaysInMonth(const WORD &wMonth) const;
- WORD DaysInYear(BYTE bIgnoreLeap = FALSE) const;
- WORD DayOfYear() const;
- WORD AdjustYear(const int nDiffDays);
-
- WORD TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
- WORD TimeFormat(tstring& str);
- WORD DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
- WORD DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
- WORD DateFormatLong(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
+ FILETIME FileTime() const;
+ DWORD TimeStamp() const;
+ SYSTEMTIME SystemTime() const { return _SysTime; }
+
+ WORD DaysInMonth(const WORD &wMonth) const;
+ WORD DaysInYear(BYTE bIgnoreLeap = FALSE) const;
+ WORD DayOfYear() const;
+ WORD AdjustYear(const int nDiffDays);
+
+ WORD TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
+ WORD TimeFormat(tstring& str);
+ WORD DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
+ WORD DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
+ WORD DateFormatLong(LPTSTR ptszTimeFormat, WORD cchTimeFormat);
// return single attributes
- __inline WORD DayOfWeek() const { return _SysTime.wDayOfWeek; };
- __inline WORD Day() const { return _SysTime.wDay; };
- __inline WORD Month() const { return _SysTime.wMonth; };
- __inline WORD Year() const { return _SysTime.wYear; };
- __inline WORD Hour() const { return _SysTime.wHour; };
- __inline WORD Minute() const { return _SysTime.wMinute; };
- __inline WORD Second() const { return _SysTime.wSecond; };
+ __inline WORD DayOfWeek() const { return _SysTime.wDayOfWeek; }
+ __inline WORD Day() const { return _SysTime.wDay; }
+ __inline WORD Month() const { return _SysTime.wMonth; }
+ __inline WORD Year() const { return _SysTime.wYear; }
+ __inline WORD Hour() const { return _SysTime.wHour; }
+ __inline WORD Minute() const { return _SysTime.wMinute; }
+ __inline WORD Second() const { return _SysTime.wSecond; }
// set single values
- __inline void Minute(const WORD wMinute) { if (wMinute <= 59) _SysTime.wMinute = wMinute; };
- __inline void Hour(const WORD wHour) { if (wHour <= 24) _SysTime.wHour = wHour; };
- __inline void Day(const WORD wDay) { if (wDay <= 31) _SysTime.wDay = wDay; };
- __inline void Month(const WORD wMonth) { if (wMonth <= 12) _SysTime.wMonth = wMonth; };
- __inline void Year(const WORD wYear) { _SysTime.wYear = wYear; };
+ __inline void Minute(const WORD wMinute) { if (wMinute <= 59) _SysTime.wMinute = wMinute; }
+ __inline void Hour(const WORD wHour) { if (wHour <= 24) _SysTime.wHour = wHour; }
+ __inline void Day(const WORD wDay) { if (wDay <= 31) _SysTime.wDay = wDay; }
+ __inline void Month(const WORD wMonth) { if (wMonth <= 12) _SysTime.wMonth = wMonth; }
+ __inline void Year(const WORD wYear) { _SysTime.wYear = wYear; }
// set value to class
- void ZeroDate();
- void FromStampAsUTC(const DWORD dwTimeStamp);
- void FromStampAsLocal(const DWORD dwTimeStamp);
- void Set(FILETIME &ftFileTime, const BYTE bIsLocal);
- void Set(LARGE_INTEGER liFileTime, const BYTE bIsLocal);
- void Set(SYSTEMTIME &st, const BYTE bIsLocal);
- void Set(const MTime &mt);
+ void ZeroDate();
+ void FromStampAsUTC(const DWORD dwTimeStamp);
+ void FromStampAsLocal(const DWORD dwTimeStamp);
+ void Set(const FILETIME &ftFileTime, bool bIsLocal);
+ void Set(LARGE_INTEGER liFileTime, bool bIsLocal);
+ void Set(const SYSTEMTIME &st, bool bIsLocal);
+ void Set(const MTime &mt);
// get current time
- void GetTimeUTC();
- void GetLocalTime();
- void GetLocalTime(MCONTACT hContact);
+ void GetTimeUTC();
+ void GetLocalTime();
+ void GetLocalTime(MCONTACT hContact);
// conversions
- void UTCToLocal();
- void UTCToTzSpecificLocal(int tzh);
- void UTCToTzSpecificLocal(TIME_ZONE_INFORMATION *tzi);
- void LocalToUTC();
- void TzSpecificLocalToUTC(TIME_ZONE_INFORMATION *tzi);
+ void UTCToLocal();
+ void UTCToTzSpecificLocal(int tzh);
+ void UTCToTzSpecificLocal(TIME_ZONE_INFORMATION *tzi);
+ void LocalToUTC();
+ void TzSpecificLocalToUTC(TIME_ZONE_INFORMATION *tzi);
// read and write from and to db
- int DBGetStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- int DBWriteStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ int DBGetStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ int DBWriteStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
// operatoren
void operator = (DWORD& dwTimeStamp) { FromStampAsUTC(dwTimeStamp); };
|