Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cTimeFile Class Reference

#include <cTimeFile.h>

Inheritance diagram for Gray::cTimeFile:

Public Member Functions

 cTimeFile (FILETIME_t t=0) noexcept
 
 cTimeFile (const FILETIME &t) noexcept
 
 cTimeFile (const cTimeUnits &tu)
 
FILETIME_tref_Val () noexcept
 
FILETIME_t get_Val () const noexcept
 
FILETIME_t get_FAT32 () const noexcept
 
TIMESECD_t get_AgeSec () const
 
bool isValid () const noexcept
 
void InitTime (FILETIME_t t=0) noexcept
 
void InitTimeNow ()
 
void InitTimeUnits (const cTimeUnits &rTu)
 
bool GetTimeUnits (OUT cTimeUnits &rTu, TZ_TYPE nTimeZoneOffset) const
 
cString GetTimeFormStr (const GChar_t *pszFormat, TZ_TYPE nTimeZoneOffset=TZ_LOCAL) const
 

Static Public Member Functions

static cTimeFile __stdcall GetTimeNow ()
 
static cTimeFile __stdcall GetCurrentTime ()
 

Static Public Attributes

static const int k_nDaysDiffTimeInt = ((369 * 365) + 89)
 days difference from FILETIME (1601) to cTimeInt (1970) bases = 134774 More...
 
static const int k_nFreq = 10 * 1000000
 100-nanosecond intervals per second = 10th of a micro second. More...
 

Friends

class cTimeFileTests
 

Detailed Description

Universal time stamp for a file. 64-bit integer 100-nanosecond intervals since January 1, 1601 GMT. Overflows in ~58494 years.

Note
FAT32 has time stamps that are only good for ~2 second accuracy. Similar to ATL/MFC CFileTime

Constructor & Destructor Documentation

◆ cTimeFile() [1/3]

Gray::cTimeFile::cTimeFile ( FILETIME_t  t = 0)
inlinenoexcept

◆ cTimeFile() [2/3]

Gray::cTimeFile::cTimeFile ( const FILETIME &  t)
inlinenoexcept

◆ cTimeFile() [3/3]

Gray::cTimeFile::cTimeFile ( const cTimeUnits tu)
inline

Member Function Documentation

◆ get_AgeSec()

TIMESECD_t Gray::cTimeFile::get_AgeSec ( ) const
Returns
age in seconds.

◆ get_FAT32()

FILETIME_t Gray::cTimeFile::get_FAT32 ( ) const
inlinenoexcept

get the time truncated to 2 second intervals for FAT32. 2 second accurate for FAT32

Note
This is not really in proper FILETIME_t or FAT32/DosDate format. see cTimeUnits DosDate.

◆ get_Val()

FILETIME_t Gray::cTimeFile::get_Val ( ) const
inlinenoexcept
Returns
64-bit integer 100-nanosecond intervals since January 1, 1601 GMT Warning in GNUC reinterpret_ warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

◆ GetCurrentTime()

static cTimeFile __stdcall Gray::cTimeFile::GetCurrentTime ( )
inlinestatic

Alternate name for MFC.

Note
GetCurrentTime() is "#define" by _WIN32 to GetTickCount() so i cant use that name!

◆ GetTimeFormStr()

cString Gray::cTimeFile::GetTimeFormStr ( const GChar_t pszFormat,
TZ_TYPE  nTimeZoneOffset = TZ_LOCAL 
) const

Get the time as a string formatted using "C" strftime() MFC just calls this "Format"

◆ GetTimeNow()

cTimeFile GRAYCALL Gray::cTimeFile::GetTimeNow ( )
static

Get the current time with highest possible accuracy. FILETIME_t = 64-bit 100-nanosecond since January 1, 1601 GMT

◆ GetTimeUnits()

bool Gray::cTimeFile::GetTimeUnits ( OUT cTimeUnits rTu,
TZ_TYPE  nTimeZoneOffset 
) const

◆ InitTime()

void Gray::cTimeFile::InitTime ( FILETIME_t  t = 0)
inlinenoexcept

◆ InitTimeNow()

void Gray::cTimeFile::InitTimeNow ( )

Get current UTC time

◆ InitTimeUnits()

void Gray::cTimeFile::InitTimeUnits ( const cTimeUnits rTu)

◆ isValid()

bool Gray::cTimeFile::isValid ( ) const
inlinenoexcept

◆ ref_Val()

FILETIME_t& Gray::cTimeFile::ref_Val ( )
inlinenoexcept
Returns
64-bit integer 100-nanosecond intervals since January 1, 1601 GMT Warning in GNUC reinterpret_ warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Friends And Related Function Documentation

◆ cTimeFileTests

friend class cTimeFileTests
friend

Member Data Documentation

◆ k_nDaysDiffTimeInt

const int Gray::cTimeFile::k_nDaysDiffTimeInt = ((369 * 365) + 89)
static

days difference from FILETIME (1601) to cTimeInt (1970) bases = 134774

◆ k_nFreq

const int Gray::cTimeFile::k_nFreq = 10 * 1000000
static

100-nanosecond intervals per second = 10th of a micro second.


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