class CTzRules : public CBase |
Encapsulates a collection of time zone rules, and includes the period covered by the rules and the standard time offset at the start of that period.
Public Member Functions | |
---|---|
~CTzRules() | |
IMPORT_C void | AddRuleL(TTzRule) |
IMPORT_C CTzRules * | CloneL() |
IMPORT_C TInt | ConvertTime(CVTzActualisedRules &, TTime &, TTzTimeReference) |
IMPORT_C void | ConvertToLocalL(TTime &) |
IMPORT_C void | ConvertToUtcL(TTime &) |
IMPORT_C void | CopyL(const CTzRules &) |
IMPORT_C TInt | Count() |
IMPORT_C TInt | EndYear() |
IMPORT_C void | ExternalizeL(RWriteStream &) |
IMPORT_C void | GetActualisedRulesL(CVTzActualisedRules &) |
IMPORT_C TInt | GetOffsetL(const TTime &, TTzTimeReference) |
IMPORT_C TInt | InitialStdTimeOffset() |
IMPORT_C void | InternalizeL(RReadStream &) |
IMPORT_C TBool | IsEqualTo(const CTzRules &) |
IMPORT_C CTzRules * | NewL() |
IMPORT_C CTzRules * | NewL(TInt, TInt) |
IMPORT_C CTzRules * | NewL(RReadStream &) |
IMPORT_C void | RemoveRule(TInt) |
IMPORT_C TBool | RulesApply(const TTime &) |
IMPORT_C void | SetEndYear(TInt) |
IMPORT_C void | SetInitialStdTimeOffset(TInt) |
IMPORT_C void | SetStartYear(TInt) |
IMPORT_C TInt | SizeOfObject() |
IMPORT_C TInt | StartYear() |
IMPORT_C TTzRule & | operator[](TInt) |
Private Member Functions | |
---|---|
CTzRules() | |
CTzRules(TInt, TInt) | |
void | AddActualisedRulesL(CVTzActualisedRules &, TInt) |
TInt | CompareTimesWithRef(TTime, TTzTimeReference, TTime, TTzTimeReference, TInt, TInt, TTimeIntervalMinutes *) |
Private Attributes | |
---|---|
CVTzActualisedRules * | iActualisedRulesCache |
TInt16 | iEndYear |
TInt | iInitialStdTimeOffset |
RArray< TTzRule > | iRules |
TInt16 | iStartYear |
void | AddActualisedRulesL | ( | CVTzActualisedRules & | aActRules, |
TInt | aYear | |||
) | const [private] |
Based on the rules in the object calculates actualised rules for particular year and adds them to the specified array of actualised rules (CVTzActualisedRules).
CVTzActualisedRules & aActRules | - an array of actualised rules where new actualised rules are added; |
TInt aYear | - a year for which actualised rules are added. |
IMPORT_C void | AddRuleL | ( | TTzRule | aRule | ) |
Adds a time zone rule to this set.
TTzRule aRule | The rule to be added. |
TInt | CompareTimesWithRef | ( | TTime | aTimeA, |
TTzTimeReference | aTimeARef, | |||
TTime | aTimeB, | |||
TTzTimeReference | aTimeBRef, | |||
TInt | aStdOffset, | |||
TInt | aWallOffset, | |||
TTimeIntervalMinutes * | aMinutesDifference | |||
) | const [private] |
Compares two times with time references (TTzTimeReference). TTzTimeReference is either UTC, or STD, or ETzWallTimeReference.
Comparison is done at some point in time when aStdOffset applies to item(s) with ETzStdTimeReference, and aWallOffset applies to item(s) with ETzWallTimeReference.
If time references for both aTimeA and aTimeB are the same, then straight comparison is done to aTimeA and aTimeB. Otherwise, STD or wall-clock time is converted to UTC using either aStdOffset, or aWallOffset correspondingly.
Thus, aStdOffset parameter is never used if none of aTimeA and aTimeB is ETzStdTimeReference; and, similarly, aWallOffset is never used if none of aTimeA and aTimeB is ETzWallTimeReference.
TTime aTimeA | - first time with reference; |
TTzTimeReference aTimeARef | |
TTime aTimeB | - second time with reference, to compare to aTimeA; |
TTzTimeReference aTimeBRef | |
TInt aStdOffset | - an offset (in minutes) to be used for a time with ETzStdTimeReference; |
TInt aWallOffset | - an offset (in minutes) to be used for a time with ETzWallTimeReference; |
TTimeIntervalMinutes * aMinutesDifference | -on return, the time difference between aTimeA and aTimeB in minutes; |
IMPORT_C TInt | ConvertTime | ( | CVTzActualisedRules & | aRules, |
TTime & | aTime, | |||
TTzTimeReference | aTimerRef | |||
) | const |
Converts between local (wall-clock) and UTC times.
CVTzActualisedRules & aRules | The actualised rules to use. |
TTime & aTime | The time to convert, specified by aTimerRef if the time is in UTC or local time. On return, it will contain the converted time from UTC to local time or vice versa, depending on aTimerRef's value. |
TTzTimeReference aTimerRef | What aTime is expressed in. |
IMPORT_C void | ConvertToLocalL | ( | TTime & | aUtcTime | ) | const |
Converts the received UTC time to local time.
TTime & aUtcTime | The time to convert. On return, this contains the converted time. |
IMPORT_C void | ConvertToUtcL | ( | TTime & | aLocalTime | ) | const |
Converts the received local time to UTC time.
TTime & aLocalTime | The time to convert. On return, this contains the converted time. |
IMPORT_C void | CopyL | ( | const CTzRules & | aTzRule | ) |
Copy a time zone rule to this time zone rule.
const CTzRules & aTzRule | A rule to copy from. |
IMPORT_C void | ExternalizeL | ( | RWriteStream & | aStream | ) | const |
Externalises time zone rules to a write stream.
RWriteStream & aStream | Stream to which the object should be externalised. |
IMPORT_C void | GetActualisedRulesL | ( | CVTzActualisedRules & | aActRules | ) | const |
Get actualised rules for time zone rules.
CVTzActualisedRules & aActRules | Actualised rules for time zone rules. |
IMPORT_C TInt | GetOffsetL | ( | const TTime & | aTime, |
TTzTimeReference | aTimeRef | |||
) | const |
Calculate the local time offset at the supplied time.
const TTime & aTime | |
TTzTimeReference aTimeRef |
IMPORT_C TInt | InitialStdTimeOffset | ( | ) | const |
Gets the initial UTC offset for this set of time zone rules.
IMPORT_C void | InternalizeL | ( | RReadStream & | aStream | ) |
Internalizes time zone rules from a read stream.
RReadStream & aStream | Stream from which the object should be internalised. |
IMPORT_C TBool | IsEqualTo | ( | const CTzRules & | aRules | ) | const |
Compares two sets of timezone rules.
const CTzRules & aRules | The timezone rules to compare with. |
IMPORT_C CTzRules * | NewL | ( | TInt | aStartYear, |
TInt | aEndYear | |||
) | [static] |
Creates a new time zone rules object.
IMPORT_C CTzRules * | NewL | ( | RReadStream & | aStream | ) | [static] |
Creates a new time zone rules object from a stream.
RReadStream & aStream | Stream with the time zone rules to be used to create a CTzRules object. |
IMPORT_C void | RemoveRule | ( | TInt | aIndex | ) |
Removes a time zone rule from this set.
TInt aIndex | The index of the rule to be removed. |
IMPORT_C TBool | RulesApply | ( | const TTime & | aTime | ) | const |
Queries the time zone rule set to see if they apply to a specified time.
const TTime & aTime | The time to be checked, using the same time reference used when constructing CTzRules. |
IMPORT_C void | SetEndYear | ( | TInt | aYear | ) |
Sets the last year in which the time zone rules apply.
TInt aYear | The year. |
IMPORT_C void | SetInitialStdTimeOffset | ( | TInt | aOffset | ) |
Sets the initial UTC offset for this set of time zone rules.
TInt aOffset | The offset in minutes. |
IMPORT_C void | SetStartYear | ( | TInt | aYear | ) |
Sets the first year in which the time zone rules apply.
TInt aYear | The year. |
IMPORT_C TInt | SizeOfObject | ( | ) | const |
Get the object size when it is internalize and externalised.
IMPORT_C TTzRule & | operator[] | ( | TInt | aIndex | ) |
Gets a time zone rule from this set.
TInt aIndex | The index of the rule to be fetched. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.