Nebula
Loading...
Searching...
No Matches
Base::CalendarTimeBase Class Reference

#include <calendartimebase.h>

Detailed Description

Allows to obtain the current point in time as year, month, day, etc... down to milliseconds, convert between filetime and CalendarTime, and format the time to a human readable string.

Inherited by Posix::PosixCalendarTime, and Win32::Win32CalendarTime.

Public Types

enum  Month {
  January = 1 , February , March , April ,
  May , June , July , August ,
  September , October , November , December
}
 months enum More...
 
enum  Weekday {
  Sunday = 0 , Monday , Tuesday , Wednesday ,
  Thursday , Friday , Saturday
}
 weekdays enum More...
 
typedef unsigned int Year
 typedefs
 
typedef unsigned int Day
 
typedef unsigned int Hour
 
typedef unsigned int Minute
 
typedef unsigned int Second
 
typedef unsigned int MilliSecond
 

Public Member Functions

 CalendarTimeBase ()
 constructor
 
void SetYear (Year y)
 set the year
 
Year GetYear () const
 get the year
 
void SetMonth (Month m)
 set the month
 
Month GetMonth () const
 get the month
 
void SetWeekday (Weekday wd)
 set the day-of-week
 
Weekday GetWeekday () const
 get the day-of-week
 
void SetDay (Day d)
 set the day (of month)
 
Day GetDay () const
 get the day (of month)
 
void SetHour (Hour h)
 set hour-of-day
 
Hour GetHour () const
 get hour-of-day
 
void SetMinute (Minute m)
 set minute-of-hour
 
Minute GetMinute () const
 get minute-of-hour
 
void SetSecond (Second s)
 set second-of-minute
 
Second GetSecond () const
 get second-of-minute
 
void SetMilliSecond (MilliSecond ms)
 set milliseconds
 
MilliSecond GetMilliSecond () const
 get milliseconds
 

Static Public Member Functions

static Timing::CalendarTime GetSystemTime ()
 get the current system time
 
static Timing::CalendarTime GetLocalTime ()
 get the current local time
 
static IO::FileTime SystemTimeToFileTime (const Timing::CalendarTime &systemTime)
 convert system time to file time
 
static Timing::CalendarTime FileTimeToSystemTime (const IO::FileTime &fileTime)
 convert file time to system time
 
static IO::FileTime LocalTimeToFileTime (const Timing::CalendarTime &localTime)
 convert local time to file time
 
static Timing::CalendarTime FileTimeToLocalTime (const IO::FileTime &fileTime)
 convert file time to local time
 
static Util::String Format (const Util::String &fmtString, const Timing::CalendarTime &calTime)
 format to string
 
static Util::String MonthToString (Month m)
 convert month to string
 
static Month StringToMonth (const Util::String &str)
 convert string to month
 
static Util::String WeekdayToString (Weekday d)
 convert weekday to string
 
static Weekday StringToWeekday (const Util::String &str)
 convert string to weekday
 

Protected Attributes

Year year
 
Month month
 
Weekday weekday
 
Day day
 
Hour hour
 
Minute minute
 
Second second
 
MilliSecond milliSecond
 

Member Typedef Documentation

◆ Day

typedef unsigned int Base::CalendarTimeBase::Day

◆ Hour

typedef unsigned int Base::CalendarTimeBase::Hour

◆ MilliSecond

◆ Minute

typedef unsigned int Base::CalendarTimeBase::Minute

◆ Second

typedef unsigned int Base::CalendarTimeBase::Second

◆ Year

typedef unsigned int Base::CalendarTimeBase::Year

typedefs

Member Enumeration Documentation

◆ Month

months enum

Enumerator
January 
February 
March 
April 
May 
June 
July 
August 
September 
October 
November 
December 

◆ Weekday

weekdays enum

Enumerator
Sunday 
Monday 
Tuesday 
Wednesday 
Thursday 
Friday 
Saturday 

Constructor & Destructor Documentation

◆ CalendarTimeBase()

Base::CalendarTimeBase::CalendarTimeBase ( )

constructor

Member Function Documentation

◆ FileTimeToLocalTime()

static Timing::CalendarTime Base::CalendarTimeBase::FileTimeToLocalTime ( const IO::FileTime & fileTime)
static

convert file time to local time

◆ FileTimeToSystemTime()

static Timing::CalendarTime Base::CalendarTimeBase::FileTimeToSystemTime ( const IO::FileTime & fileTime)
static

convert file time to system time

◆ Format()

String Base::CalendarTimeBase::Format ( const Util::String & fmtString,
const Timing::CalendarTime & calTime )
static

format to string

Formats a calendar time into a string using the following substitution string:

{YEAR} - the year member {MONTH} - the month member {WEEKDAY} - the weekday member {DAY} - the numerical day-in-month member {HOUR} - the hour member {MINUTE} - the minute member {SECOND} - the second member {MILLISECOND} - the millisecond member

◆ GetDay()

CalendarTime::Day Base::CalendarTimeBase::GetDay ( ) const

get the day (of month)

◆ GetHour()

CalendarTime::Hour Base::CalendarTimeBase::GetHour ( ) const

get hour-of-day

◆ GetLocalTime()

static Timing::CalendarTime Base::CalendarTimeBase::GetLocalTime ( )
static

get the current local time

◆ GetMilliSecond()

CalendarTime::MilliSecond Base::CalendarTimeBase::GetMilliSecond ( ) const

get milliseconds

◆ GetMinute()

CalendarTime::Minute Base::CalendarTimeBase::GetMinute ( ) const

get minute-of-hour

◆ GetMonth()

CalendarTime::Month Base::CalendarTimeBase::GetMonth ( ) const

get the month

◆ GetSecond()

CalendarTime::Second Base::CalendarTimeBase::GetSecond ( ) const

get second-of-minute

◆ GetSystemTime()

static Timing::CalendarTime Base::CalendarTimeBase::GetSystemTime ( )
static

get the current system time

◆ GetWeekday()

CalendarTime::Weekday Base::CalendarTimeBase::GetWeekday ( ) const

get the day-of-week

◆ GetYear()

CalendarTime::Year Base::CalendarTimeBase::GetYear ( ) const

get the year

◆ LocalTimeToFileTime()

static IO::FileTime Base::CalendarTimeBase::LocalTimeToFileTime ( const Timing::CalendarTime & localTime)
static

convert local time to file time

◆ MonthToString()

String Base::CalendarTimeBase::MonthToString ( Month m)
static

convert month to string

◆ SetDay()

void Base::CalendarTimeBase::SetDay ( Day d)

set the day (of month)

◆ SetHour()

void Base::CalendarTimeBase::SetHour ( Hour h)

set hour-of-day

◆ SetMilliSecond()

void Base::CalendarTimeBase::SetMilliSecond ( MilliSecond ms)

set milliseconds

◆ SetMinute()

void Base::CalendarTimeBase::SetMinute ( Minute m)

set minute-of-hour

◆ SetMonth()

void Base::CalendarTimeBase::SetMonth ( Month m)

set the month

◆ SetSecond()

void Base::CalendarTimeBase::SetSecond ( Second s)

set second-of-minute

◆ SetWeekday()

void Base::CalendarTimeBase::SetWeekday ( Weekday wd)

set the day-of-week

◆ SetYear()

void Base::CalendarTimeBase::SetYear ( Year y)

set the year

◆ StringToMonth()

CalendarTime::Month Base::CalendarTimeBase::StringToMonth ( const Util::String & str)
static

convert string to month

◆ StringToWeekday()

CalendarTime::Weekday Base::CalendarTimeBase::StringToWeekday ( const Util::String & str)
static

convert string to weekday

◆ SystemTimeToFileTime()

static IO::FileTime Base::CalendarTimeBase::SystemTimeToFileTime ( const Timing::CalendarTime & systemTime)
static

convert system time to file time

◆ WeekdayToString()

String Base::CalendarTimeBase::WeekdayToString ( Weekday d)
static

convert weekday to string

Member Data Documentation

◆ day

Day Base::CalendarTimeBase::day
protected

◆ hour

Hour Base::CalendarTimeBase::hour
protected

◆ milliSecond

MilliSecond Base::CalendarTimeBase::milliSecond
protected

◆ minute

Minute Base::CalendarTimeBase::minute
protected

◆ month

Month Base::CalendarTimeBase::month
protected

◆ second

Second Base::CalendarTimeBase::second
protected

◆ weekday

Weekday Base::CalendarTimeBase::weekday
protected

◆ year

Year Base::CalendarTimeBase::year
protected

The documentation for this class was generated from the following files: