![]() | InDesign SDK 20.5 |
#include <IDTime.h>
Public Types | |
| typedef object_type | data_type |
Public Member Functions | |
| IDTime () | |
| IDTime (ATime time) | |
| IDTime (const IDTime &time) | |
| virtual | ~IDTime () |
| IDTime & | operator= (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) |
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.
| IDTime::IDTime | ( | ) |
Default constructor. Constructs an IDTime object with no valid time set.
| IDTime::IDTime | ( | ATime | time | ) |
Constructor.
| time | [IN] Time to set the stored time to. |
| IDTime::IDTime | ( | const IDTime & | time | ) |
| virtual |
Destructor. Destroys the IDTime object.
| void IDTime::CurrentTime | ( | ) |
Sets the stored time to the current UTC time.
| bool IDTime::DateToString | ( | WideString & | str, |
| 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.
| str | [OUT] String to fill in. |
| bShortform | [IN] If true, a short date string return. Otherwise, a long date string is returned. |
| ATime IDTime::GetTime | ( | ) | const |
Returns the 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.
| 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. |
| 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.
| bool IDTime::operator!= | ( | const IDTime & | rhs | ) | const |
Non-equality operator. Test whether this time is not equal to the given time.
| rhs | [IN] Time to compare to this time. |
| bool IDTime::operator< | ( | const IDTime & | rhs | ) | const |
Less than operator. Tests whether this time is less than the given time.
| rhs | [IN] Time to compare to this time. |
Assignment operator. Assigns the given time to this time.
| rhs | [IN] Time to assign to this time. |
| bool IDTime::operator== | ( | const IDTime & | rhs | ) | const |
Equality operator. Test whether this time is identical to the given time.
| rhs | [IN] Time to compare to this time. |
| bool IDTime::operator> | ( | const IDTime & | rhs | ) | const |
Greater than operator. Tests whether this time is greater than the given time.
| rhs | [IN] Time to compare to this time. |
| void IDTime::ReadWrite | ( | IPMStream * | s | ) |
Persistence-related method for saving or restoring the state of an IDTime object instance.
| 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.
| 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.
| 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). |
| void IDTime::Swap | ( | IDTime & | rhs | ) |
Swaps the given time with this time.
| rhs | [IN] Time to swap with this time. |
| bool IDTime::TimeToString | ( | WideString & | str | ) | 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.
| str | [OUT] String to fill in. |