📄 timeex.hpp
字号:
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - -
// - File: timeex.hpp. -
// - -
// - Contents: Interface of CTimeEx. -
// - -
// - Purpose: - -
// - -
// - Remarks: - -
// - -
// - Originator: Michael Mogensen, MM-IT Consult 2003. -
// - -
// - Compiler: MS Visual C++ ver6.0. -
// - -
// - Period: 00.00.00 - 00.00.00. -
// - -
// - Version: 1.00. -
// - -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - Miscellaneous. -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - Header(s). -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
#pragma once
#include "generic.h"
#include "string.hpp"
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - Miscellaneous. -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
#define DAY_SUNDAY 1
#define DAY_MONDAY 2
#define DAY_TUESDAY 3
#define DAY_WEDNESDAY 4
#define DAY_THURSDAY 5
#define DAY_FRIDAY 6
#define DAY_SATURDAY 7
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - CTimeSpanEx. -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
class CTimeSpanEx : public CTimeSpan
{
public:
// 1. Object. (alphabetical).
CTimeSpanEx() :
CTimeSpan()
{}
CTimeSpanEx(const CTimeSpan &ts) :
CTimeSpan(ts)
{}
/*
CTimeSpanEx(time_t t) :
CTimeSpan(t)
{}
*/
CTimeSpanEx(LONG lDays, int iHours = 0, int iMin = 0, int iSec = 0) :
CTimeSpan(lDays, iHours, iMin, iSec)
{}
};
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - CTimeEx. -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
class CTimeEx : public CTime
{
public:
// 1. Object. (alphabetical).
inline CTimeEx() :
CTime(CTime::GetCurrentTime())
{}
inline CTimeEx(const CTime &t) :
CTime(t)
{}
inline CTimeEx(int iYear, int iMonth, int iDay, int iHour = 0, int iMin = 0, int iSec = 0, int iDST = -1) :
CTime(iYear, iMonth, iDay, iHour, iMin, iSec, iDST)
{}
virtual ~CTimeEx()
{}
// 4. Slaves. (alphabetical).
//
// ******************************
// * Second related. *
// ******************************
// ******************************
// * Minute related. *
// ******************************
// ******************************
// * Hour related. *
// ******************************
// ******************************
// * Day related. *
// ******************************
const CString
GetDay_Desc(const bool);
const CString
GetDay_Desc(const int, const bool);
const CTimeEx
GetDay_FirstOfMonth();
static const int
GetDay_FirstOfWeek();
const CTimeEx
GetDay_FirstOfYear();
const CTimeEx
GetDay_FirstOfYear(const int);
const CTimeEx
GetDay_LastOfMonth();
const CTimeEx
GetDay_LastOfMonth(const int);
const CTimeEx
GetDay_LastOfYear();
const CTimeEx
GetDay_LastOfYear(const int);
// ******************************
// * Week related. *
// ******************************
const int
GetWeek_No();
const int
GetWeek_No_FirstOfYear();
const int
GetWeek_No_FirstOfYear(const int);
const int
GetWeek_No_LastOfYear();
const int
GetWeek_No_LastOfYear(const int);
const int
GetWeek_No_TotalOfMonth(const int);
const int
GetWeek_No_TotalOfYear();
const bool
IsWeekend();
const bool
IsWeekend(const int);
// ******************************
// * Month related. *
// ******************************
const CString
GetMonth_Desc();
static const CString
GetMonth_Desc(const int);
const int
GetMonth_Length();
const int
GetMonth_Length(const int);
// ******************************
// * Year related. *
// ******************************
const bool
IsLeapYear();
static const bool
IsLeapYear(const int);
// ******************************
// * General. *
// ******************************
const CString
GetUSDate(const bool);
};
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// - -
// ------------------------------------------------------------------------------------------------------------------------------------------------------
// 0. Data. (alphabetical).
// 1. Object. (alphabetical).
// 2. Event's. (alphabetical).
// 3.0. Menu choice. (menu order).
// 3.1. Menu choice, enablers. (menu order).
// 4. Slaves. (alphabetical).
// 5. Other. (alphabetical).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -