title | description | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CFileTimeSpan class |
The Active Template Library (ATL) and Microsoft Foundation Classes (MFC) CFileTimeSpan class manages time intervals in FILETIME units. |
01/10/2020 |
|
|
5856fb39-9c82-4027-8ccf-8760890491ec |
This class provides methods for managing relative date and time values associated with a file.
class CFileTimeSpan
Name | Description |
---|---|
CFileTimeSpan::CFileTimeSpan |
The constructor. |
Name | Description |
---|---|
CFileTimeSpan::GetTimeSpan |
Call this method to retrieve the time span from the CFileTimeSpan object. |
CFileTimeSpan::SetTimeSpan |
Call this method to set the time span of the CFileTimeSpan object. |
Name | Description |
---|---|
CFileTimeSpan::operator - |
Performs subtraction on a CFileTimeSpan object. |
CFileTimeSpan::operator != |
Compares two CFileTimeSpan objects for inequality. |
CFileTimeSpan::operator + |
Performs addition on a CFileTimeSpan object. |
CFileTimeSpan::operator += |
Performs addition on a CFileTimeSpan object and assign the result to the current object. |
CFileTimeSpan::operator < |
Compares two CFileTimeSpan objects to determine the lesser. |
CFileTimeSpan::operator <= |
Compares two CFileTimeSpan objects to determine equality or the lesser. |
CFileTimeSpan::operator = |
The assignment operator. |
CFileTimeSpan::operator -= |
Performs subtraction on a CFileTimeSpan object and assign the result to the current object. |
CFileTimeSpan::operator == |
Compares two CFileTimeSpan objects for equality. |
CFileTimeSpan::operator > |
Compares two CFileTimeSpan objects to determine the larger. |
CFileTimeSpan::operator >= |
Compares two CFileTimeSpan objects to determine equality or the larger. |
The CFileTimeSpan
class provides methods to handle relative periods of time in the units the file system uses. These units are often used in file operations, such as when a file was created, last accessed, or last modified. The methods of this class are frequently used together with CFileTime
class objects.
See the example for CFileTime::Millisecond
.
Header: atltime.h
The constructor.
CFileTimeSpan() throw();
CFileTimeSpan(const CFileTimeSpan& span) throw();
CFileTimeSpan(LONGLONG nSpan) throw();
span
An existing CFileTimeSpan
object.
nSpan
A period of time in FILETIME
units.
The CFileTimeSpan
object can be created using an existing CFileTimeSpan
object, or expressed as a 64-bit value in 100-nanosecond FILETIME
units. For more information, see CFileTime
. The default constructor sets the time span to 0.
Call this method to retrieve the time span from the CFileTimeSpan
object.
LONGLONG GetTimeSpan() const throw();
Returns the time span in 100-nanosecond FILETIME
units. For more information, see CFileTime
.
Performs subtraction on a CFileTimeSpan
object.
CFileTimeSpan operator-(CFileTimeSpan span) const throw();
span
A CFileTimeSpan
object.
Returns a CFileTimeSpan
object representing the result of the difference between two time spans.
Compares two CFileTimeSpan
objects for inequality.
bool operator!=(CFileTimeSpan span) const throw();
span
The CFileTimeSpan
object to be compared.
Returns TRUE
if the item being compared isn't equal to the CFileTimeSpan
object; otherwise FALSE
.
Performs addition on a CFileTimeSpan
object.
CFileTimeSpan operator+(CFileTimeSpan span) const throw();
span
A CFileTimeSpan
object.
Returns a CFileTimeSpan
object containing the sum of the two time spans.
Performs addition on a CFileTimeSpan
object and assigns the result to the current object.
CFileTimeSpan& operator+=(CFileTimeSpan span) throw();
span
A CFileTimeSpan
object.
Returns the updated CFileTimeSpan
object containing the sum of the two time spans.
Compares two CFileTimeSpan
objects to determine the lesser.
bool operator<(CFileTimeSpan span) const throw();
span
The CFileTimeSpan
object to be compared.
Returns TRUE
if the first object is less (that is, represents a shorter time period) than the second, otherwise FALSE
.
Compares two CFileTimeSpan
objects to determine equality or the lesser.
bool operator<=(CFileTimeSpan span) const throw();
span
The CFileTimeSpan
object to be compared.
Returns TRUE
if the first object is less than (that is, represents a shorter time period) or equal to the second, otherwise FALSE
.
The assignment operator.
CFileTimeSpan& operator=(const CFileTimeSpan& span) throw();
span
A CFileTimeSpan
object.
Returns the updated CFileTimeSpan
object.
Performs subtraction on a CFileTimeSpan
object and assigns the result to the current object.
CFileTimeSpan& operator-=(CFileTimeSpan span) throw();
span
A CFileTimeSpan
object.
Returns the updated CFileTimeSpan
object.
Compares two CFileTimeSpan
objects for equality.
bool operator==(CFileTimeSpan span) const throw();
span
The CFileTimeSpan
object to be compared.
Returns TRUE
if the objects are equal, otherwise FALSE
.
Compares two CFileTimeSpan
objects to determine the larger.
bool operator>(CFileTimeSpan span) const throw();
span
The CFileTimeSpan
object to be compared.
Returns TRUE
if the first object is greater than (that is, represents a longer time period) than the second, otherwise FALSE
.
Compares two CFileTimeSpan
objects to determine equality or the larger.
bool operator>=(CFileTimeSpan span) const throw();
span
The CFileTimeSpan
object to be compared.
Returns TRUE
if the first object is greater than (that is, represents a longer time period) or equal to the second, otherwise FALSE
.
Call this method to set the time span of the CFileTimeSpan
object.
void SetTimeSpan(LONGLONG nSpan) throw();
nSpan
The new value for the time span in 100-nanosecond FILETIME
units. For more information, see CFileTime
.
FILETIME
CFileTime
class
Hierarchy chart
ATL/MFC shared classes