Merge pull request #4011 from fritsch/vdpau-settings
[vuplus_xbmc] / lib / UnrarXLib / timefn.hpp
1 #ifndef _RAR_TIMEFN_
2 #define _RAR_TIMEFN_
3
4 struct RarLocalTime
5 {
6   uint Year;
7   uint Month;
8   uint Day;
9   uint Hour;
10   uint Minute;
11   uint Second;
12   uint Reminder;
13   uint wDay;
14   uint yDay;
15 };
16
17
18 class RarTime
19 {
20   private:
21     Int64 GetRaw();
22     void SetRaw(Int64 RawTime);
23
24     RarLocalTime rlt;
25
26     Int64 Time;
27   public:
28     RarTime();
29 #ifdef _WIN_32
30     RarTime& operator =(FILETIME &ft);
31     void GetWin32(FILETIME *ft);
32 #endif
33 #if defined(_UNIX) || defined(_EMX)
34     RarTime& operator =(time_t ut);
35     time_t GetUnix();
36 #endif
37     bool operator == (RarTime &rt);
38     bool operator < (RarTime &rt);
39     bool operator <= (RarTime &rt);
40     bool operator > (RarTime &rt);
41     bool operator >= (RarTime &rt);
42     void GetLocal(RarLocalTime *lt) {*lt=rlt;}
43     void SetLocal(RarLocalTime *lt) {rlt=*lt;}
44     uint GetDos();
45     void SetDos(uint DosTime);
46     void GetText(char *DateStr,bool FullYear);
47     void SetIsoText(char *TimeText);
48     void SetAgeText(char *TimeText);
49     void SetCurrentTime();
50     void Reset() {rlt.Year=0;}
51     bool IsSet() {return(rlt.Year!=0);}
52 };
53
54 const char *GetMonthName(int Month);
55 bool IsLeapYear(int Year);
56
57 #endif