author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:27:01 +0100 | |
branch | Symbian2 |
changeset 3 | e1b950c65cb4 |
parent 2 | epoc32/include/tzlocalizationdatatypes.inl@2fe1408b6811 |
child 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@2 | 4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@2 | 6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
#ifndef __TZLOCAL_DATATYPES_INL__ |
williamr@2 | 17 |
#define __TZLOCAL_DATATYPES_INL__ |
williamr@2 | 18 |
|
williamr@2 | 19 |
//================================================================== |
williamr@2 | 20 |
// TTzLocalizedId inline Functions |
williamr@2 | 21 |
//================================================================== |
williamr@2 | 22 |
/** |
williamr@2 | 23 |
Returns the time zone ID. |
williamr@2 | 24 |
@return The time zone ID. |
williamr@2 | 25 |
*/ |
williamr@2 | 26 |
inline TUint16 TTzLocalizedId::TimeZoneId() const |
williamr@2 | 27 |
{ |
williamr@2 | 28 |
return iTzId; |
williamr@2 | 29 |
} |
williamr@2 | 30 |
|
williamr@2 | 31 |
/** |
williamr@2 | 32 |
Returns the resource ID. |
williamr@2 | 33 |
@return The resource ID. |
williamr@2 | 34 |
*/ |
williamr@2 | 35 |
inline TUint TTzLocalizedId::ResourceId() const |
williamr@2 | 36 |
{ |
williamr@2 | 37 |
return iResourceId; |
williamr@2 | 38 |
} |
williamr@2 | 39 |
|
williamr@2 | 40 |
/** |
williamr@2 | 41 |
Returns the UTC offset in minutes. |
williamr@2 | 42 |
This value should only be used for array sorting. |
williamr@2 | 43 |
@return The UTC offset in minutes. |
williamr@2 | 44 |
*/ |
williamr@2 | 45 |
inline TInt TTzLocalizedId::UTCOffset() const |
williamr@2 | 46 |
{ |
williamr@2 | 47 |
return iUTCOffset; |
williamr@2 | 48 |
} |
williamr@2 | 49 |
|
williamr@2 | 50 |
/** |
williamr@2 | 51 |
Sets the UTC offset in minutes. |
williamr@2 | 52 |
This value should only be used for internal array sorting. |
williamr@2 | 53 |
@param aOffsetInMinutes The new UTC offset in minutes. |
williamr@2 | 54 |
*/ |
williamr@2 | 55 |
inline void TTzLocalizedId::SetUTCOffset(TInt aOffsetInMinutes) |
williamr@2 | 56 |
{ |
williamr@2 | 57 |
iUTCOffset = aOffsetInMinutes; |
williamr@2 | 58 |
} |
williamr@2 | 59 |
|
williamr@2 | 60 |
//================================================================== |
williamr@2 | 61 |
// CTzLocalizedArray's inline functions |
williamr@2 | 62 |
//================================================================== |
williamr@2 | 63 |
/** |
williamr@2 | 64 |
Destructor |
williamr@2 | 65 |
@internalTechnology |
williamr@2 | 66 |
*/ |
williamr@2 | 67 |
template <class T> |
williamr@2 | 68 |
inline CTzLocalizedArray<T>::~CTzLocalizedArray() |
williamr@2 | 69 |
{ |
williamr@2 | 70 |
iArray.ResetAndDestroy(); |
williamr@2 | 71 |
} |
williamr@2 | 72 |
|
williamr@2 | 73 |
/** |
williamr@2 | 74 |
Default constructor |
williamr@2 | 75 |
@internalTechnology |
williamr@2 | 76 |
*/ |
williamr@2 | 77 |
template <class T> |
williamr@2 | 78 |
inline CTzLocalizedArray<T>::CTzLocalizedArray() |
williamr@2 | 79 |
{ |
williamr@2 | 80 |
} |
williamr@2 | 81 |
/** |
williamr@2 | 82 |
Returns the element at the specified index. |
williamr@2 | 83 |
@param aIndex Index of the element to get. |
williamr@2 | 84 |
@return The element at aIndex. |
williamr@2 | 85 |
@internalTechnology |
williamr@2 | 86 |
*/ |
williamr@2 | 87 |
template <class T> |
williamr@2 | 88 |
inline T& CTzLocalizedArray<T>::At(TInt aIndex) const |
williamr@2 | 89 |
{ |
williamr@2 | 90 |
return *(iArray[aIndex]); |
williamr@2 | 91 |
} |
williamr@2 | 92 |
|
williamr@2 | 93 |
/** |
williamr@2 | 94 |
Returns the number of elements in the array. |
williamr@2 | 95 |
@return The number of elements in the array. |
williamr@2 | 96 |
@internalTechnology |
williamr@2 | 97 |
*/ |
williamr@2 | 98 |
template <class T> |
williamr@2 | 99 |
inline TInt CTzLocalizedArray<T>::Count() const |
williamr@2 | 100 |
{ |
williamr@2 | 101 |
return iArray.Count(); |
williamr@2 | 102 |
} |
williamr@2 | 103 |
|
williamr@2 | 104 |
/** |
williamr@2 | 105 |
Appends aElement to this array. |
williamr@2 | 106 |
@param aElement The element to add. |
williamr@2 | 107 |
@internalTechnology |
williamr@2 | 108 |
*/ |
williamr@2 | 109 |
template <class T> |
williamr@2 | 110 |
inline void CTzLocalizedArray<T>::AppendL(T* aElement) |
williamr@2 | 111 |
{ |
williamr@2 | 112 |
iArray.AppendL(aElement); |
williamr@2 | 113 |
} |
williamr@2 | 114 |
|
williamr@2 | 115 |
/** |
williamr@2 | 116 |
Removes the element at the specified index. |
williamr@2 | 117 |
@param aIndex The index of the element to remove. |
williamr@2 | 118 |
@internalTechnology |
williamr@2 | 119 |
*/ |
williamr@2 | 120 |
template <class T> |
williamr@2 | 121 |
inline void CTzLocalizedArray<T>::Remove(TInt aIndex) |
williamr@2 | 122 |
{ |
williamr@2 | 123 |
iArray.Remove(aIndex); |
williamr@2 | 124 |
} |
williamr@2 | 125 |
|
williamr@2 | 126 |
/** |
williamr@2 | 127 |
Sorts this array. |
williamr@2 | 128 |
@param aOrder The sorting function to use. |
williamr@2 | 129 |
@internalTechnology |
williamr@2 | 130 |
*/ |
williamr@2 | 131 |
template <class T> |
williamr@2 | 132 |
inline void CTzLocalizedArray<T>::Sort(TLinearOrder<T> aOrder) |
williamr@2 | 133 |
{ |
williamr@2 | 134 |
iArray.Sort(aOrder); |
williamr@2 | 135 |
} |
williamr@2 | 136 |
|
williamr@2 | 137 |
/** |
williamr@2 | 138 |
Finds an element in this array. |
williamr@2 | 139 |
@param aIdentityRelation finding function to use. |
williamr@2 | 140 |
@internalTechnology |
williamr@2 | 141 |
*/ |
williamr@2 | 142 |
template <class T> |
williamr@2 | 143 |
inline TInt CTzLocalizedArray<T>::Find(T* aEntry,TIdentityRelation<T> aIdentityRelation) |
williamr@2 | 144 |
{ |
williamr@2 | 145 |
return iArray.Find(aEntry,aIdentityRelation); |
williamr@2 | 146 |
} |
williamr@2 | 147 |
|
williamr@2 | 148 |
#endif //__TZLOCAL_DATATYPES_INL__ |
williamr@2 | 149 |
|
williamr@2 | 150 |
//================================================================== |
williamr@2 | 151 |
// End of file |
williamr@2 | 152 |
//================================================================== |