InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDTime Class Reference

#include <IDTime.h>

Public Types

typedef object_type data_type
 

Public Member Functions

 IDTime ()
 
 IDTime (ATime time)
 
 IDTime (const IDTime &time)
 
virtual ~IDTime ()
 
IDTimeoperator= (const IDTime &rhs)
 
void Swap (IDTime &rhs)
 
bool operator== (const IDTime &rhs) const
 
bool operator!= (const IDTime &rhs) const
 
bool operator< (const IDTime &rhs) const
 
bool operator> (const IDTime &rhs) const
 
void CurrentTime ()
 
void SetTime (ATime time)
 
ATime GetTime () const
 
bool SetTime (int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second)
 
bool GetTime (int32 *year, int32 *month, int32 *day, int32 *hour, int32 *minute, int32 *second, int32 *dayOfWeek=nil) const
 
bool DateToString (WideString &str, bool bShortform) const
 
bool TimeToString (WideString &str) const
 
bool IsValid () const
 
void ReadWrite (IPMStream *s)
 

Detailed Description

IDTime is based on an ATime, which is the time measured in 100-nanosecond intervals since January 1, 1601 (UTC). An IDTime that is exactly equal to an ATime of 0 (January 1, 1601 (UTC)) is considered to be invalid.

Constructor & Destructor Documentation

IDTime::IDTime ()

Default constructor. Constructs an IDTime object with no valid time set.

IDTime::IDTime (ATime time)

Constructor.

Parameters
time[IN] Time to set the stored time to.
IDTime::IDTime (const IDTimetime)

Copy constructor. Constructs an IDTime object that is a copy of the given object.

Parameters
time[IN] IDTime object to copy.
virtual IDTime::~IDTime ()
virtual

Destructor. Destroys the IDTime object.

Member Function Documentation

void IDTime::CurrentTime ()

Sets the stored time to the current UTC time.

bool IDTime::DateToString (WideStringstr,
bool bShortform 
) const

Returns a local date string that represents the stored date. \ The format of the returned string is dependent on your system and system's settings.

Parameters
str[OUT] String to fill in.
bShortform[IN] If true, a short date string return. Otherwise, a long date string is returned.
Returns
True if the method succedes, else false.
ATime IDTime::GetTime () const

Returns the stored time as an ATime.

Returns
Stored time as an ATime.
bool IDTime::GetTime (int32 * year,
int32 * month,
int32 * day,
int32 * hour,
int32 * minute,
int32 * second,
int32 * dayOfWeek = nil 
) const

Gets the local time components that the IDTime represents. \ All the parameters are optional; pass nil when you do not want a value.

Parameters
year[OUT] Year; for example 2005 (> 1601).
month[OUT] Month (1 - 12), where January = 1, ..., December = 12.
day[OUT] Day of the month (1 - 31).
hour[OUT] Hour (0 - 23).
minute[OUT] Minute (0 - 59).
second[OUT] Second (0 - 59).
dayOfWeek[OUT] Day of the week (1 to 7), where Sunday = 1, ..., Saturday = 7.
Returns
True if the local time components were successfully retrieved, else false.
bool IDTime::IsValid () const

Test whether this time is valid. \ An IDTime that is exactly equal to an ATime of 0 (January 1, 1601 (UTC)) is considered to be invalid.

Returns
True if the time is valid, else false.
bool IDTime::operator!= (const IDTimerhs) const

Non-equality operator. Test whether this time is not equal to the given time.

Parameters
rhs[IN] Time to compare to this time.
Returns
True if this time is not equal to the given time, else false.
bool IDTime::operator< (const IDTimerhs) const

Less than operator. Tests whether this time is less than the given time.

Parameters
rhs[IN] Time to compare to this time.
Returns
True if this time is less than the given time, else false.
IDTime& IDTime::operator= (const IDTimerhs)

Assignment operator. Assigns the given time to this time.

Parameters
rhs[IN] Time to assign to this time.
Returns
Reference to this object.
bool IDTime::operator== (const IDTimerhs) const

Equality operator. Test whether this time is identical to the given time.

Parameters
rhs[IN] Time to compare to this time.
Returns
True if this time is equal to the given time, else false.
bool IDTime::operator> (const IDTimerhs) const

Greater than operator. Tests whether this time is greater than the given time.

Parameters
rhs[IN] Time to compare to this time.
Returns
True if this time is greater than the given time, else false.
void IDTime::ReadWrite (IPMStreams)

Persistence-related method for saving or restoring the state of an IDTime object instance.

Parameters
iPMStream[IN] Stream to read the instance data from or write the instance data to.
void IDTime::SetTime (ATime time)

Sets the stored time to the given time value.

Parameters
time[IN] Time to set the stored time to.
bool IDTime::SetTime (int32 year,
int32 month,
int32 day,
int32 hour,
int32 minute,
int32 second 
)

Sets the stored time using the the given local time values.

Parameters
year[IN] Year; for example 2005 (> 1601).
month[IN] Month (1 - 12), where January = 1, ..., December = 12.
day[IN] Day of the month (1 - 31).
hour[IN] Hour (0 - 23).
minute[IN] Minute (0 - 59).
second[IN] Second (0 - 59).
Returns
True if the time was successfully set, else false.
void IDTime::Swap (IDTimerhs)

Swaps the given time with this time.

Parameters
rhs[IN] Time to swap with this time.
bool IDTime::TimeToString (WideStringstr) const

Returns a local time string that represents the stored time. \ The format of the returned string is dependent on your system and system's settings.

Parameters
str[OUT] String to fill in.
Returns
True if the method succedes, else false.