Ai
1 Star 0 Fork 0

linuxmail/unrar-nonfree

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
timefn.hpp 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
Norbert Preining 提交于 2018-10-24 17:44 +08:00 . Import Upstream version 5.5.8
#ifndef _RAR_TIMEFN_
#define _RAR_TIMEFN_
struct RarLocalTime
{
uint Year;
uint Month;
uint Day;
uint Hour;
uint Minute;
uint Second;
uint Reminder; // Part of time smaller than 1 second, represented in 1/REMINDER_PRECISION intervals.
uint wDay;
uint yDay;
};
class RarTime
{
private:
static const uint TICKS_PER_SECOND = 1000000000; // Internal precision.
// Internal time representation in 1/TICKS_PER_SECOND since 01.01.1601.
// We use nanoseconds here to handle the high precision Unix time.
uint64 itime;
public:
// RarLocalTime::Reminder precision. Must be equal to TICKS_PER_SECOND.
// Unlike TICKS_PER_SECOND, it is a public field.
static const uint REMINDER_PRECISION = TICKS_PER_SECOND;
public:
RarTime() {Reset();}
bool operator == (RarTime &rt) {return itime==rt.itime;}
bool operator != (RarTime &rt) {return itime!=rt.itime;}
bool operator < (RarTime &rt) {return itime<rt.itime;}
bool operator <= (RarTime &rt) {return itime<rt.itime || itime==rt.itime;}
bool operator > (RarTime &rt) {return itime>rt.itime;}
bool operator >= (RarTime &rt) {return itime>rt.itime || itime==rt.itime;}
void GetLocal(RarLocalTime *lt);
void SetLocal(RarLocalTime *lt);
#ifdef _WIN_ALL
void GetWinFT(FILETIME *ft);
void SetWinFT(FILETIME *ft);
#endif
uint64 GetWin();
void SetWin(uint64 WinTime);
time_t GetUnix();
void SetUnix(time_t ut);
uint64 GetUnixNS();
void SetUnixNS(uint64 ns);
uint GetDos();
void SetDos(uint DosTime);
void GetText(wchar *DateStr,size_t MaxSize,bool FullMS);
void SetIsoText(const wchar *TimeText);
void SetAgeText(const wchar *TimeText);
void SetCurrentTime();
void Reset() {itime=0;}
bool IsSet() {return itime!=0;}
void Adjust(int64 ns);
};
const wchar *GetMonthName(int Month);
bool IsLeapYear(int Year);
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/linuxmail/unrar-nonfree.git
git@gitee.com:linuxmail/unrar-nonfree.git
linuxmail
unrar-nonfree
unrar-nonfree
master

搜索帮助