ReactOS 0.4.15-dev-7659-ga55345b
ATL::CFileTime Class Reference

#include <atltime.h>

Inheritance diagram for ATL::CFileTime:
Collaboration diagram for ATL::CFileTime:

Public Member Functions

 CFileTime () noexcept
 
 CFileTime (const FILETIME &ft) noexcept
 
 CFileTime (ULONGLONG nTime) noexcept
 
ULONGLONG GetTime () const noexcept
 
CFileTime LocalToUTC () const noexcept
 
void SetTime (ULONGLONG nTime) noexcept
 
CFileTime UTCToLocal () const noexcept
 
CFileTime operator- (CFileTimeSpan span) const noexcept
 
CFileTimeSpan operator- (CFileTime ft) const noexcept
 
bool operator!= (CFileTime ft) const noexcept
 
CFileTime operator+ (CFileTimeSpan span) const noexcept
 
CFileTimeoperator+= (CFileTimeSpan span) noexcept
 
bool operator< (CFileTime ft) const noexcept
 
bool operator<= (CFileTime ft) const noexcept
 
CFileTimeoperator= (const FILETIME &ft) noexcept
 
CFileTimeoperator-= (CFileTimeSpan span) noexcept
 
bool operator== (CFileTime ft) const noexcept
 
bool operator> (CFileTime ft) const noexcept
 
bool operator>= (CFileTime ft) const noexcept
 

Static Public Member Functions

static CFileTime GetCurrentTime () noexcept
 

Static Public Attributes

static const ULONGLONG Millisecond = 10000
 
static const ULONGLONG Second = Millisecond * 1000
 
static const ULONGLONG Minute = Second * 60
 
static const ULONGLONG Hour = Minute * 60
 
static const ULONGLONG Day = Hour * 24
 
static const ULONGLONG Week = Day * 7
 

Additional Inherited Members

- Public Attributes inherited from _FILETIME
DWORD dwLowDateTime
 
DWORD dwHighDateTime
 
uint32_t dwLowDateTime
 
uint32_t dwHighDateTime
 

Detailed Description

Definition at line 534 of file atltime.h.

Constructor & Destructor Documentation

◆ CFileTime() [1/3]

ATL::CFileTime::CFileTime ( )
inlinenoexcept

Definition at line 544 of file atltime.h.

545 {
546 this->dwLowDateTime = 0;
547 this->dwHighDateTime = 0;
548 }
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65

Referenced by GetCurrentTime(), LocalToUTC(), operator+(), operator-(), and UTCToLocal().

◆ CFileTime() [2/3]

ATL::CFileTime::CFileTime ( const FILETIME ft)
inlinenoexcept

Definition at line 550 of file atltime.h.

551 {
552 this->dwLowDateTime = ft.dwLowDateTime;
554 }

◆ CFileTime() [3/3]

ATL::CFileTime::CFileTime ( ULONGLONG  nTime)
inlinenoexcept

Definition at line 556 of file atltime.h.

557 {
558 this->dwLowDateTime = (DWORD) nTime;
559 this->dwHighDateTime = nTime >> 32;
560 }
#define DWORD
Definition: nt_native.h:44

Member Function Documentation

◆ GetCurrentTime()

static CFileTime ATL::CFileTime::GetCurrentTime ( )
inlinestaticnoexcept

Definition at line 562 of file atltime.h.

563 {
564 FILETIME ft;
566 return CFileTime(ft);
567 }
CFileTime() noexcept
Definition: atltime.h:544
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128

◆ GetTime()

ULONGLONG ATL::CFileTime::GetTime ( ) const
inlinenoexcept

Definition at line 569 of file atltime.h.

570 {
571 return ((ULONGLONG)this->dwLowDateTime) | (((ULONGLONG)this->dwHighDateTime) << 32);
572 }
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

◆ LocalToUTC()

CFileTime ATL::CFileTime::LocalToUTC ( ) const
inlinenoexcept

Definition at line 574 of file atltime.h.

575 {
576 FILETIME ft;
577 LocalFileTimeToFileTime(this, &ft);
578 return CFileTime(ft);
579 }
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:253

◆ operator!=()

bool ATL::CFileTime::operator!= ( CFileTime  ft) const
inlinenoexcept

Definition at line 604 of file atltime.h.

605 {
606 return this->GetTime() != ft.GetTime();
607 }
ULONGLONG GetTime() const noexcept
Definition: atltime.h:569

◆ operator+()

CFileTime ATL::CFileTime::operator+ ( CFileTimeSpan  span) const
inlinenoexcept

Definition at line 609 of file atltime.h.

610 {
611 return CFileTime(this->GetTime() + span.GetTimeSpan());
612 }
LONGLONG GetTimeSpan() const noexcept
Definition: atltime.h:464

◆ operator+=()

CFileTime & ATL::CFileTime::operator+= ( CFileTimeSpan  span)
inlinenoexcept

Definition at line 614 of file atltime.h.

615 {
616 this->SetTime(this->GetTime() + span.GetTimeSpan());
617 return *this;
618 }
void SetTime(ULONGLONG nTime) noexcept
Definition: atltime.h:581

◆ operator-() [1/2]

CFileTimeSpan ATL::CFileTime::operator- ( CFileTime  ft) const
inlinenoexcept

Definition at line 599 of file atltime.h.

600 {
601 return CFileTimeSpan(this->GetTime() - ft.GetTime());
602 }

◆ operator-() [2/2]

CFileTime ATL::CFileTime::operator- ( CFileTimeSpan  span) const
inlinenoexcept

Definition at line 594 of file atltime.h.

595 {
596 return CFileTime(this->GetTime() - span.GetTimeSpan());
597 }

◆ operator-=()

CFileTime & ATL::CFileTime::operator-= ( CFileTimeSpan  span)
inlinenoexcept

Definition at line 637 of file atltime.h.

638 {
639 this->SetTime(this->GetTime() - span.GetTimeSpan());
640 return *this;
641 }

◆ operator<()

bool ATL::CFileTime::operator< ( CFileTime  ft) const
inlinenoexcept

Definition at line 620 of file atltime.h.

621 {
622 return this->GetTime() < ft.GetTime();
623 }

◆ operator<=()

bool ATL::CFileTime::operator<= ( CFileTime  ft) const
inlinenoexcept

Definition at line 625 of file atltime.h.

626 {
627 return this->GetTime() <= ft.GetTime();
628 }

◆ operator=()

CFileTime & ATL::CFileTime::operator= ( const FILETIME ft)
inlinenoexcept

Definition at line 630 of file atltime.h.

631 {
632 this->dwLowDateTime = ft.dwLowDateTime;
634 return *this;
635 }

◆ operator==()

bool ATL::CFileTime::operator== ( CFileTime  ft) const
inlinenoexcept

Definition at line 643 of file atltime.h.

644 {
645 return this->GetTime() == ft.GetTime();
646 }

◆ operator>()

bool ATL::CFileTime::operator> ( CFileTime  ft) const
inlinenoexcept

Definition at line 648 of file atltime.h.

649 {
650 return this->GetTime() > ft.GetTime();
651 }

◆ operator>=()

bool ATL::CFileTime::operator>= ( CFileTime  ft) const
inlinenoexcept

Definition at line 653 of file atltime.h.

654 {
655 return this->GetTime() >= ft.GetTime();
656 }

◆ SetTime()

void ATL::CFileTime::SetTime ( ULONGLONG  nTime)
inlinenoexcept

Definition at line 581 of file atltime.h.

582 {
583 this->dwLowDateTime = (DWORD) nTime;
584 this->dwHighDateTime = nTime >> 32;
585 }

Referenced by operator+=(), and operator-=().

◆ UTCToLocal()

CFileTime ATL::CFileTime::UTCToLocal ( ) const
inlinenoexcept

Definition at line 587 of file atltime.h.

588 {
589 FILETIME ft;
590 FileTimeToLocalFileTime(this, &ft);
591 return CFileTime(ft);
592 }
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221

Member Data Documentation

◆ Day

const ULONGLONG ATL::CFileTime::Day = Hour * 24
static

Definition at line 541 of file atltime.h.

◆ Hour

const ULONGLONG ATL::CFileTime::Hour = Minute * 60
static

Definition at line 540 of file atltime.h.

◆ Millisecond

const ULONGLONG ATL::CFileTime::Millisecond = 10000
static

Definition at line 537 of file atltime.h.

◆ Minute

const ULONGLONG ATL::CFileTime::Minute = Second * 60
static

Definition at line 539 of file atltime.h.

◆ Second

const ULONGLONG ATL::CFileTime::Second = Millisecond * 1000
static

Definition at line 538 of file atltime.h.

◆ Week

const ULONGLONG ATL::CFileTime::Week = Day * 7
static

Definition at line 542 of file atltime.h.


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