Pyro higlevel API
|
Abstract datatype for date and time. More...
Classes | |
class | Private |
Public Member Functions | |
DateTime () | |
Default constructor. More... | |
DateTime (const DateTime &cDateTime) | |
Copy constructor. More... | |
DateTime (const String &cTime) | |
Constructor: string. More... | |
DateTime (struct tm *psTime) | |
Constructor: struct tm. More... | |
DateTime (int nTime) | |
Constructor: Unix Epoch. More... | |
DateTime (int nYear, int nMonth, int nDay) | |
Constructor: Date. More... | |
DateTime (int nHour, int nMin, int nSec, int nUSec) | |
Constructor: Time. More... | |
~DateTime () | |
int | GetDay () const |
Get day of month. More... | |
int | GetMonth () const |
Get month of year. More... | |
int | GetYear () const |
Get year. More... | |
int | GetHour () const |
Get hours. More... | |
int | GetMin () const |
Get minutes. More... | |
int | GetSec () const |
Get seconds. More... | |
int | GetUSec () const |
int | GetDayOfWeek () const |
double | GetDaycount () const |
Get number of days. More... | |
double | GetJulianDate () const |
Get Julian date. More... | |
time_t | GetEpoch () const |
Get Unix Epoch. More... | |
String | GetDate () const |
void | SetTime (int nHour, int nMin, int nSec, int nUSec) |
Set time value. More... | |
void | SetDate (int nYear, int nMonth, int nDay) |
Set date value. More... | |
bool | SetDate (const String &cDate) |
bool | IsValid () const |
Check if date is valid. More... | |
DateTime & | operator= (const DateTime &cTime) |
Assign a DateTime value. More... | |
DateTime | operator+ (const DateTime &cTime) const |
Add a DateTime value. More... | |
DateTime | operator+ (double vDays) const |
Add a number of days to date. More... | |
DateTime | operator- (const DateTime &cTime) const |
Subtract a DateTime value. More... | |
DateTime | operator- (double vDays) const |
Subtract a number of days from date. More... | |
DateTime & | operator+= (const DateTime &cTime) |
Add a DateTime value. More... | |
DateTime & | operator+= (double vDays) |
Add a number of days to date. More... | |
DateTime & | operator-= (const DateTime &cTime) |
Subtract a DateTime value. More... | |
DateTime & | operator-= (double vDays) |
Subtract a number of days from date. More... | |
int | operator== (const DateTime &cTime) const |
Compare dates. More... | |
int | operator!= (const DateTime &cTime) const |
Compare dates. More... | |
int | operator< (const DateTime &cTime) const |
Compare dates. More... | |
int | operator> (const DateTime &cTime) const |
Compare dates. More... | |
operator time_t () const | |
operator std::string () const | |
operator os::String () const | |
virtual size_t | GetFlattenedSize (void) const |
virtual status_t | Flatten (uint8 *pBuffer, size_t nSize) const |
virtual status_t | Unflatten (const uint8 *pBuffer) |
virtual int | GetType (void) const |
Public Member Functions inherited from os::Flattenable | |
virtual bool | TypeIsCompatible (int nType) const |
Static Public Member Functions | |
static DateTime | Now () |
Get current date and time. More... | |
DateTime::DateTime | ( | ) |
Referenced by Now().
DateTime::DateTime | ( | const DateTime & | cDateTime | ) |
References os::DateTime::Private::Copy().
DateTime::DateTime | ( | const String & | cDate | ) |
DateTime::DateTime | ( | struct tm * | psTime | ) |
References os::DateTime::Private::m_bJulian, os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, and os::DateTime::Private::m_vSec.
DateTime::DateTime | ( | int | nTime | ) |
References os::DateTime::Private::m_bJulian, os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, os::DateTime::Private::m_vSec, and os::DateTime::Private::ToJulian().
DateTime::DateTime | ( | int | nYear, |
int | nMonth, | ||
int | nDay | ||
) |
References os::DateTime::Private::m_bJulian, os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, and os::DateTime::Private::m_vSec.
DateTime::DateTime | ( | int | nHour, |
int | nMin, | ||
int | nSec, | ||
int | nUSec | ||
) |
References os::DateTime::Private::m_bJulian, os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, and os::DateTime::Private::m_vSec.
DateTime::~DateTime | ( | ) |
|
virtual |
Implements os::Flattenable.
References os::DateTime::Private::GetFlattenedStruct().
String DateTime::GetDate | ( | ) | const |
References GetEpoch().
int DateTime::GetDay | ( | ) | const |
References os::DateTime::Private::m_nDay, and os::DateTime::Private::ToGregorian().
Referenced by os::CalendarView::Update().
double DateTime::GetDaycount | ( | ) | const |
References os::DateTime::Private::GetJulianDate().
int DateTime::GetDayOfWeek | ( | ) | const |
References os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, and os::DateTime::Private::ToGregorian().
Referenced by os::CalendarView::Update().
time_t DateTime::GetEpoch | ( | ) | const |
References os::DateTime::Private::GetJulianDate().
Referenced by GetDate().
|
virtual |
Implements os::Flattenable.
References os::DateTime::Private::GetFlattenedStruct().
Referenced by Unflatten().
int DateTime::GetHour | ( | ) | const |
References os::DateTime::Private::m_vSec, and os::DateTime::Private::ToGregorian().
double DateTime::GetJulianDate | ( | ) | const |
References os::DateTime::Private::GetJulianDate().
int DateTime::GetMin | ( | ) | const |
References os::DateTime::Private::m_vSec, and os::DateTime::Private::ToGregorian().
int DateTime::GetMonth | ( | ) | const |
References os::DateTime::Private::m_nMonth, and os::DateTime::Private::ToGregorian().
Referenced by os::CalendarView::HandleMessage(), and os::CalendarView::Update().
int DateTime::GetSec | ( | ) | const |
References os::DateTime::Private::m_vSec, and os::DateTime::Private::ToGregorian().
|
virtual |
Implements os::Flattenable.
References os::T_DATETIME.
int os::DateTime::GetUSec | ( | ) | const |
int DateTime::GetYear | ( | ) | const |
References os::DateTime::Private::m_nYear, and os::DateTime::Private::ToGregorian().
Referenced by os::CalendarView::HandleMessage(), and os::CalendarView::Update().
bool DateTime::IsValid | ( | ) | const |
References os::DateTime::Private::IsDateValid().
|
static |
References DateTime().
Referenced by os::DateView::Private::Private(), and os::CalendarView::Update().
|
inline |
|
inline |
|
inline |
int DateTime::operator!= | ( | const DateTime & | cTime | ) | const |
References os::DateTime::Private::GetJulianDate().
DateTime DateTime::operator+ | ( | double | vDays | ) | const |
References os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, os::DateTime::Private::ToGregorian(), and os::DateTime::Private::ToJulian().
DateTime & DateTime::operator+= | ( | double | vDays | ) |
References os::DateTime::Private::m_vTimeVal, and os::DateTime::Private::ToJulian().
DateTime DateTime::operator- | ( | double | vDays | ) | const |
References os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, os::DateTime::Private::ToGregorian(), and os::DateTime::Private::ToJulian().
DateTime & DateTime::operator-= | ( | double | vDays | ) |
References os::DateTime::Private::m_vTimeVal, and os::DateTime::Private::ToJulian().
int DateTime::operator< | ( | const DateTime & | cTime | ) | const |
References os::DateTime::Private::GetJulianDate().
References os::DateTime::Private::Copy().
int DateTime::operator== | ( | const DateTime & | cTime | ) | const |
References os::DateTime::Private::GetJulianDate().
int DateTime::operator> | ( | const DateTime & | cTime | ) | const |
References os::DateTime::Private::GetJulianDate().
void DateTime::SetDate | ( | int | nYear, |
int | nMonth, | ||
int | nDay | ||
) |
nYear | Year |
nMonth | Month |
nDay | Year |
References os::DateTime::Private::m_nDay, os::DateTime::Private::m_nMonth, os::DateTime::Private::m_nYear, and os::DateTime::Private::ToGregorian().
Referenced by DateTime(), and SetDate().
bool DateTime::SetDate | ( | const String & | cDate | ) |
References os::String::c_str(), SetDate(), and SetTime().
void DateTime::SetTime | ( | int | nHour, |
int | nMin, | ||
int | nSec, | ||
int | nUSec | ||
) |
nHour | Hours since midnight |
nMin | Minutes past the hour |
nSec | Seconds |
nUSec | Microseconds |
References os::DateTime::Private::m_vSec, and os::DateTime::Private::ToGregorian().
Referenced by SetDate().
|
virtual |
Implements os::Flattenable.
References GetFlattenedSize(), and os::DateTime::Private::SetFromFlattenStruct().