author | hgs |
Thu, 01 Jul 2010 17:57:33 +0100 | |
changeset 189 | a5496987b1da |
parent 90 | 947f0dc9f7a8 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32\include\e32std.inl |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
// Global leaving operator new |
|
19 |
inline TAny* operator new(TUint aSize, TLeave) |
|
20 |
{return User::AllocL(aSize);} |
|
21 |
inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize) |
|
22 |
{return User::AllocL(aSize + aExtraSize);} |
|
23 |
#if !defined(__VC32__) || defined (__MSVCDOTNET__) |
|
24 |
inline TAny* operator new[](TUint aSize, TLeave) |
|
25 |
{return User::AllocL(aSize);} |
|
26 |
#endif |
|
27 |
||
28 |
||
29 |
||
30 |
||
31 |
// class Mem |
|
32 |
inline TUint8* Mem::Copy(TAny* aTrg, const TAny* aSrc, TInt aLength) |
|
33 |
/** |
|
34 |
Copies data from a source location to a target location and returns a pointer |
|
35 |
to the end of the copied data. |
|
36 |
||
37 |
The source and target areas can overlap. |
|
38 |
||
39 |
The copy operation is optimised so that if both source and target locations |
|
40 |
are aligned on a word boundary, the operation performs the copy on a word |
|
41 |
by word basis. |
|
42 |
||
43 |
@param aTrg A pointer to the target location for the copy operation. |
|
44 |
@param aSrc A pointer to the source location for the copy operation. |
|
45 |
@param aLength The number of bytes to be copied. This value must not |
|
46 |
be negative. |
|
47 |
||
48 |
@return A pointer to a location aLength bytes beyond aTrg (i.e. the location |
|
49 |
aTrg+aLength). |
|
50 |
||
51 |
@panic USER 90 In debug builds only, if aLength is negative. |
|
52 |
*/ |
|
53 |
{ return (TUint8*)memmove(aTrg, aSrc, aLength) + aLength; } |
|
54 |
||
55 |
||
56 |
||
57 |
||
58 |
inline TUint8* Mem::Move(TAny* aTrg, const TAny* aSrc, TInt aLength) |
|
59 |
/** |
|
60 |
Moves a block of data from a source location to a target location and returns |
|
61 |
a pointer to the end of the moved data. |
|
62 |
||
63 |
The source and target areas can overlap. |
|
64 |
||
65 |
Both source and target locations must be aligned on a word boundary. |
|
66 |
The specified length must also be a multiple of 4. |
|
67 |
||
68 |
@param aTrg A pointer to the target location for the move operation. This |
|
69 |
pointer must be word aligned. |
|
70 |
@param aSrc A pointer to the source location for the move operation. This |
|
71 |
pointer must be word aligned. |
|
72 |
@param aLength The number of bytes to be copied. This value must be a multiple |
|
73 |
of 4. |
|
74 |
||
75 |
@return A pointer to a location aLength bytes beyond aTrg (i.e. the location |
|
76 |
aTrg+aLength). |
|
77 |
||
78 |
@panic USER 93 In debug builds only, if aTrg is not word aligned. |
|
79 |
@panic USER 92 In debug builds only, if aSrc is not word aligned. |
|
80 |
@panic USER 91 In debug builds only, if aLength is not a multiple of 4. |
|
81 |
*/ |
|
82 |
{ return (TUint8*)wordmove(aTrg, aSrc, aLength) + aLength; } |
|
83 |
||
84 |
||
85 |
||
86 |
||
87 |
inline void Mem::Fill(TAny* aTrg, TInt aLength, TChar aChar) |
|
88 |
/** |
|
89 |
Fills a specified block of data with a specified character, replacing |
|
90 |
any existing content. |
|
91 |
||
92 |
The function assumes that the fill character is a non-Unicode character. |
|
93 |
||
94 |
@param aTrg A pointer to the location where filling is to start. |
|
95 |
@param aLength The number of bytes to be filled. This value must not |
|
96 |
be negative. |
|
97 |
@param aChar The fill character. |
|
98 |
||
99 |
@panic USER 95 In debug builds only, if aLength is negative. |
|
100 |
*/ |
|
101 |
{ memset(aTrg, (TInt)(aChar.operator TUint()), aLength); } |
|
102 |
||
103 |
||
104 |
||
105 |
||
106 |
inline void Mem::FillZ(TAny* aTrg,TInt aLength) |
|
107 |
/** |
|
108 |
Fills a specified block of data with binary zeroes (i.e. 0x00), replacing any |
|
109 |
existing content. |
|
110 |
||
111 |
@param aTrg A pointer to the location where filling is to start. |
|
112 |
@param aLength The number of bytes to be filled. This value must not |
|
113 |
be negative. |
|
114 |
||
115 |
@panic USER 95 In debug builds only, if aLength is negative. |
|
116 |
*/ |
|
117 |
{ memclr(aTrg, aLength); } |
|
118 |
||
119 |
||
120 |
||
121 |
||
122 |
#if !(defined(__GCC32__) && defined(__MARM__)) |
|
123 |
inline TInt Mem::Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL) |
|
124 |
/** |
|
125 |
Compares a block of data at one specified location with a block of data at |
|
126 |
another specified location. |
|
127 |
||
128 |
The comparison proceeds on a byte for byte basis, the result of the comparison |
|
129 |
is based on the difference of the first bytes to disagree. |
|
130 |
||
131 |
The data at the two locations are equal if they have the same length and content. |
|
132 |
Where the lengths are different and the shorter section of data is the same |
|
133 |
as the first part of the longer section of data, the shorter is considered |
|
134 |
to be less than the longer. |
|
135 |
||
136 |
@param aLeft A pointer to the first (or left) block of 8 bit data |
|
137 |
to be compared. |
|
138 |
@param aLeftL The length of the first (or left) block of data to be compared, |
|
139 |
i.e. the number of bytes. |
|
140 |
@param aRight A pointer to the second (or right) block of 8 bit data to be |
|
141 |
compared. |
|
142 |
@param aRightL The length of the second (or right) block of data to be compared |
|
143 |
i.e. the number of bytes. |
|
144 |
||
145 |
@return Positive, if the first (or left) block of data is greater than the |
|
146 |
second (or right) block of data. |
|
147 |
Negative, if the first (or left) block of data is less than the |
|
148 |
second (or right) block of data. |
|
149 |
Zero, if both the first (or left) and second (or right) blocks of data |
|
150 |
have the same length and the same content. |
|
151 |
*/ |
|
152 |
{ return memcompare(aLeft, aLeftL, aRight, aRightL); } |
|
153 |
#endif |
|
154 |
||
155 |
||
156 |
||
157 |
||
158 |
// class TChar |
|
159 |
#ifndef __KERNEL_MODE__ |
|
160 |
inline void TChar::SetChar(TUint aChar) |
|
161 |
{iChar=aChar;} |
|
162 |
||
163 |
||
164 |
||
165 |
||
166 |
inline void TChar::Fold() |
|
167 |
/** |
|
168 |
Converts the character to a form which can be used in tolerant comparisons |
|
169 |
without control over the operations performed. |
|
170 |
||
171 |
Tolerant comparisons are those which ignore character differences like case |
|
172 |
and accents. |
|
173 |
||
174 |
This function can be used when searching for a string in a text file or a |
|
175 |
file in a directory. Folding performs the following conversions: converts |
|
176 |
to lowercase, strips accents, converts all digits representing the values |
|
177 |
0..9 to the ordinary digit characters '0'..'9', converts all spaces (standard, |
|
178 |
non-break, fixed-width, ideographic, etc.) to the ordinary space character |
|
179 |
(0x0020), converts Japanese characters in the hiragana syllabary to katakana, |
|
180 |
and converts East Asian halfwidth and fullwidth variants to their ordinary |
|
181 |
forms. You can choose to perform any subset of these operations by using the |
|
182 |
other function overload. |
|
183 |
||
184 |
@see User::Fold |
|
185 |
*/ |
|
186 |
{iChar=User::Fold(iChar);} |
|
187 |
||
188 |
||
189 |
||
190 |
||
191 |
inline void TChar::LowerCase() |
|
192 |
/** |
|
193 |
Converts the character to its lowercase form. |
|
194 |
||
195 |
Characters lacking a lowercase form are unchanged. |
|
196 |
||
197 |
@see User::LowerCase |
|
198 |
*/ |
|
199 |
{iChar=User::LowerCase(iChar);} |
|
200 |
||
201 |
||
202 |
||
203 |
||
204 |
inline void TChar::UpperCase() |
|
205 |
/** |
|
206 |
Converts the character to its uppercase form. |
|
207 |
||
208 |
Characters lacking an uppercase form are unchanged. |
|
209 |
||
210 |
@see User::UpperCase |
|
211 |
*/ |
|
212 |
{iChar=User::UpperCase(iChar);} |
|
213 |
||
214 |
||
215 |
||
216 |
||
217 |
#ifdef _UNICODE |
|
218 |
inline void TChar::Fold(TInt aFlags) |
|
219 |
/** |
|
220 |
Converts the character to a form which can be used in tolerant comparisons |
|
221 |
allowing selection of the specific fold operations to be performed. |
|
222 |
||
223 |
@param aFlags Flags which define the operations to be performed. The values |
|
224 |
are defined in the enum beginning with EFoldCase. |
|
225 |
||
226 |
@see TChar::EFoldCase |
|
227 |
@see User::Fold |
|
228 |
*/ |
|
229 |
{iChar=User::Fold(iChar,aFlags);} |
|
230 |
||
231 |
||
232 |
||
233 |
||
234 |
inline void TChar::TitleCase() |
|
235 |
/** |
|
236 |
Converts the character to its titlecase form. |
|
237 |
||
238 |
The titlecase form of a character is identical to its uppercase form unless |
|
239 |
a specific titlecase form exists. Characters lacking a titlecase form are |
|
240 |
unchanged. |
|
241 |
*/ |
|
242 |
{iChar=User::TitleCase(iChar);} |
|
243 |
#endif |
|
244 |
||
245 |
||
246 |
||
247 |
||
248 |
inline TBool TChar::Eos() const |
|
249 |
/** |
|
250 |
Tests whether the character is the C/C++ end-of-string character - 0. |
|
251 |
||
252 |
@return True, if the character is 0; false, otherwise. |
|
253 |
*/ |
|
254 |
{return(iChar==0);} |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
255 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
256 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
257 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
258 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
259 |
inline TBool TChar::IsSupplementary(TUint aChar) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
260 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
261 |
@param aChar The 32-bit code point value of a Unicode character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
262 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
263 |
@return True, if aChar is supplementary character; false, otherwise. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
264 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
265 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
266 |
return (aChar > 0xFFFF); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
267 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
268 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
269 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
270 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
271 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
272 |
inline TBool TChar::IsSurrogate(TText16 aInt16) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
273 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
274 |
@return True, if aText16 is high surrogate or low surrogate; false, otherwise. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
275 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
276 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
277 |
return (aInt16 & 0xF800) == 0xD800; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
278 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
279 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
280 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
281 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
282 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
283 |
inline TBool TChar::IsHighSurrogate(TText16 aInt16) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
284 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
285 |
@return True, if aText16 is high surrogate; false, otherwise. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
286 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
287 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
288 |
return (aInt16 & 0xFC00) == 0xD800; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
289 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
290 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
291 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
292 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
293 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
294 |
inline TBool TChar::IsLowSurrogate(TText16 aInt16) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
295 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
296 |
@return True, if aText16 is low surrogate; false, otherwise. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
297 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
298 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
299 |
return (aInt16 & 0xFC00) == 0xDC00; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
300 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
301 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
302 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
303 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
304 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
305 |
inline TUint TChar::JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
306 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
307 |
Combine a high surrogate and a low surrogate into a supplementary character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
308 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
309 |
@return The 32-bit code point value of the generated Unicode supplementary |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
310 |
character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
311 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
312 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
313 |
return ((aHighSurrogate - 0xD7F7) << 10) + aLowSurrogate; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
314 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
315 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
316 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
317 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
318 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
319 |
inline TText16 TChar::GetHighSurrogate(TUint aChar) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
320 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
321 |
Retrieve the high surrogate of a supplementary character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
322 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
323 |
@param aChar The 32-bit code point value of a Unicode character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
324 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
325 |
@return High surrogate of aChar, if aChar is a supplementary character; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
326 |
aChar itself, if aChar is not a supplementary character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
327 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
328 |
@see TChar::GetLowSurrogate |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
329 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
330 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
331 |
return STATIC_CAST(TText16, 0xD7C0 + (aChar >> 10)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
332 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
333 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
334 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
335 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
336 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
337 |
inline TText16 TChar::GetLowSurrogate(TUint aChar) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
338 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
339 |
Retrieve the low surrogate of a supplementary character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
340 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
341 |
@param aChar The 32-bit code point value of a Unicode character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
342 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
343 |
@return Low surrogate of aChar, if aChar is a supplementary character; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
344 |
zero, if aChar is not a supplementary character. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
345 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
346 |
@see TChar::GetHighSurrogate |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
347 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
348 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
349 |
return STATIC_CAST(TText16, 0xDC00 | (aChar & 0x3FF)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
350 |
} |
0 | 351 |
#endif // _UNICODE |
352 |
||
353 |
||
354 |
||
355 |
||
356 |
// Class TCallBack |
|
357 |
inline TCallBack::TCallBack() |
|
358 |
/** |
|
359 |
Default constructor. |
|
360 |
||
361 |
Sets the function pointer to Null. |
|
362 |
*/ |
|
363 |
{iFunction=NULL;} |
|
364 |
||
365 |
||
366 |
||
367 |
||
368 |
inline TCallBack::TCallBack(TInt (*aFunction)(TAny *aPtr)) |
|
369 |
: iFunction(aFunction),iPtr(NULL) |
|
370 |
/** |
|
371 |
Constructs the callback object with the specified callback function. |
|
372 |
||
373 |
@param aFunction A pointer to the callback function. It takes an argument of |
|
374 |
type TAny* and returns a TInt. |
|
375 |
It must be either a static member of a class or a function |
|
376 |
which is not a member of any class. |
|
377 |
*/ |
|
378 |
{} |
|
379 |
||
380 |
||
381 |
||
382 |
||
383 |
inline TCallBack::TCallBack(TInt (*aFunction)(TAny *aPtr),TAny *aPtr) |
|
384 |
: iFunction(aFunction),iPtr(aPtr) |
|
385 |
/** |
|
386 |
Constructs the callback object with the specified callback function and |
|
387 |
a pointer to any object. |
|
388 |
||
389 |
@param aFunction A pointer to the callback function. It takes an argument of |
|
390 |
type TAny* and returns a TInt. |
|
391 |
It must be either a static member of a class or a function |
|
392 |
which is not a member of any class. |
|
393 |
@param aPtr A pointer which is always passed to the callback function. |
|
394 |
*/ |
|
395 |
{} |
|
396 |
||
397 |
||
398 |
||
399 |
||
400 |
/** |
|
401 |
Calls the callback function. |
|
402 |
||
403 |
@return The value returned by the callback function. The meaning of this value |
|
404 |
depends entirely on the context in which the callback function |
|
405 |
is called. |
|
406 |
For example, when used with the CIdle class, a false (zero) value |
|
407 |
indicates that the callback function should not be called again. |
|
408 |
As another example, when used with the CPeriodic class, the return |
|
409 |
value is ignored and is irrelevant in that context. |
|
410 |
||
411 |
@see CIdle |
|
412 |
@see CPeriodic |
|
413 |
*/ |
|
414 |
inline TInt TCallBack::CallBack() const |
|
415 |
{ return (iFunction ? (*iFunction)(iPtr) : 0); } |
|
416 |
||
417 |
||
418 |
||
419 |
||
420 |
// Class TSglQue |
|
421 |
template <class T> |
|
422 |
inline TSglQue<T>::TSglQue() |
|
423 |
/** |
|
424 |
Constructs an empty list header and sets the offset value of the link object |
|
425 |
to zero. |
|
426 |
||
427 |
In practice, never assume that the offset of the link object from the start |
|
428 |
of a list element is zero, even if the link object is declared as the first |
|
429 |
data member in the list element class. |
|
430 |
||
431 |
If this default constructor is used, then call the SetOffset() function of |
|
432 |
the base class to ensure that the offset value is set correctly. |
|
433 |
||
434 |
@see TSglQueBase::SetOffset |
|
435 |
*/ |
|
436 |
{} |
|
437 |
||
438 |
||
439 |
||
440 |
||
441 |
template <class T> |
|
442 |
inline TSglQue<T>::TSglQue(TInt aOffset) |
|
443 |
: TSglQueBase(aOffset) |
|
444 |
/** |
|
445 |
Constructs an empty list header and sets the offset of the link object to the |
|
446 |
specified value. |
|
447 |
||
448 |
@param aOffset The offset of the link object from the start of a list element. |
|
449 |
The macro _FOFF can be used to calculate this value. |
|
450 |
||
451 |
@panic USER 75, if aOffset is not divisible by four. |
|
452 |
||
453 |
@see _FOFF |
|
454 |
*/ |
|
455 |
{} |
|
456 |
||
457 |
||
458 |
||
459 |
||
460 |
template <class T> |
|
461 |
inline void TSglQue<T>::AddFirst(T &aRef) |
|
462 |
/** |
|
463 |
Inserts the specified list element at the front of the singly linked list. |
|
464 |
||
465 |
If the list is not empty, the specified element becomes the first in the list. |
|
466 |
What was previously the first element becomes the second in the list. |
|
467 |
||
468 |
@param aRef The list element to be inserted at the front of the singly linked |
|
469 |
list. |
|
470 |
*/ |
|
471 |
{DoAddFirst(&aRef);} |
|
472 |
||
473 |
||
474 |
||
475 |
||
476 |
template <class T> |
|
477 |
inline void TSglQue<T>::AddLast(T &aRef) |
|
478 |
/** |
|
479 |
Inserts the specified list element at the back of the singly linked list. |
|
480 |
||
481 |
If the list is not empty, the specified element becomes the last in the list. |
|
482 |
What was previously the last element becomes the next to last element in the |
|
483 |
list. |
|
484 |
||
485 |
@param aRef The list element to be inserted at the back of the singly linked |
|
486 |
list. |
|
487 |
*/ |
|
488 |
{DoAddLast(&aRef);} |
|
489 |
||
490 |
||
491 |
||
492 |
||
493 |
template <class T> |
|
494 |
inline TBool TSglQue<T>::IsFirst(const T *aPtr) const |
|
495 |
/** |
|
496 |
Tests whether the specified element is the first in the singly linked list. |
|
497 |
||
498 |
@param aPtr A pointer to the element whose position in the list is to be |
|
499 |
checked. |
|
500 |
||
501 |
@return True, if the element is the first in the list; false, otherwise. |
|
502 |
*/ |
|
503 |
{return(PtrAdd(aPtr,iOffset)==(T *)iHead);} |
|
504 |
||
505 |
||
506 |
||
507 |
||
508 |
template <class T> |
|
509 |
inline TBool TSglQue<T>::IsLast(const T *aPtr) const |
|
510 |
/** |
|
511 |
Tests whether the specified element is the last in the singly linked list. |
|
512 |
||
513 |
@param aPtr A pointer to the element whose position in the list is |
|
514 |
to be checked. |
|
515 |
||
516 |
@return True, if the element is the last in the list; false, otherwise. |
|
517 |
*/ |
|
518 |
{return(PtrAdd(aPtr,iOffset)==(T *)iLast);} |
|
519 |
||
520 |
||
521 |
||
522 |
||
523 |
template <class T> |
|
524 |
inline T *TSglQue<T>::First() const |
|
525 |
/** |
|
526 |
Gets a pointer to the first list element in the singly linked list. |
|
527 |
||
528 |
@return A pointer to the first list element in the singly linked list. If |
|
529 |
the list is empty, this pointer is not necessarily NULL and must not |
|
530 |
be assumed to point to a valid object. |
|
531 |
*/ |
|
532 |
{return(PtrSub((T *)iHead,iOffset));} |
|
533 |
||
534 |
||
535 |
||
536 |
||
537 |
template <class T> |
|
538 |
inline T *TSglQue<T>::Last() const |
|
539 |
/** |
|
540 |
Gets a pointer to the last list element in the singly linked list. |
|
541 |
||
542 |
@return A pointer to the last list element in the singly linked list. If the |
|
543 |
list is empty, this pointer is not necessarily NULL and must not be |
|
544 |
assumed to point to a valid object. |
|
545 |
*/ |
|
546 |
{return(PtrSub((T *)iLast,iOffset));} |
|
547 |
||
548 |
||
549 |
||
550 |
||
551 |
template <class T> |
|
552 |
inline void TSglQue<T>::Remove(T &aRef) |
|
553 |
/** |
|
554 |
Removes the specified element from the singly linked list. |
|
555 |
||
556 |
The singly linked list must not be empty. |
|
557 |
||
558 |
@param aRef A list element to be removed from the singly linked list. |
|
559 |
||
560 |
@panic USER 76, if the element to be removed is not in the list |
|
561 |
*/ |
|
562 |
{DoRemove(&aRef);} |
|
563 |
||
564 |
||
565 |
||
566 |
||
567 |
// Class TDblQue |
|
568 |
template <class T> |
|
569 |
inline TDblQue<T>::TDblQue() |
|
570 |
/** |
|
571 |
Constructs an empty list header and sets the offset value of the link object |
|
572 |
to zero. |
|
573 |
||
574 |
In practice, never assume that the offset of the link object from the start |
|
575 |
of a list element is zero, even if the link object is declared as the first |
|
576 |
data member in the list element class. |
|
577 |
||
578 |
If this default constructor is used, then call the SetOffset() function of |
|
579 |
the base class to ensure that the offset value is set correctly. |
|
580 |
||
581 |
@see TDblQueBase::SetOffset() |
|
582 |
*/ |
|
583 |
{} |
|
584 |
||
585 |
||
586 |
||
587 |
||
588 |
template <class T> |
|
589 |
inline TDblQue<T>::TDblQue(TInt aOffset) |
|
590 |
: TDblQueBase(aOffset) |
|
591 |
/** |
|
592 |
Constructs an empty list header and sets the offset of the link object to the |
|
593 |
specified value. |
|
594 |
||
595 |
@param aOffset The offset of the link object from the start of a list element. |
|
596 |
The macro _FOFF can be used to calculate this value. |
|
597 |
||
598 |
@panic USER 78. if aOffset is not divisble by 4. |
|
599 |
||
600 |
@see _FOFF |
|
601 |
*/ |
|
602 |
{} |
|
603 |
||
604 |
||
605 |
||
606 |
||
607 |
template <class T> |
|
608 |
inline void TDblQue<T>::AddFirst(T &aRef) |
|
609 |
/** |
|
610 |
Inserts the specified list element at the front of the doubly linked list. |
|
611 |
||
612 |
If the list is not empty, the specified element becomes the first in the list. |
|
613 |
What was previously the first element becomes the second in the list. |
|
614 |
||
615 |
@param aRef The list element to be inserted at the front of the doubly linked |
|
616 |
list. |
|
617 |
*/ |
|
618 |
{DoAddFirst(&aRef);} |
|
619 |
||
620 |
||
621 |
||
622 |
||
623 |
template <class T> |
|
624 |
inline void TDblQue<T>::AddLast(T &aRef) |
|
625 |
/** |
|
626 |
Inserts the specified list element at the back of the doubly linked list. |
|
627 |
||
628 |
If the list is not empty, the specified element becomes the last in the list. |
|
629 |
What was previously the last element becomes the next to last element in the |
|
630 |
list. |
|
631 |
||
632 |
@param aRef The list element to be inserted at the back of the doubly linked |
|
633 |
list. |
|
634 |
*/ |
|
635 |
{DoAddLast(&aRef);} |
|
636 |
||
637 |
||
638 |
||
639 |
||
640 |
template <class T> |
|
641 |
inline TBool TDblQue<T>::IsHead(const T *aPtr) const |
|
642 |
/** |
|
643 |
Tests whether the end of a list has been reached. |
|
644 |
||
645 |
A doubly linked list is circular; in following the chain of elements in a |
|
646 |
list (e.g. using the iterator operator++ or operator--), the chain eventually |
|
647 |
reaches the end of the list and aPtr corresponds to the header (although it |
|
648 |
will not point to a valid T object). |
|
649 |
||
650 |
@param aPtr The pointer value to be checked. |
|
651 |
||
652 |
@return True, if the end of the list has been reached. False, if the end of |
|
653 |
the list has not been reached; aPtr points to an element in the list. |
|
654 |
*/ |
|
655 |
{return(PtrAdd(aPtr,iOffset)==(T *)&iHead);} |
|
656 |
||
657 |
||
658 |
||
659 |
||
660 |
template <class T> |
|
661 |
inline TBool TDblQue<T>::IsFirst(const T *aPtr) const |
|
662 |
/** |
|
663 |
Tests whether the specified element is the first in the doubly linked list. |
|
664 |
||
665 |
@param aPtr A pointer to the element whose position in the list is to be checked. |
|
666 |
||
667 |
@return True, if the element is the first in the list; false, otherwise. |
|
668 |
*/ |
|
669 |
{return(PtrAdd(aPtr,iOffset)==(T *)iHead.iNext);} |
|
670 |
||
671 |
||
672 |
||
673 |
||
674 |
template <class T> |
|
675 |
inline TBool TDblQue<T>::IsLast(const T *aPtr) const |
|
676 |
/** |
|
677 |
Tests whether the specified element is the last in the doubly linked list. |
|
678 |
||
679 |
@param aPtr A pointer to the element whose position in the list is to be checked. |
|
680 |
||
681 |
@return True, if the element is the last in the list; false, otherwise. |
|
682 |
*/ |
|
683 |
{return(PtrAdd(aPtr,iOffset)==(T *)iHead.iPrev);} |
|
684 |
||
685 |
||
686 |
||
687 |
||
688 |
template <class T> |
|
689 |
inline T *TDblQue<T>::First() const |
|
690 |
/** |
|
691 |
Gets a pointer to the first list element in the doubly linked list. |
|
692 |
||
693 |
@return A pointer to the first list element in the doubly linked list. If |
|
694 |
the list is empty, this pointer is not necessarily NULL and must not |
|
695 |
be assumed to point to a valid object. |
|
696 |
*/ |
|
697 |
{ |
|
698 |
#if defined (_DEBUG) |
|
699 |
__DbgTestEmpty(); |
|
700 |
#endif |
|
701 |
return(PtrSub((T *)iHead.iNext,iOffset)); |
|
702 |
} |
|
703 |
||
704 |
||
705 |
||
706 |
||
707 |
template <class T> |
|
708 |
inline T *TDblQue<T>::Last() const |
|
709 |
/** |
|
710 |
Gets a pointer to the last list element in the doubly linked list. |
|
711 |
||
712 |
@return A pointer to the last list element in the doubly linked list. If the |
|
713 |
list is empty, this pointer is not necessarily NULL and must not be assumed |
|
714 |
to point to a valid object. |
|
715 |
*/ |
|
716 |
{ |
|
717 |
#if defined (_DEBUG) |
|
718 |
__DbgTestEmpty(); |
|
719 |
#endif |
|
720 |
return(PtrSub((T *)iHead.iPrev,iOffset)); |
|
721 |
} |
|
722 |
||
723 |
||
724 |
||
725 |
||
726 |
// Class TPriQue |
|
727 |
template <class T> |
|
728 |
inline TPriQue<T>::TPriQue() |
|
729 |
/** |
|
730 |
Default constructor. |
|
731 |
||
732 |
Constructs an empty list header and sets the offset value of the link |
|
733 |
object to zero. |
|
734 |
||
735 |
In practice, never assume that the offset of the link object from the start |
|
736 |
of a list element is zero, even if the link object is declared as the first |
|
737 |
data member in the list element class. |
|
738 |
||
739 |
If this default constructor is used, then call the SetOffset() function of |
|
740 |
the base class to ensure that the offset value is set correctly. |
|
741 |
||
742 |
@see TDblQueBase::SetOffset |
|
743 |
*/ |
|
744 |
{} |
|
745 |
||
746 |
||
747 |
||
748 |
||
749 |
template <class T> |
|
750 |
inline TPriQue<T>::TPriQue(TInt aOffset) |
|
751 |
: TDblQueBase(aOffset) |
|
752 |
/** |
|
753 |
Constructs an empty list header and sets the offset of the link object |
|
754 |
to the specified value. |
|
755 |
||
756 |
@param aOffset The offset of the link object from the start of a list element. |
|
757 |
The macro _FOFF can be used to calculate this value. |
|
758 |
||
759 |
@panic USER 78 if aOffset is not divisible by four. |
|
760 |
*/ |
|
761 |
{} |
|
762 |
||
763 |
||
764 |
||
765 |
||
766 |
template <class T> |
|
767 |
inline void TPriQue<T>::Add(T &aRef) |
|
768 |
/** |
|
769 |
Inserts the specified list element in descending priority order. |
|
770 |
||
771 |
If there is an existing list element with the same priority, then the new |
|
772 |
element is added after the existing element. |
|
773 |
||
774 |
@param aRef The list element to be inserted. |
|
775 |
*/ |
|
776 |
{DoAddPriority(&aRef);} |
|
777 |
||
778 |
||
779 |
||
780 |
||
781 |
template <class T> |
|
782 |
inline TBool TPriQue<T>::IsHead(const T *aPtr) const |
|
783 |
/** |
|
784 |
Tests whether the end of a list has been reached. |
|
785 |
||
786 |
A doubly linked list is circular; in following the chain of elements in a list |
|
787 |
(e.g. using the iterator operator++ or operator--), the chain eventually |
|
788 |
reaches the end of the list and aPtr corresponds to the header (although it |
|
789 |
will not point to a valid T object). |
|
790 |
||
791 |
@param aPtr The pointer value to be checked. |
|
792 |
||
793 |
@return True, if the end of the list has been reached. False, if the end of the |
|
794 |
list has not been reached; aPtr points to an element in the list. |
|
795 |
*/ |
|
796 |
{return(PtrAdd(aPtr,iOffset)==(T *)&iHead);} |
|
797 |
||
798 |
||
799 |
||
800 |
||
801 |
template <class T> |
|
802 |
inline TBool TPriQue<T>::IsFirst(const T *aPtr) const |
|
803 |
/** |
|
804 |
Tests whether the specified element is the first in the linked list. |
|
805 |
||
806 |
@param aPtr A pointer to the element whose position in the list is to |
|
807 |
be checked. |
|
808 |
||
809 |
@return True, if the element is the first in the list; false, otherwise. |
|
810 |
*/ |
|
811 |
{return(PtrAdd(aPtr,iOffset)==(T *)iHead.iNext);} |
|
812 |
||
813 |
||
814 |
||
815 |
||
816 |
template <class T> |
|
817 |
inline TBool TPriQue<T>::IsLast(const T *aPtr) const |
|
818 |
/** |
|
819 |
Tests whether the specified element is the last in the linked list. |
|
820 |
||
821 |
@param aPtr A pointer to the element whose position in the list is to |
|
822 |
be checked. |
|
823 |
||
824 |
@return True, if the element is the last in the list; false, otherwise. |
|
825 |
*/ |
|
826 |
{return(PtrAdd(aPtr,iOffset)==(T *)iHead.iPrev);} |
|
827 |
||
828 |
||
829 |
||
830 |
||
831 |
template <class T> |
|
832 |
inline T *TPriQue<T>::First() const |
|
833 |
/** |
|
834 |
Gets a pointer to the first list element in the linked list. |
|
835 |
||
836 |
@return A pointer to the first list element in the linked list. |
|
837 |
If the list is empty, this pointer is not necessarily NULL and must |
|
838 |
not be assumed to point to a valid object. |
|
839 |
*/ |
|
840 |
{return(PtrSub((T *)iHead.iNext,iOffset));} |
|
841 |
||
842 |
||
843 |
||
844 |
||
845 |
template <class T> |
|
846 |
inline T *TPriQue<T>::Last() const |
|
847 |
/** |
|
848 |
Gets a pointer to the last list element in the linked list. |
|
849 |
||
850 |
@return A pointer to the last list element in the linked list. |
|
851 |
If the list is empty, this pointer is not necessarily NULL and must |
|
852 |
not be assumed to point to a valid object. |
|
853 |
*/ |
|
854 |
{return(PtrSub((T *)iHead.iPrev,iOffset));} |
|
855 |
||
856 |
||
857 |
||
858 |
||
859 |
// Class TDeltaQue |
|
860 |
template <class T> |
|
861 |
inline TDeltaQue<T>::TDeltaQue() |
|
862 |
/** |
|
863 |
Constructs an empty list header and sets the offset value of the link object |
|
864 |
to zero. |
|
865 |
||
866 |
In practice, never assume that the offset of the link object from the start |
|
867 |
of a list element is zero, even if the link object is declared as the first |
|
868 |
data member in the list element class. |
|
869 |
||
870 |
If this default constructor is used, then call the TDblQueBase::SetOffset() |
|
871 |
function in the base class to ensure that the offset value is set correctly. |
|
872 |
||
873 |
TDeltaQueBase::iFirstDelta is set to NULL. |
|
874 |
||
875 |
@see TDblQueBase::SetOffset |
|
876 |
*/ |
|
877 |
{} |
|
878 |
||
879 |
||
880 |
||
881 |
||
882 |
template <class T> |
|
883 |
inline TDeltaQue<T>::TDeltaQue(TInt aOffset) |
|
884 |
: TDeltaQueBase(aOffset) |
|
885 |
/** |
|
886 |
Constructs an empty list header and sets the offset of the link object to the |
|
887 |
specified value. |
|
888 |
||
889 |
TDeltaQueBase::iFirstDelta is set to NULL. |
|
890 |
||
891 |
@param aOffset The offset of the link object from the start of a list element. |
|
892 |
The macro _FOFF can be used to calculate this value. |
|
893 |
||
894 |
@panic USER 78, if aOffset is not divisible by four. |
|
895 |
||
896 |
@see _FOFF |
|
897 |
*/ |
|
898 |
{} |
|
899 |
||
900 |
||
901 |
||
902 |
||
903 |
template <class T> |
|
904 |
inline void TDeltaQue<T>::Add(T &aRef,TInt aDelta) |
|
905 |
/** |
|
906 |
Adds the specified list element, having the specified 'distance' from the |
|
907 |
nominal zero point, into the list. |
|
908 |
||
909 |
The element is added into the list, the adjacent delta values adjusted, and |
|
910 |
a suitable delta value assigned to the new element, so that the new element |
|
911 |
is at the specified 'distance' from the nominal zero point. |
|
912 |
||
913 |
@param aRef The list element to be inserted. |
|
914 |
@param aDelta The 'distance' from the nominal zero point. |
|
915 |
*/ |
|
916 |
{DoAddDelta(&aRef,aDelta);} |
|
917 |
||
918 |
||
919 |
||
920 |
||
921 |
template <class T> |
|
922 |
inline void TDeltaQue<T>::Remove(T &aRef) |
|
923 |
/** |
|
924 |
Removes the specified list element from the linked list. |
|
925 |
||
926 |
The delta value of the element following the removed element is adjusted |
|
927 |
so that its 'distance' from the nominal zero point remains the same. |
|
928 |
||
929 |
@param aRef The list element to be removed. |
|
930 |
*/ |
|
931 |
{DoRemove(&aRef);} |
|
932 |
||
933 |
||
934 |
||
935 |
||
936 |
template <class T> |
|
937 |
inline T *TDeltaQue<T>::RemoveFirst() |
|
938 |
/** |
|
939 |
Removes the first list element from the linked list if its delta value is zero |
|
940 |
or negative. |
|
941 |
||
942 |
@return A pointer to the element removed from the linked list. This is NULL, |
|
943 |
if the first element has a positive delta value. |
|
944 |
*/ |
|
945 |
{return((T *) DoRemoveFirst());} |
|
946 |
||
947 |
||
948 |
||
949 |
||
950 |
// Class TSglQueIter |
|
951 |
template <class T> |
|
952 |
inline TSglQueIter<T>::TSglQueIter(TSglQueBase &aQue) |
|
953 |
: TSglQueIterBase(aQue) |
|
954 |
/** |
|
955 |
Constructs the iterator for the specified singly linked list. |
|
956 |
||
957 |
The iterator can be constructed whether or not the list contains any elements. |
|
958 |
||
959 |
If the list does contain elements, the iterator pointer is set to the first one. |
|
960 |
||
961 |
If the list has no elements, the iterator pointer is not set and the conversion |
|
962 |
operator T*() and the post increment operator ++ subsequently return NULL. |
|
963 |
Once elements have been added to the list, use either the |
|
964 |
TSglQueIter::Set() function or the TSglQueIterBase::SetToFirst() function to set the |
|
965 |
iterator pointer. |
|
966 |
||
967 |
@param aQue A reference to a singly linked list header. |
|
968 |
||
969 |
@see TSglQueIter::Set |
|
970 |
@see TSglQueIterBase::SetToFirst |
|
971 |
*/ |
|
972 |
{} |
|
973 |
||
974 |
||
975 |
||
976 |
||
977 |
template <class T> |
|
978 |
inline void TSglQueIter<T>::Set(T &aLink) |
|
979 |
/** |
|
980 |
Sets the iterator to point to a specific element in the list. |
|
981 |
||
982 |
This function can be used to alter the pointer at any time during the iterator's |
|
983 |
existence. The referenced element must be in the list, otherwise the result |
|
984 |
is undefined. |
|
985 |
||
986 |
@param aLink A reference to the element from where iteration is to continue. |
|
987 |
*/ |
|
988 |
{DoSet(&aLink);} |
|
989 |
||
990 |
||
991 |
||
992 |
||
993 |
template <class T> |
|
994 |
inline TSglQueIter<T>::operator T *() |
|
995 |
/** |
|
996 |
Gets a pointer to the iterator’s current element. |
|
997 |
||
998 |
The operator is normally used implicitly; e.g. some member functions of the |
|
999 |
list header class TSglQue require a pointer to an element (of type class T) |
|
1000 |
as a parameter, but in practice an iterator is often passed instead. |
|
1001 |
This operator performs the necessary conversion. |
|
1002 |
*/ |
|
1003 |
{return((T *)DoCurrent());} |
|
1004 |
||
1005 |
||
1006 |
||
1007 |
||
1008 |
template <class T> |
|
1009 |
inline T *TSglQueIter<T>::operator++(TInt) |
|
1010 |
/** |
|
1011 |
Gets a pointer to the iterator's current element and then sets the iterator |
|
1012 |
to point to the next element. |
|
1013 |
||
1014 |
Repeated use of this operator allows successive elements to be accessed. |
|
1015 |
||
1016 |
@return A pointer to the current list element, if the iterator points to an |
|
1017 |
element. NULL, if the iterator does not point to an element; i.e. the |
|
1018 |
iterator pointer has reached the end of the list. |
|
1019 |
*/ |
|
1020 |
{return((T *)DoPostInc());} |
|
1021 |
||
1022 |
||
1023 |
||
1024 |
||
1025 |
// Class TDblQueIter |
|
1026 |
template <class T> |
|
1027 |
inline TDblQueIter<T>::TDblQueIter(TDblQueBase &aQue) |
|
1028 |
: TDblQueIterBase(aQue) |
|
1029 |
/** |
|
1030 |
Constructs the iterator for the specified doubly linked list |
|
1031 |
||
1032 |
The iterator can be constructed whether or not the list contains any elements. |
|
1033 |
||
1034 |
If the list does contain elements, the iterator pointer is set to the first one. |
|
1035 |
||
1036 |
If the list has no elements, the iterator pointer is not set and the conversion |
|
1037 |
operator T*(), the post increment operator++() and the post decrement operator |
|
1038 |
--() subsequently return NULL. Once elements have been added to the list, use |
|
1039 |
either the TDblQueIter::Set() function, the TDblQueIterBase::SetToFirst() |
|
1040 |
function or the TDblQueIterBase::SetToLast() function to set the iterator |
|
1041 |
pointer. |
|
1042 |
||
1043 |
@param aQue A reference to a doubly linked list header. |
|
1044 |
||
1045 |
@see TDblQueIter::Set |
|
1046 |
@see TDblQueIterBase::SetToFirst |
|
1047 |
@see TDblQueIterBase::SetToLast |
|
1048 |
*/ |
|
1049 |
{} |
|
1050 |
||
1051 |
||
1052 |
||
1053 |
||
1054 |
template <class T> |
|
1055 |
inline void TDblQueIter<T>::Set(T &aLink) |
|
1056 |
/** |
|
1057 |
Sets the iterator to point to a specific element in the list. |
|
1058 |
||
1059 |
This function can be used to alter the pointer at any time during |
|
1060 |
the iterator's existence. The referenced element must be in the list, |
|
1061 |
otherwise the result is undefined. |
|
1062 |
||
1063 |
@param aLink A reference to the element from where iteration is to continue. |
|
1064 |
*/ |
|
1065 |
{DoSet(&aLink);} |
|
1066 |
||
1067 |
||
1068 |
||
1069 |
||
1070 |
template <class T> |
|
1071 |
inline TDblQueIter<T>::operator T *() |
|
1072 |
/** |
|
1073 |
Gets a pointer to the iterator’s current element. |
|
1074 |
||
1075 |
The operator is normally used implicitly; e.g. some member functions of the |
|
1076 |
list header class TDblQue require a pointer to an element (of type class T) |
|
1077 |
as a parameter but in practice, an iterator is often passed instead. |
|
1078 |
This operator performs the necessary conversion. |
|
1079 |
||
1080 |
@return A pointer to the current element, if the iterator points to an element |
|
1081 |
in the list. NULL, if the iterator does not point to an element; |
|
1082 |
i.e. the iterator pointer has previously reached the end of the list |
|
1083 |
(see operator++) or the start of the list (see operator--) or |
|
1084 |
the list is empty. |
|
1085 |
*/ |
|
1086 |
{return((T *) DoCurrent());} |
|
1087 |
||
1088 |
||
1089 |
||
1090 |
||
1091 |
template <class T> |
|
1092 |
inline T *TDblQueIter<T>::operator++(TInt) |
|
1093 |
/** |
|
1094 |
Gets a pointer to the iterator's current element and then sets the iterator |
|
1095 |
to point to the next element. |
|
1096 |
||
1097 |
Repeated use of this operator allows successive |
|
1098 |
elements to be accessed in the forwards direction. |
|
1099 |
||
1100 |
@return A pointer to the current list element, if the iterator points to an |
|
1101 |
element. NULL, if the iterator does not point to an element; |
|
1102 |
i.e. the iterator pointer has reached the end of the list. |
|
1103 |
*/ |
|
1104 |
{return((T *) DoPostInc());} |
|
1105 |
||
1106 |
||
1107 |
||
1108 |
||
1109 |
template <class T> |
|
1110 |
inline T *TDblQueIter<T>::operator--(TInt) |
|
1111 |
/** |
|
1112 |
Gets a pointer to the iterator's current element and then sets the iterator |
|
1113 |
to point to the previous element. |
|
1114 |
||
1115 |
Repeated use of this operator allows successive |
|
1116 |
elements to be accessed in the backwards direction. |
|
1117 |
||
1118 |
@return A pointer to the current element, if the iterator points to an element. |
|
1119 |
NULL, if the iterator does not point to an element; i.e. the iterator |
|
1120 |
pointer has reached the beginning of the list. |
|
1121 |
*/ |
|
1122 |
{return((T *) DoPostDec());} |
|
1123 |
||
1124 |
||
1125 |
||
1126 |
||
1127 |
// Class TKey |
|
1128 |
inline void TKey::SetPtr(const TAny *aPtr) |
|
1129 |
/** |
|
1130 |
Sets the pointer to a sample element whose key is to be used for comparison. |
|
1131 |
||
1132 |
The element can be in an existing array or it can be located anywhere in |
|
1133 |
addressable memory. |
|
1134 |
||
1135 |
The At() member function supplied by a derived class must return a pointer |
|
1136 |
to this sample element's key when passed an index value of KIndexPtr. |
|
1137 |
||
1138 |
SetPtr() must be called before calling User::BinarySearch() because this algorithm |
|
1139 |
uses the key of this sample element as the basis for searching the array. |
|
1140 |
||
1141 |
@param aPtr A pointer to a sample element. |
|
1142 |
*/ |
|
1143 |
{iPtr=aPtr;} |
|
1144 |
||
1145 |
||
1146 |
||
1147 |
||
1148 |
// Class TCharF |
|
1149 |
inline TCharF::TCharF(TUint aChar) |
|
1150 |
: TChar(User::Fold(aChar)) |
|
1151 |
/** |
|
1152 |
Constructs this 'fold character' object and initialises it with the specified |
|
1153 |
value. |
|
1154 |
||
1155 |
@param aChar The initialisation value. |
|
1156 |
*/ |
|
1157 |
{} |
|
1158 |
||
1159 |
||
1160 |
||
1161 |
||
1162 |
inline TCharF::TCharF(const TChar& aChar) |
|
1163 |
: TChar(User::Fold(aChar)) |
|
1164 |
/** |
|
1165 |
Constructs this 'fold character' object and initialises it with the value of |
|
1166 |
the TChar object aChar. |
|
1167 |
||
1168 |
@param aChar The character object to use as the initialisation value. |
|
1169 |
*/ |
|
1170 |
{} |
|
1171 |
||
1172 |
||
1173 |
||
1174 |
||
1175 |
inline TCharF& TCharF::operator=(TUint aChar) |
|
1176 |
/** |
|
1177 |
Assigns an unsigned integer value to the 'fold character' object. |
|
1178 |
||
1179 |
@param aChar The value to assign. |
|
1180 |
||
1181 |
@return A reference to this 'fold character' object. |
|
1182 |
*/ |
|
1183 |
{SetChar(User::Fold(aChar));return(*this);} |
|
1184 |
||
1185 |
||
1186 |
||
1187 |
||
1188 |
inline TCharF& TCharF::operator=(const TChar& aChar) |
|
1189 |
/** |
|
1190 |
Assigns the specified character object to this 'fold character' object. |
|
1191 |
||
1192 |
@param aChar The character object to assign. |
|
1193 |
||
1194 |
@return A reference to this 'fold character' object. |
|
1195 |
*/ |
|
1196 |
{SetChar(User::Fold(aChar));return(*this);} |
|
1197 |
||
1198 |
||
1199 |
||
1200 |
||
1201 |
// Class TCharLC |
|
1202 |
inline TCharLC::TCharLC(TUint aChar) |
|
1203 |
: TChar(User::LowerCase(aChar)) |
|
1204 |
/** |
|
1205 |
Constructs this 'character to lower case' object and initialises it with the |
|
1206 |
specified value. |
|
1207 |
||
1208 |
@param aChar The initialisation value. |
|
1209 |
||
1210 |
*/ |
|
1211 |
{} |
|
1212 |
||
1213 |
||
1214 |
||
1215 |
||
1216 |
inline TCharLC::TCharLC(const TChar& aChar) |
|
1217 |
: TChar(User::LowerCase(aChar)) |
|
1218 |
/** |
|
1219 |
Constructs this 'character to lower case' object and initialises it with the |
|
1220 |
value of the TChar object aChar. |
|
1221 |
||
1222 |
@param aChar The character object to use as the initialisation value. |
|
1223 |
*/ |
|
1224 |
{} |
|
1225 |
||
1226 |
||
1227 |
||
1228 |
||
1229 |
inline TCharLC& TCharLC::operator=(TUint aChar) |
|
1230 |
/** |
|
1231 |
Assigns an unsigned integer value to the 'character to lower case' object. |
|
1232 |
||
1233 |
@param aChar The value to assign. |
|
1234 |
||
1235 |
@return A reference to this 'character to lower case' object. |
|
1236 |
*/ |
|
1237 |
{SetChar(User::LowerCase(aChar));return(*this);} |
|
1238 |
||
1239 |
||
1240 |
||
1241 |
||
1242 |
inline TCharLC& TCharLC::operator=(const TChar& aChar) |
|
1243 |
/** |
|
1244 |
Assigns the specified character object to this 'character to lower case' |
|
1245 |
object. |
|
1246 |
||
1247 |
@param aChar The character object to assign. |
|
1248 |
||
1249 |
@return A reference to this 'character to lower case' object. |
|
1250 |
*/ |
|
1251 |
{SetChar(User::LowerCase(aChar));return(*this);} |
|
1252 |
||
1253 |
||
1254 |
||
1255 |
||
1256 |
// Class TCharUC |
|
1257 |
inline TCharUC::TCharUC(TUint aChar) |
|
1258 |
: TChar(User::UpperCase(aChar)) |
|
1259 |
/** |
|
1260 |
Constructs this 'character to upper case' object and initialises it with the |
|
1261 |
specified value. |
|
1262 |
||
1263 |
@param aChar The initialisation value. |
|
1264 |
*/ |
|
1265 |
{} |
|
1266 |
||
1267 |
||
1268 |
||
1269 |
||
1270 |
inline TCharUC::TCharUC(const TChar& aChar) |
|
1271 |
: TChar(User::UpperCase(aChar)) |
|
1272 |
/** |
|
1273 |
Constructs this 'character to upper case' object and initialises it with the |
|
1274 |
value of the TChar object aChar. |
|
1275 |
||
1276 |
@param aChar The character object to use as the initialisation value. |
|
1277 |
*/ |
|
1278 |
{} |
|
1279 |
||
1280 |
||
1281 |
||
1282 |
||
1283 |
inline TCharUC& TCharUC::operator=(TUint aChar) |
|
1284 |
/** |
|
1285 |
Assigns an unsigned integer value to the 'character to upper case' object. |
|
1286 |
||
1287 |
@param aChar The value to assign. |
|
1288 |
||
1289 |
@return A reference to this 'character to upper case' object. |
|
1290 |
*/ |
|
1291 |
{SetChar(User::UpperCase(aChar));return(*this);} |
|
1292 |
||
1293 |
||
1294 |
||
1295 |
||
1296 |
inline TCharUC& TCharUC::operator=(const TChar& aChar) |
|
1297 |
/** |
|
1298 |
Assigns the specified character object to this 'character to upper case' |
|
1299 |
object. |
|
1300 |
||
1301 |
@param aChar The character object to assign. |
|
1302 |
||
1303 |
@return A reference to this 'character to upper case' object. |
|
1304 |
*/ |
|
1305 |
{SetChar(User::UpperCase(aChar));return(*this);} |
|
1306 |
||
1307 |
||
1308 |
||
1309 |
||
1310 |
// Class TDateTime |
|
1311 |
inline TDateTime::TDateTime() |
|
1312 |
: iYear(1980), |
|
1313 |
iMonth(EJanuary), |
|
1314 |
iDay(1), |
|
1315 |
iHour(0), |
|
1316 |
iMinute(0), |
|
1317 |
iSecond(0), |
|
1318 |
iMicroSecond(0) |
|
1319 |
/** |
|
1320 |
Constructs an uninitialised TDateTime object. |
|
1321 |
*/ |
|
1322 |
{} |
|
1323 |
||
1324 |
||
1325 |
||
1326 |
||
1327 |
inline TInt TDateTime::Year() const |
|
1328 |
/** |
|
1329 |
Gets the year component of the date/time. |
|
1330 |
||
1331 |
A negative value indicates a BC date. |
|
1332 |
||
1333 |
@return The year |
|
1334 |
*/ |
|
1335 |
{return(iYear);} |
|
1336 |
||
1337 |
||
1338 |
||
1339 |
||
1340 |
inline TMonth TDateTime::Month() const |
|
1341 |
/** |
|
1342 |
Gets the month component of the date/time. |
|
1343 |
||
1344 |
@return The month. EJanuary to EDecember. Offset from zero, so add one before |
|
1345 |
displaying the month number. |
|
1346 |
*/ |
|
1347 |
{return(iMonth);} |
|
1348 |
||
1349 |
||
1350 |
||
1351 |
||
1352 |
inline TInt TDateTime::Day() const |
|
1353 |
/** |
|
1354 |
Gets the day component of the date/time. |
|
1355 |
||
1356 |
@return The day. Offset from zero, so add one before displaying the day number. |
|
1357 |
*/ |
|
1358 |
{return(iDay);} |
|
1359 |
||
1360 |
||
1361 |
||
1362 |
||
1363 |
inline TInt TDateTime::Hour() const |
|
1364 |
/** |
|
1365 |
Gets the hour component of the date/time. |
|
1366 |
||
1367 |
@return The hour. |
|
1368 |
*/ |
|
1369 |
{return(iHour);} |
|
1370 |
||
1371 |
||
1372 |
||
1373 |
||
1374 |
inline TInt TDateTime::Minute() const |
|
1375 |
/** |
|
1376 |
Gets the minute component of the date/time. |
|
1377 |
||
1378 |
@return The minute. |
|
1379 |
*/ |
|
1380 |
{return(iMinute);} |
|
1381 |
||
1382 |
||
1383 |
||
1384 |
||
1385 |
inline TInt TDateTime::Second() const |
|
1386 |
/** |
|
1387 |
Gets the second component of the date/time. |
|
1388 |
||
1389 |
@return The second. |
|
1390 |
*/ |
|
1391 |
{return(iSecond);} |
|
1392 |
||
1393 |
||
1394 |
||
1395 |
||
1396 |
inline TInt TDateTime::MicroSecond() const |
|
1397 |
/** |
|
1398 |
Gets the microsecond component of the date/time. |
|
1399 |
||
1400 |
@return The microsecond. |
|
1401 |
*/ |
|
1402 |
{return(iMicroSecond);} |
|
1403 |
||
1404 |
// Class TTimeIntervalMicroSeconds |
|
1405 |
||
1406 |
||
1407 |
||
1408 |
||
1409 |
inline TTimeIntervalMicroSeconds::TTimeIntervalMicroSeconds() |
|
1410 |
/** |
|
1411 |
Default constructor. |
|
1412 |
||
1413 |
Constructs an uninitialised object. |
|
1414 |
*/ |
|
1415 |
{} |
|
1416 |
||
1417 |
||
1418 |
||
1419 |
||
1420 |
inline TTimeIntervalMicroSeconds::TTimeIntervalMicroSeconds(const TInt64& aInterval) |
|
1421 |
: iInterval(aInterval) |
|
1422 |
/** |
|
1423 |
Constructs the object with the specified 64-bit interval value. |
|
1424 |
||
1425 |
@param aInterval The 64-bit interval value with which the object is to be |
|
1426 |
initialised. |
|
1427 |
*/ |
|
1428 |
{} |
|
1429 |
||
1430 |
||
1431 |
||
1432 |
||
1433 |
inline TTimeIntervalMicroSeconds& TTimeIntervalMicroSeconds::operator=(const TInt64& aInterval) |
|
1434 |
/** |
|
1435 |
Assigns a 64-bit integer value to this object. |
|
1436 |
||
1437 |
@param aInterval The 64-bit integer interval value to be assigned. |
|
1438 |
||
1439 |
@return A reference to this object. |
|
1440 |
*/ |
|
1441 |
{iInterval=aInterval;return(*this);} |
|
1442 |
||
1443 |
||
1444 |
||
1445 |
||
1446 |
inline TBool TTimeIntervalMicroSeconds::operator==(const TTimeIntervalMicroSeconds& aInterval) const |
|
1447 |
/** |
|
1448 |
Tests whether this TTimeIntervalMicroSeconds object is equal to the |
|
1449 |
specified TTimeIntervalMicroSeconds object. |
|
1450 |
||
1451 |
@param aInterval The time interval to be compared with this time interval. |
|
1452 |
||
1453 |
@return True if the two time intervals are equal. False otherwise. |
|
1454 |
*/ |
|
1455 |
{return(iInterval==aInterval.iInterval);} |
|
1456 |
||
1457 |
||
1458 |
||
1459 |
||
1460 |
inline TBool TTimeIntervalMicroSeconds::operator!=(const TTimeIntervalMicroSeconds& aInterval) const |
|
1461 |
/** |
|
1462 |
Tests whether this TTimeIntervalMicroSeconds object is not equal to the |
|
1463 |
specified TTimeIntervalMicroSeconds object. |
|
1464 |
||
1465 |
@param aInterval The time interval to be compared with this time interval. |
|
1466 |
||
1467 |
@return True if the two time intervals are not equal. False otherwise. |
|
1468 |
*/ |
|
1469 |
{return(iInterval!=aInterval.iInterval);} |
|
1470 |
||
1471 |
||
1472 |
||
1473 |
||
1474 |
inline TBool TTimeIntervalMicroSeconds::operator>=(const TTimeIntervalMicroSeconds& aInterval) const |
|
1475 |
/** |
|
1476 |
Tests whether this TTimeIntervalMicroSeconds object is greater than or equal to the |
|
1477 |
specified TTimeIntervalMicroSeconds object. |
|
1478 |
||
1479 |
@param aInterval The time interval to be compared with this time interval. |
|
1480 |
||
1481 |
@return True if this time interval is greater than or equal to the specified |
|
1482 |
time interval. False otherwise. |
|
1483 |
*/ |
|
1484 |
{return(iInterval>=aInterval.iInterval);} |
|
1485 |
||
1486 |
||
1487 |
||
1488 |
||
1489 |
inline TBool TTimeIntervalMicroSeconds::operator<=(const TTimeIntervalMicroSeconds& aInterval) const |
|
1490 |
/** |
|
1491 |
Tests whether this TTimeIntervalMicroSeconds object is less than or equal to the |
|
1492 |
specified TTimeIntervalMicroSeconds object. |
|
1493 |
||
1494 |
@param aInterval The time interval to be compared with this time interval. |
|
1495 |
||
1496 |
@return True if this time interval is less than or equal to the specified |
|
1497 |
time interval. False otherwise. |
|
1498 |
*/ |
|
1499 |
{return(iInterval<=aInterval.iInterval);} |
|
1500 |
||
1501 |
||
1502 |
||
1503 |
||
1504 |
inline TBool TTimeIntervalMicroSeconds::operator>(const TTimeIntervalMicroSeconds& aInterval) const |
|
1505 |
/** |
|
1506 |
Tests whether this TTimeIntervalMicroSeconds object is greater than the |
|
1507 |
specified TTimeIntervalMicroSeconds object. |
|
1508 |
||
1509 |
@param aInterval The time interval to be compared with this time interval. |
|
1510 |
||
1511 |
@return True if this time interval is greater than the specified |
|
1512 |
time interval. False otherwise. |
|
1513 |
*/ |
|
1514 |
{return(iInterval>aInterval.iInterval);} |
|
1515 |
||
1516 |
||
1517 |
||
1518 |
||
1519 |
inline TBool TTimeIntervalMicroSeconds::operator<(const TTimeIntervalMicroSeconds& aInterval) const |
|
1520 |
/** |
|
1521 |
Tests whether this TTimeIntervalMicroSeconds object is less than the |
|
1522 |
specified TTimeIntervalMicroSeconds object. |
|
1523 |
||
1524 |
@param aInterval The time interval to be compared with this time interval. |
|
1525 |
||
1526 |
@return True if this time interval is less than the specified |
|
1527 |
time interval. False otherwise. |
|
1528 |
*/ |
|
1529 |
{return(iInterval<aInterval.iInterval);} |
|
1530 |
||
1531 |
||
1532 |
||
1533 |
||
1534 |
inline const TInt64& TTimeIntervalMicroSeconds::Int64() const |
|
1535 |
/** |
|
1536 |
Gets the time interval as a 64-bit integer value. |
|
1537 |
||
1538 |
@return This 64-bit integer time interval value. |
|
1539 |
*/ |
|
1540 |
{return(iInterval);} |
|
1541 |
||
1542 |
||
1543 |
||
1544 |
||
1545 |
// Class TTimeIntervalBase |
|
1546 |
inline TTimeIntervalBase::TTimeIntervalBase() |
|
1547 |
/** |
|
1548 |
Default constructor. |
|
1549 |
*/ |
|
1550 |
{} |
|
1551 |
||
1552 |
||
1553 |
||
1554 |
||
1555 |
inline TTimeIntervalBase::TTimeIntervalBase(TInt aInterval) |
|
1556 |
: iInterval(aInterval) |
|
1557 |
/** |
|
1558 |
Constructor taking an interval value. |
|
1559 |
||
1560 |
@param aInterval The interval value. |
|
1561 |
*/ |
|
1562 |
{} |
|
1563 |
||
1564 |
||
1565 |
||
1566 |
||
1567 |
inline TBool TTimeIntervalBase::operator==(TTimeIntervalBase aInterval) const |
|
1568 |
/** |
|
1569 |
Tests whether this time interval is the same as the specified time interval. |
|
1570 |
||
1571 |
@param aInterval The time interval to be compared with this time interval. |
|
1572 |
||
1573 |
@return True if the two time intervals are equal. False otherwise. |
|
1574 |
*/ |
|
1575 |
{return(iInterval==aInterval.iInterval);} |
|
1576 |
||
1577 |
||
1578 |
||
1579 |
||
1580 |
inline TBool TTimeIntervalBase::operator!=(TTimeIntervalBase aInterval) const |
|
1581 |
/** |
|
1582 |
Tests whether this time interval is not the same as the specified |
|
1583 |
time interval. |
|
1584 |
||
1585 |
@param aInterval The time interval to be compared with this time interval. |
|
1586 |
||
1587 |
@return True if the two time intervals differ. False otherwise. |
|
1588 |
*/ |
|
1589 |
{return(iInterval!=aInterval.iInterval);} |
|
1590 |
||
1591 |
||
1592 |
||
1593 |
||
1594 |
inline TBool TTimeIntervalBase::operator>=(TTimeIntervalBase aInterval) const |
|
1595 |
/** |
|
1596 |
Tests whether this time interval is greater than or equal to the |
|
1597 |
specified time interval. |
|
1598 |
||
1599 |
@param aInterval The time interval to be compared with this time interval. |
|
1600 |
||
1601 |
@return True if this time interval is greater than or equal to the specified |
|
1602 |
time interval. False otherwise. |
|
1603 |
*/ |
|
1604 |
{return(iInterval>=aInterval.iInterval);} |
|
1605 |
||
1606 |
||
1607 |
||
1608 |
||
1609 |
inline TBool TTimeIntervalBase::operator<=(TTimeIntervalBase aInterval) const |
|
1610 |
/** |
|
1611 |
Tests whether this time interval is less than or equal to the |
|
1612 |
specified time interval. |
|
1613 |
||
1614 |
@param aInterval The time interval to be compared with this time interval. |
|
1615 |
||
1616 |
@return True if this time interval is less than or equal to the specified |
|
1617 |
time interval. False otherwise. |
|
1618 |
*/ |
|
1619 |
{return(iInterval<=aInterval.iInterval);} |
|
1620 |
||
1621 |
||
1622 |
||
1623 |
||
1624 |
inline TBool TTimeIntervalBase::operator>(TTimeIntervalBase aInterval) const |
|
1625 |
/** |
|
1626 |
Tests whether this time interval is greater than the specified time interval. |
|
1627 |
||
1628 |
@param aInterval The time interval to be compared with this time interval. |
|
1629 |
||
1630 |
@return True if this time interval is greater than the specified |
|
1631 |
time interval. False otherwise. |
|
1632 |
*/ |
|
1633 |
{return(iInterval>aInterval.iInterval);} |
|
1634 |
||
1635 |
||
1636 |
||
1637 |
||
1638 |
inline TBool TTimeIntervalBase::operator<(TTimeIntervalBase aInterval) const |
|
1639 |
/** |
|
1640 |
Tests whether this time interval is less than the specified time interval. |
|
1641 |
||
1642 |
@param aInterval The time interval to be compared with this time interval. |
|
1643 |
||
1644 |
@return True if this time interval is less than the specified |
|
1645 |
time interval. False otherwise. |
|
1646 |
*/ |
|
1647 |
{return(iInterval<aInterval.iInterval);} |
|
1648 |
||
1649 |
||
1650 |
||
1651 |
||
1652 |
inline TInt TTimeIntervalBase::Int() const |
|
1653 |
/** |
|
1654 |
Gets the time interval as a 32 bit integer. |
|
1655 |
||
1656 |
@return The time interval as a 32 bit integer. |
|
1657 |
*/ |
|
1658 |
{return(iInterval);} |
|
1659 |
||
1660 |
||
1661 |
||
1662 |
||
1663 |
// Class TTimeIntervalMicroSeconds32 |
|
1664 |
inline TTimeIntervalMicroSeconds32::TTimeIntervalMicroSeconds32() |
|
1665 |
/** |
|
1666 |
Default constructor. |
|
1667 |
||
1668 |
Constructs an uninitialised object. |
|
1669 |
*/ |
|
1670 |
{} |
|
1671 |
||
1672 |
||
1673 |
||
1674 |
||
1675 |
inline TTimeIntervalMicroSeconds32::TTimeIntervalMicroSeconds32(TInt aInterval) |
|
1676 |
: TTimeIntervalBase(aInterval) |
|
1677 |
/** |
|
1678 |
Constructs the object with the specified interval value. |
|
1679 |
||
1680 |
@param aInterval The interval value with which the object is to be initialised. |
|
1681 |
*/ |
|
1682 |
{} |
|
1683 |
||
1684 |
||
1685 |
||
1686 |
||
1687 |
inline TTimeIntervalMicroSeconds32& TTimeIntervalMicroSeconds32::operator=(TInt aInterval) |
|
1688 |
/** |
|
1689 |
Assigns a value to this object. |
|
1690 |
||
1691 |
@param aInterval The interval value to be assigned. |
|
1692 |
||
1693 |
@return A reference to this object. |
|
1694 |
*/ |
|
1695 |
{iInterval=aInterval;return(*this);} |
|
1696 |
||
1697 |
||
1698 |
||
1699 |
||
1700 |
// Class TTimeIntervalSeconds |
|
1701 |
inline TTimeIntervalSeconds::TTimeIntervalSeconds() |
|
1702 |
/** |
|
1703 |
Default constructor. |
|
1704 |
||
1705 |
Constructs an uninitialised object. |
|
1706 |
*/ |
|
1707 |
{} |
|
1708 |
||
1709 |
||
1710 |
||
1711 |
||
1712 |
inline TTimeIntervalSeconds::TTimeIntervalSeconds(TInt aInterval) |
|
1713 |
: TTimeIntervalBase(aInterval) |
|
1714 |
/** |
|
1715 |
Constructs the object with the specified interval value. |
|
1716 |
||
1717 |
@param aInterval The interval value with which the object is to be initialised. |
|
1718 |
*/ |
|
1719 |
{} |
|
1720 |
||
1721 |
||
1722 |
||
1723 |
||
1724 |
inline TTimeIntervalSeconds& TTimeIntervalSeconds::operator=(TInt aInterval) |
|
1725 |
/** |
|
1726 |
Assigns a value to this object. |
|
1727 |
||
1728 |
@param aInterval The interval value to be assigned. |
|
1729 |
||
1730 |
@return A reference to this object. |
|
1731 |
*/ |
|
1732 |
{iInterval=aInterval;return(*this);} |
|
1733 |
||
1734 |
||
1735 |
||
1736 |
||
1737 |
// Class TTimeIntervalMinutes |
|
1738 |
inline TTimeIntervalMinutes::TTimeIntervalMinutes() |
|
1739 |
/** |
|
1740 |
Default constructor. |
|
1741 |
||
1742 |
Constructs an uninitialised object. |
|
1743 |
*/ |
|
1744 |
{} |
|
1745 |
||
1746 |
||
1747 |
||
1748 |
||
1749 |
inline TTimeIntervalMinutes::TTimeIntervalMinutes(TInt aInterval) |
|
1750 |
: TTimeIntervalBase(aInterval) |
|
1751 |
/** |
|
1752 |
Constructs the object with the specified interval value. |
|
1753 |
||
1754 |
@param aInterval The interval value with which the object is to be initialised. |
|
1755 |
*/ |
|
1756 |
{} |
|
1757 |
||
1758 |
||
1759 |
||
1760 |
||
1761 |
inline TTimeIntervalMinutes& TTimeIntervalMinutes::operator=(TInt aInterval) |
|
1762 |
/** |
|
1763 |
Assigns a value to this object. |
|
1764 |
||
1765 |
@param aInterval The interval value to be assigned. |
|
1766 |
||
1767 |
@return A reference to this object. |
|
1768 |
*/ |
|
1769 |
{iInterval=aInterval;return(*this);} |
|
1770 |
||
1771 |
||
1772 |
||
1773 |
||
1774 |
// Class TTimeIntervalHours |
|
1775 |
inline TTimeIntervalHours::TTimeIntervalHours() |
|
1776 |
/** |
|
1777 |
Default constructor. |
|
1778 |
||
1779 |
Constructs an uninitialised object. |
|
1780 |
*/ |
|
1781 |
{} |
|
1782 |
inline TTimeIntervalHours::TTimeIntervalHours(TInt aInterval) |
|
1783 |
: TTimeIntervalBase(aInterval) |
|
1784 |
/** |
|
1785 |
Constructs the object with the specified interval value. |
|
1786 |
||
1787 |
@param aInterval The interval value with which the object is to be initialised. |
|
1788 |
*/ |
|
1789 |
{} |
|
1790 |
||
1791 |
||
1792 |
||
1793 |
||
1794 |
inline TTimeIntervalHours& TTimeIntervalHours::operator=(TInt aInterval) |
|
1795 |
/** |
|
1796 |
Assigns a value to this object. |
|
1797 |
||
1798 |
@param aInterval The interval value to be assigned. |
|
1799 |
||
1800 |
@return A reference to this object. |
|
1801 |
*/ |
|
1802 |
{iInterval=aInterval;return(*this);} |
|
1803 |
||
1804 |
||
1805 |
||
1806 |
||
1807 |
// Class TTimeIntervalDays |
|
1808 |
inline TTimeIntervalDays::TTimeIntervalDays() |
|
1809 |
/** |
|
1810 |
Default constructor. |
|
1811 |
||
1812 |
Constructs an uninitialised object. |
|
1813 |
*/ |
|
1814 |
{} |
|
1815 |
||
1816 |
||
1817 |
||
1818 |
||
1819 |
inline TTimeIntervalDays::TTimeIntervalDays(TInt aInterval) |
|
1820 |
: TTimeIntervalBase(aInterval) |
|
1821 |
/** |
|
1822 |
Constructs the object with the specified interval value. |
|
1823 |
||
1824 |
@param aInterval The interval value with which the object is to be initialised. |
|
1825 |
*/ |
|
1826 |
{} |
|
1827 |
||
1828 |
||
1829 |
||
1830 |
||
1831 |
inline TTimeIntervalDays& TTimeIntervalDays::operator=(TInt aInterval) |
|
1832 |
/** |
|
1833 |
Assigns a value to this object. |
|
1834 |
||
1835 |
@param aInterval The interval value to be assigned. |
|
1836 |
||
1837 |
@return A reference to this object. |
|
1838 |
*/ |
|
1839 |
{iInterval=aInterval;return(*this);} |
|
1840 |
||
1841 |
||
1842 |
||
1843 |
||
1844 |
// Class TTimeIntervalMonths |
|
1845 |
inline TTimeIntervalMonths::TTimeIntervalMonths() |
|
1846 |
/** |
|
1847 |
Default constructor. |
|
1848 |
||
1849 |
Constructs an uninitialised object. |
|
1850 |
*/ |
|
1851 |
{} |
|
1852 |
||
1853 |
||
1854 |
||
1855 |
||
1856 |
inline TTimeIntervalMonths::TTimeIntervalMonths(TInt aInterval) |
|
1857 |
: TTimeIntervalBase(aInterval) |
|
1858 |
/** |
|
1859 |
Constructs the object with the specified interval value. |
|
1860 |
||
1861 |
@param aInterval The interval value with which the object is to be initialised. |
|
1862 |
*/ |
|
1863 |
{} |
|
1864 |
||
1865 |
||
1866 |
||
1867 |
||
1868 |
inline TTimeIntervalMonths& TTimeIntervalMonths::operator=(TInt aInterval) |
|
1869 |
/** |
|
1870 |
Assigns a value to this object. |
|
1871 |
||
1872 |
@param aInterval The interval value to be assigned. |
|
1873 |
||
1874 |
@return A reference to this object. |
|
1875 |
*/ |
|
1876 |
{iInterval=aInterval;return(*this);} |
|
1877 |
||
1878 |
||
1879 |
||
1880 |
||
1881 |
// Class TTimeIntervalYears |
|
1882 |
inline TTimeIntervalYears::TTimeIntervalYears() |
|
1883 |
/** |
|
1884 |
Default constructor. |
|
1885 |
||
1886 |
Constructs an uninitialised object. |
|
1887 |
*/ |
|
1888 |
{} |
|
1889 |
||
1890 |
||
1891 |
||
1892 |
||
1893 |
inline TTimeIntervalYears::TTimeIntervalYears(TInt aInterval) |
|
1894 |
: TTimeIntervalBase(aInterval) |
|
1895 |
/** |
|
1896 |
Constructs the object with the specified interval value. |
|
1897 |
||
1898 |
@param aInterval The interval value with which the object is to be initialised. |
|
1899 |
*/ |
|
1900 |
{} |
|
1901 |
||
1902 |
||
1903 |
||
1904 |
||
1905 |
inline TTimeIntervalYears& TTimeIntervalYears::operator=(TInt aInterval) |
|
1906 |
/** |
|
1907 |
Assigns a value to this object. |
|
1908 |
||
1909 |
@param aInterval The interval value to be assigned. |
|
1910 |
||
1911 |
@return A reference to this object. |
|
1912 |
*/ |
|
1913 |
{iInterval=aInterval;return(*this);} |
|
1914 |
||
1915 |
||
1916 |
||
1917 |
||
1918 |
// Class TTime |
|
1919 |
inline TTime::TTime() |
|
1920 |
/** |
|
1921 |
Default constructor. |
|
1922 |
||
1923 |
The object is initialised to an arbitrary value. |
|
1924 |
*/ |
|
1925 |
{} |
|
1926 |
||
1927 |
||
1928 |
||
1929 |
||
1930 |
inline TTime::TTime(const TInt64& aTime) |
|
1931 |
: iTime(aTime) |
|
1932 |
/** |
|
1933 |
Constructs the object from a 64-bit microsecond value. |
|
1934 |
||
1935 |
@param aTime Microsecond value to which to initialise the TTime object. |
|
1936 |
*/ |
|
1937 |
{} |
|
1938 |
||
1939 |
||
1940 |
||
1941 |
||
1942 |
inline TTime &TTime::operator=(const TInt64& aTime) |
|
1943 |
/** |
|
1944 |
Assigns a value contained in a 64-bit integer to this TTime object. |
|
1945 |
||
1946 |
@param aTime Microsecond value which to assign to the TTime object. |
|
1947 |
||
1948 |
@return This TTime object. |
|
1949 |
*/ |
|
1950 |
{iTime=aTime;return(*this);} |
|
1951 |
||
1952 |
||
1953 |
||
1954 |
||
1955 |
inline TBool TTime::operator==(TTime aTime) const |
|
1956 |
/** |
|
1957 |
Tests whether two date/times are equal. |
|
1958 |
||
1959 |
@param aTime The time to be compared with this TTime. |
|
1960 |
||
1961 |
@return True if the two TTimes are equal. False if not. |
|
1962 |
*/ |
|
1963 |
{return(iTime==aTime.iTime);} |
|
1964 |
||
1965 |
||
1966 |
||
1967 |
||
1968 |
inline TBool TTime::operator!=(TTime aTime) const |
|
1969 |
/** |
|
1970 |
Tests whether two date/times are not equal. |
|
1971 |
||
1972 |
@param aTime The date/time to be compared with this TTime. |
|
1973 |
||
1974 |
@return True if the two TTimes are different. False if the same. |
|
1975 |
*/ |
|
1976 |
{return(iTime!=aTime.iTime);} |
|
1977 |
||
1978 |
||
1979 |
||
1980 |
||
1981 |
inline TBool TTime::operator>=(TTime aTime) const |
|
1982 |
/** |
|
1983 |
Tests whether this date/time is later than or the same as the |
|
1984 |
specified date/time. |
|
1985 |
||
1986 |
@param aTime The date/time to be compared with this date/time. |
|
1987 |
||
1988 |
@return True if this date/time is later than or the same as the |
|
1989 |
specified date/time. False otherwise. |
|
1990 |
*/ |
|
1991 |
{return(iTime>=aTime.iTime);} |
|
1992 |
||
1993 |
||
1994 |
||
1995 |
||
1996 |
inline TBool TTime::operator<=(TTime aTime) const |
|
1997 |
/** |
|
1998 |
Tests whether this date/time is earlier than or the same as the |
|
1999 |
specified date/time. |
|
2000 |
||
2001 |
@param aTime The date/time to be compared with this date/time. |
|
2002 |
||
2003 |
@return True if this date/time is earlier than or the same as the |
|
2004 |
specified date/time. False otherwise. |
|
2005 |
*/ |
|
2006 |
{return(iTime<=aTime.iTime);} |
|
2007 |
||
2008 |
||
2009 |
||
2010 |
||
2011 |
inline TBool TTime::operator>(TTime aTime) const |
|
2012 |
/** |
|
2013 |
Tests whether this date/time is later than the specified date/time. |
|
2014 |
||
2015 |
@param aTime The date/time to be compared with this date/time. |
|
2016 |
||
2017 |
@return True if this date/time is later than the specified date/time. |
|
2018 |
False otherwise. |
|
2019 |
*/ |
|
2020 |
{return(iTime>aTime.iTime);} |
|
2021 |
||
2022 |
||
2023 |
||
2024 |
||
2025 |
inline TBool TTime::operator<(TTime aTime) const |
|
2026 |
/** |
|
2027 |
Tests whether this date/time is earlier than the specified date/time. |
|
2028 |
||
2029 |
@param aTime The date/time to be compared with this date/time. |
|
2030 |
||
2031 |
@return True if this date/time is earlier than the specified date/time. |
|
2032 |
False otherwise. |
|
2033 |
*/ |
|
2034 |
{return(iTime<aTime.iTime);} |
|
2035 |
||
2036 |
||
2037 |
||
2038 |
||
2039 |
inline const TInt64& TTime::Int64() const |
|
2040 |
/** |
|
2041 |
Gets the 64 bit integer representation of this TTime obect. |
|
2042 |
||
2043 |
@return The 64 bit integer representation. |
|
2044 |
*/ |
|
2045 |
{return(iTime);} |
|
2046 |
||
2047 |
||
2048 |
||
2049 |
||
2050 |
// Class TLexMark8 |
|
2051 |
inline TLexMark8::TLexMark8() |
|
2052 |
: iPtr(NULL) |
|
2053 |
/** |
|
2054 |
Default constructor. |
|
2055 |
*/ |
|
2056 |
{} |
|
2057 |
||
2058 |
||
2059 |
||
2060 |
||
2061 |
inline TLexMark8::TLexMark8(const TUint8 *aString) |
|
2062 |
: iPtr(aString) |
|
2063 |
{} |
|
2064 |
||
2065 |
||
2066 |
||
2067 |
||
2068 |
// Class TLex8 |
|
2069 |
inline TLex8::TLex8(const TUint8 *aString) |
|
2070 |
/** |
|
2071 |
Constructs the object with a pointer to a string. |
|
2072 |
||
2073 |
The extraction mark and next character members are initialised to point |
|
2074 |
to the start of the string. |
|
2075 |
||
2076 |
@param aString String to be assigned. |
|
2077 |
*/ |
|
2078 |
{Assign(TPtrC8(aString));} |
|
2079 |
||
2080 |
||
2081 |
||
2082 |
||
2083 |
inline TLex8::TLex8(const TDesC8 &aDes) |
|
2084 |
/** |
|
2085 |
Constructs the object with a descriptor. |
|
2086 |
||
2087 |
The extraction mark and next character |
|
2088 |
members are initialised to point to the start of the string. |
|
2089 |
||
2090 |
@param aDes Descriptor to be assigned by reference. |
|
2091 |
*/ |
|
2092 |
{Assign(aDes);} |
|
2093 |
||
2094 |
||
2095 |
||
2096 |
||
2097 |
inline TLex8& TLex8::operator=(const TUint8* aString) |
|
2098 |
/** |
|
2099 |
Allows strings to be assigned to a TLex8. |
|
2100 |
||
2101 |
@param aString String to be assigned to the TLex8. |
|
2102 |
||
2103 |
@return TLex8 descriptor. |
|
2104 |
*/ |
|
2105 |
{Assign(TPtrC8(aString));return(*this);} |
|
2106 |
||
2107 |
||
2108 |
||
2109 |
||
2110 |
inline TLex8& TLex8::operator=(const TDesC8& aBuf) |
|
2111 |
/** |
|
2112 |
Allows descriptors to be assigned to a TLex8. |
|
2113 |
||
2114 |
@param aBuf Descriptor to be assigned to the TLex8. |
|
2115 |
||
2116 |
@return TLex8 descriptor. |
|
2117 |
*/ |
|
2118 |
{Assign(aBuf);return(*this);} |
|
2119 |
||
2120 |
||
2121 |
||
2122 |
||
2123 |
inline TBool TLex8::Eos() const |
|
2124 |
/** |
|
2125 |
Tests whether the next character position is at the end of the string. |
|
2126 |
||
2127 |
@return True if at end of string, false otherwise. |
|
2128 |
*/ |
|
2129 |
{return(iNext==iEnd);} |
|
2130 |
||
2131 |
||
2132 |
||
2133 |
||
2134 |
inline void TLex8::Mark() |
|
2135 |
/** |
|
2136 |
Sets the TLex8's next character position to its extraction mark. |
|
2137 |
*/ |
|
2138 |
{Mark(iMark);} |
|
2139 |
||
2140 |
||
2141 |
||
2142 |
||
2143 |
inline void TLex8::Mark(TLexMark8& aMark) const |
|
2144 |
/** |
|
2145 |
Sets the supplied extraction mark to the TLex8's next character position. |
|
2146 |
||
2147 |
@param aMark On return, this is set to the next character position. |
|
2148 |
*/ |
|
2149 |
{aMark.iPtr=iNext;} |
|
2150 |
||
2151 |
||
2152 |
||
2153 |
||
2154 |
inline void TLex8::UnGetToMark() |
|
2155 |
/** |
|
2156 |
Sets the next character position to the current extraction mark position. |
|
2157 |
||
2158 |
@panic USER 63, if the extraction mark is before the start or beyond the end |
|
2159 |
of the string. |
|
2160 |
*/ |
|
2161 |
{UnGetToMark(iMark);} |
|
2162 |
||
2163 |
||
2164 |
||
2165 |
||
2166 |
inline void TLex8::SkipAndMark(TInt aNumber) |
|
2167 |
/** |
|
2168 |
Moves the next character position a specified number of characters. |
|
2169 |
||
2170 |
@param aNumber Number of characters to skip. |
|
2171 |
||
2172 |
@panic USER 61, if the skip moves the next character position either to before |
|
2173 |
the start or beyond the end of the string. |
|
2174 |
*/ |
|
2175 |
{SkipAndMark(aNumber,iMark);} |
|
2176 |
||
2177 |
||
2178 |
||
2179 |
||
2180 |
inline void TLex8::SkipSpaceAndMark() |
|
2181 |
/** |
|
2182 |
Moves the next character position past any white space and copies it to the |
|
2183 |
TLex8's extraction mark. |
|
2184 |
||
2185 |
Stops if at the end of the string. |
|
2186 |
*/ |
|
2187 |
{SkipSpaceAndMark(iMark);} |
|
2188 |
||
2189 |
||
2190 |
||
2191 |
||
2192 |
inline TInt TLex8::TokenLength() const |
|
2193 |
/** |
|
2194 |
Gets the length of the token. |
|
2195 |
||
2196 |
This is the difference between the next character |
|
2197 |
position and the extraction mark. |
|
2198 |
||
2199 |
@return Length of the token. |
|
2200 |
*/ |
|
2201 |
{return(iNext-iMark.iPtr);} |
|
2202 |
||
2203 |
||
2204 |
||
2205 |
||
2206 |
inline TInt TLex8::MarkedOffset() const |
|
2207 |
/** |
|
2208 |
Gets the offset of the extraction mark from the start of the string. |
|
2209 |
||
2210 |
@return The offset of the extraction mark. |
|
2211 |
*/ |
|
2212 |
{return(iMark.iPtr-iBuf);} |
|
2213 |
||
2214 |
||
2215 |
||
2216 |
||
2217 |
inline TInt TLex8::Val(TInt &aVal) |
|
2218 |
/** |
|
2219 |
Parses the string to extract a signed integer. |
|
2220 |
||
2221 |
@param aVal On return, contains the extracted integer. |
|
2222 |
||
2223 |
@return KErrNone if successful. |
|
2224 |
KErrGeneral if the next character position is initially at the end of the string |
|
2225 |
or no valid characters found initially. |
|
2226 |
KErrOverflow if there is sign overflow, i.e. converted value greater than limit. |
|
2227 |
If error codes KErrGeneral or KErrOverflow are returned, the object's |
|
2228 |
members are left unaltered. |
|
2229 |
*/ |
|
2230 |
{return(Val((TInt32&)aVal));} |
|
2231 |
||
2232 |
||
2233 |
||
2234 |
||
2235 |
inline TInt TLex8::Val(TUint &aVal,TRadix aRadix) |
|
2236 |
/** |
|
2237 |
Parses the string to extract an unsigned integer, using the specified radix. |
|
2238 |
||
2239 |
@param aVal On return, contains the extracted integer. |
|
2240 |
@param aRadix The radix to use when converting the number. The default radix |
|
2241 |
for this function overload is decimal. |
|
2242 |
||
2243 |
@return KErrNone if successful. |
|
2244 |
KErrGeneral if the next character position is initially at the end of the string |
|
2245 |
or no valid characters found initially. |
|
2246 |
KErrOverflow if there is sign overflow, i.e. converted value greater than limit. |
|
2247 |
If error codes KErrGeneral or KErrOverflow are returned, the object's |
|
2248 |
members are left unaltered. |
|
2249 |
*/ |
|
2250 |
{return(Val((TUint32&)aVal,aRadix));} |
|
2251 |
||
2252 |
||
2253 |
||
2254 |
||
2255 |
inline void TLex8::Assign(const TLex8& aLex) |
|
2256 |
/** |
|
2257 |
Assigns a string to this object from another TLex8 object. |
|
2258 |
||
2259 |
@param aLex The object to be assigned. |
|
2260 |
*/ |
|
2261 |
{new(this) TLex8(aLex);} |
|
2262 |
||
2263 |
||
2264 |
||
2265 |
||
2266 |
// Class TLexMark16 |
|
2267 |
inline TLexMark16::TLexMark16() |
|
2268 |
: iPtr(NULL) |
|
2269 |
/** |
|
2270 |
Default constructor. |
|
2271 |
*/ |
|
2272 |
{} |
|
2273 |
||
2274 |
||
2275 |
||
2276 |
||
2277 |
inline TLexMark16::TLexMark16(const TUint16 *aString) |
|
2278 |
: iPtr(aString) |
|
2279 |
{} |
|
2280 |
||
2281 |
||
2282 |
||
2283 |
||
2284 |
// Class TLex16 |
|
2285 |
inline TLex16::TLex16(const TUint16 *aString) |
|
2286 |
/** |
|
2287 |
Constructs the object with a pointer to a string. |
|
2288 |
||
2289 |
The extraction mark and next character members are initialised to point |
|
2290 |
to the start of the string. |
|
2291 |
||
2292 |
@param aString String to be assigned. |
|
2293 |
*/ |
|
2294 |
{Assign(TPtrC16(aString));} |
|
2295 |
||
2296 |
||
2297 |
||
2298 |
||
2299 |
inline TLex16::TLex16(const TDesC16 &aDes) |
|
2300 |
/** |
|
2301 |
Constructs the object with a descriptor. |
|
2302 |
||
2303 |
The extraction mark and next character |
|
2304 |
members are initialised to point to the start of the string. |
|
2305 |
||
2306 |
@param aDes Descriptor to be assigned by reference. |
|
2307 |
*/ |
|
2308 |
{Assign(aDes);} |
|
2309 |
||
2310 |
||
2311 |
||
2312 |
inline TLex16& TLex16::operator=(const TUint16* aString) |
|
2313 |
/** |
|
2314 |
Allows strings to be assigned to a TLex16. |
|
2315 |
||
2316 |
@param aString String to be assigned to the TLex16. |
|
2317 |
||
2318 |
@return TLex16 descriptor. |
|
2319 |
*/ |
|
2320 |
{Assign(TPtrC16(aString));return(*this);} |
|
2321 |
||
2322 |
||
2323 |
||
2324 |
||
2325 |
inline TLex16& TLex16::operator=(const TDesC16& aBuf) |
|
2326 |
/** |
|
2327 |
Allows descriptors to be assigned to a TLex16. |
|
2328 |
||
2329 |
@param aBuf Descriptor to be assigned to the TLex16. |
|
2330 |
||
2331 |
@return TLex8 descriptor. |
|
2332 |
*/ |
|
2333 |
{Assign(aBuf);return(*this);} |
|
2334 |
||
2335 |
||
2336 |
||
2337 |
||
2338 |
inline TBool TLex16::Eos() const |
|
2339 |
/** |
|
2340 |
Tests whether the next character position is at the end of the string. |
|
2341 |
||
2342 |
@return True if at end of string, false otherwise. |
|
2343 |
*/ |
|
2344 |
{return(iNext==iEnd);} |
|
2345 |
||
2346 |
||
2347 |
||
2348 |
||
2349 |
inline void TLex16::Mark(TLexMark16& aMark) const |
|
2350 |
/** |
|
2351 |
Sets the supplied extraction mark to the TLex16's next character position. |
|
2352 |
||
2353 |
@param aMark On return, set to the next character position. |
|
2354 |
*/ |
|
2355 |
{aMark.iPtr=iNext;} |
|
2356 |
||
2357 |
||
2358 |
||
2359 |
||
2360 |
inline void TLex16::Mark() |
|
2361 |
/** |
|
2362 |
Sets the TLex16's next character position to its extraction mark. |
|
2363 |
*/ |
|
2364 |
{iMark.iPtr=iNext;} |
|
2365 |
||
2366 |
||
2367 |
||
2368 |
||
2369 |
inline void TLex16::UnGetToMark() |
|
2370 |
/** |
|
2371 |
Sets the next character position to the current extraction mark position. |
|
2372 |
||
2373 |
@panic USER 68, if the specified mark is before the start or beyond the end |
|
2374 |
of the string. |
|
2375 |
*/ |
|
2376 |
{UnGetToMark(iMark);} |
|
2377 |
||
2378 |
||
2379 |
||
2380 |
||
2381 |
inline void TLex16::SkipAndMark(TInt aNumber) |
|
2382 |
/** |
|
2383 |
Moves the next character position a specified number of characters. |
|
2384 |
||
2385 |
@param aNumber Number of characters to skip. |
|
2386 |
||
2387 |
@panic USER 68, if the skip moves the next character position either to before |
|
2388 |
the start or beyond the end of the string. |
|
2389 |
*/ |
|
2390 |
{SkipAndMark(aNumber,iMark);} |
|
2391 |
||
2392 |
||
2393 |
||
2394 |
||
2395 |
inline void TLex16::SkipSpaceAndMark() |
|
2396 |
/** |
|
2397 |
Moves the next character position past any white space and copies it to the |
|
2398 |
TLex16's extraction mark. |
|
2399 |
||
2400 |
Stops if at the end of the string. |
|
2401 |
*/ |
|
2402 |
{SkipSpaceAndMark(iMark);} |
|
2403 |
||
2404 |
||
2405 |
||
2406 |
||
2407 |
inline TInt TLex16::TokenLength() const |
|
2408 |
/** |
|
2409 |
Gets the length of the token. |
|
2410 |
||
2411 |
This is the difference between the next character |
|
2412 |
position and the extraction mark. |
|
2413 |
||
2414 |
@return Length of the token. |
|
2415 |
*/ |
|
2416 |
{return(iNext-iMark.iPtr);} |
|
2417 |
||
2418 |
||
2419 |
||
2420 |
||
2421 |
inline TInt TLex16::MarkedOffset() const |
|
2422 |
/** |
|
2423 |
Gets the offset of the extraction mark from the start of the string. |
|
2424 |
||
2425 |
@return The offset of the extraction mark. |
|
2426 |
*/ |
|
2427 |
{return(iMark.iPtr-iBuf);} |
|
2428 |
||
2429 |
||
2430 |
||
2431 |
||
2432 |
inline TInt TLex16::Val(TInt &aVal) |
|
2433 |
/** |
|
2434 |
Parses the string to extract a signed integer. |
|
2435 |
||
2436 |
@param aVal On return, contains the extracted integer. |
|
2437 |
||
2438 |
@return KErrNone if successful. |
|
2439 |
KErrGeneral if the next character position is initially at the end of the string |
|
2440 |
or no valid characters found initially. |
|
2441 |
KErrOverflow if there is sign overflow, i.e. converted value greater than limit. |
|
2442 |
If error codes KErrGeneral or KErrOverflow are returned, the object's |
|
2443 |
members are left unaltered. |
|
2444 |
*/ |
|
2445 |
{return(Val((TInt32&)aVal));} |
|
2446 |
||
2447 |
||
2448 |
||
2449 |
||
2450 |
inline TInt TLex16::Val(TUint &aVal,TRadix aRadix) |
|
2451 |
/** |
|
2452 |
Parses the string to extract an unsigned integer, using the specified radix. |
|
2453 |
||
2454 |
@param aVal On return, contains the extracted integer. |
|
2455 |
@param aRadix The radix to use when converting the number. The default radix |
|
2456 |
for this function overload is decimal. |
|
2457 |
||
2458 |
@return KErrNone if successful. |
|
2459 |
KErrGeneral if the next character position is initially at the end of the string |
|
2460 |
or no valid characters found initially. |
|
2461 |
KErrOverflow if there is sign overflow, i.e. converted value greater than limit. |
|
2462 |
If error codes KErrGeneral or KErrOverflow are returned, the object's |
|
2463 |
members are left unaltered. |
|
2464 |
*/ |
|
2465 |
{return(Val((TUint32&)aVal,aRadix));} |
|
2466 |
||
2467 |
||
2468 |
||
2469 |
||
2470 |
inline void TLex16::Assign(const TLex16& aLex) |
|
2471 |
/** |
|
2472 |
Assigns a string to this object from another TLex16 object. |
|
2473 |
||
2474 |
@param aLex The object to be assigned. |
|
2475 |
*/ |
|
2476 |
{new(this) TLex16(aLex);} |
|
2477 |
||
2478 |
||
2479 |
||
2480 |
||
2481 |
// Class TLocale |
|
2482 |
inline TLocale::TLocale(TInt) |
|
2483 |
{} |
|
2484 |
||
2485 |
inline TInt TLocale::RegionCode() const |
|
2486 |
{return(iRegionCode);} |
|
2487 |
inline TInt TLocale::CountryCode() const |
|
2488 |
/** |
|
2489 |
Gets the code which is used to select country-specific locale data. |
|
2490 |
||
2491 |
The country code is the code used as the international dialling prefix. |
|
2492 |
This code is also used to identify a country by the dialling software. |
|
2493 |
||
2494 |
@return The country code. |
|
2495 |
*/ |
|
2496 |
{return(iCountryCode);} |
|
2497 |
||
2498 |
||
2499 |
||
2500 |
||
2501 |
inline void TLocale::SetCountryCode(TInt aCode) |
|
2502 |
/** |
|
2503 |
Sets the value which is used to select country-specific locale data. |
|
2504 |
||
2505 |
This value can be retrieved by using TLocale::CountryCode(). The country code |
|
2506 |
is the code used as the international dialling prefix. This code is also used |
|
2507 |
to identify a country by the dialling software. |
|
2508 |
||
2509 |
@param aCode The country code. |
|
2510 |
||
2511 |
@see TLocale::CountryCode |
|
2512 |
*/ |
|
2513 |
{iCountryCode=aCode;} |
|
2514 |
||
2515 |
||
2516 |
||
2517 |
||
2518 |
inline TTimeIntervalSeconds TLocale::UniversalTimeOffset() const |
|
2519 |
/** |
|
2520 |
Gets the locale's universal time offset. |
|
2521 |
||
2522 |
@return Offset in seconds from universal time. Time zones east of universal |
|
2523 |
time have positive offsets. Time zones west of universal time have negative |
|
2524 |
offsets. |
|
2525 |
||
2526 |
@deprecated Use User::UTCOffset to get the current offset inclusive of daylight |
|
2527 |
savings time. This function returns the same value, for compatibility. |
|
2528 |
*/ |
|
2529 |
{return(iUniversalTimeOffset);} |
|
2530 |
||
2531 |
||
2532 |
||
2533 |
||
2534 |
inline TDateFormat TLocale::DateFormat() const |
|
2535 |
/** |
|
2536 |
Gets the date format. |
|
2537 |
||
2538 |
@return The date format. |
|
2539 |
*/ |
|
2540 |
{return(iDateFormat);} |
|
2541 |
||
2542 |
||
2543 |
||
2544 |
||
2545 |
inline void TLocale::SetDateFormat(TDateFormat aFormat) |
|
2546 |
/** |
|
2547 |
Sets the date format. |
|
2548 |
||
2549 |
@param aFormat The date format to be used. |
|
2550 |
*/ |
|
2551 |
{iDateFormat=aFormat;} |
|
2552 |
||
2553 |
||
2554 |
||
2555 |
||
2556 |
inline TTimeFormat TLocale::TimeFormat() const |
|
2557 |
/** |
|
2558 |
Gets the time format (12 or 24 hour). |
|
2559 |
||
2560 |
@return The time format. |
|
2561 |
*/ |
|
2562 |
{return(iTimeFormat);} |
|
2563 |
||
2564 |
||
2565 |
||
2566 |
||
2567 |
inline void TLocale::SetTimeFormat(TTimeFormat aFormat) |
|
2568 |
/** |
|
2569 |
Sets the time format (12 or 24 hour). |
|
2570 |
||
2571 |
@param aFormat The time format. |
|
2572 |
*/ |
|
2573 |
{iTimeFormat=aFormat;} |
|
2574 |
||
2575 |
||
2576 |
||
2577 |
||
2578 |
inline TLocalePos TLocale::CurrencySymbolPosition() const |
|
2579 |
/** |
|
2580 |
Gets the currency symbol position. |
|
2581 |
||
2582 |
For negative currency values, this position may be |
|
2583 |
reversed using SetNegativeCurrencySymbolOpposite(). |
|
2584 |
||
2585 |
@return The currency symbol position. |
|
2586 |
||
2587 |
@see TLocale::SetNegativeCurrencySymbolOpposite |
|
2588 |
*/ |
|
2589 |
{return(iCurrencySymbolPosition);} |
|
2590 |
||
2591 |
||
2592 |
||
2593 |
||
2594 |
inline void TLocale::SetCurrencySymbolPosition(TLocalePos aPos) |
|
2595 |
/** |
|
2596 |
Sets the currency symbol position. |
|
2597 |
||
2598 |
@param aPos The currency symbol position. |
|
2599 |
*/ |
|
2600 |
{iCurrencySymbolPosition=aPos;} |
|
2601 |
||
2602 |
||
2603 |
||
2604 |
||
2605 |
inline TBool TLocale::CurrencySpaceBetween() const |
|
2606 |
/** |
|
2607 |
Gets whether or not a space is inserted between the currency symbol and the |
|
2608 |
currency value. |
|
2609 |
||
2610 |
For negative currency values, the space can be removed using SetNegativeLoseSpace(). |
|
2611 |
||
2612 |
@return True if a space is inserted; false if not. |
|
2613 |
||
2614 |
@see TLocale::SetNegativeLoseSpace |
|
2615 |
*/ |
|
2616 |
{return(iCurrencySpaceBetween);} |
|
2617 |
||
2618 |
||
2619 |
||
2620 |
||
2621 |
inline void TLocale::SetCurrencySpaceBetween(TBool aSpace) |
|
2622 |
/** |
|
2623 |
Sets whether a space is inserted between the currency symbol and the currency |
|
2624 |
amount. |
|
2625 |
||
2626 |
@param aSpace ETrue if a space is inserted; EFalse if not. |
|
2627 |
*/ |
|
2628 |
{iCurrencySpaceBetween=aSpace;} |
|
2629 |
||
2630 |
||
2631 |
||
2632 |
||
2633 |
inline TInt TLocale::CurrencyDecimalPlaces() const |
|
2634 |
/** |
|
2635 |
Gets the number of decimal places to which currency values are set. |
|
2636 |
||
2637 |
@return The number of decimal places. |
|
2638 |
*/ |
|
2639 |
{return(iCurrencyDecimalPlaces);} |
|
2640 |
||
2641 |
||
2642 |
||
2643 |
||
2644 |
inline void TLocale::SetCurrencyDecimalPlaces(TInt aPlaces) |
|
2645 |
/** |
|
2646 |
Sets the number of decimal places to which currency values should be set. |
|
2647 |
||
2648 |
@param aPlaces The number of decimal places. |
|
2649 |
*/ |
|
2650 |
{iCurrencyDecimalPlaces=aPlaces;} |
|
2651 |
||
2652 |
||
2653 |
||
2654 |
||
2655 |
inline TBool TLocale::CurrencyNegativeInBrackets() const |
|
2656 |
/** |
|
2657 |
@deprecated |
|
2658 |
||
2659 |
Gets whether negative currency values are enclosed in brackets rather than |
|
2660 |
being preceded by a minus sign. |
|
2661 |
||
2662 |
This is deprecated, use NegativeCurrencyFormat() instead. |
|
2663 |
||
2664 |
@return True if negative currency is enclosed in brackets and has no minus |
|
2665 |
sign; false if negative currency has a minus sign and is not enclosed |
|
2666 |
in brackets. |
|
2667 |
||
2668 |
@see TLocale::NegativeCurrencyFormat |
|
2669 |
*/ |
|
2670 |
{return((TBool)iNegativeCurrencyFormat);} |
|
2671 |
||
2672 |
||
2673 |
||
2674 |
||
2675 |
inline void TLocale::SetCurrencyNegativeInBrackets(TBool aBool) |
|
2676 |
/** |
|
2677 |
@deprecated |
|
2678 |
||
2679 |
Sets whether negative currency values are enclosed in brackets rather than |
|
2680 |
being preceded by a minus sign. |
|
2681 |
||
2682 |
This is deprecated, use SetNegativeCurrencyFormat() instead. |
|
2683 |
||
2684 |
@param aBool ETrue, if a negative currency value must be enclosed in brackets |
|
2685 |
without a minus sign; EFalse, if a negative currency value is |
|
2686 |
preceded by a minus sign without any enclosing brackets. |
|
2687 |
||
2688 |
@see TLocale::SetNegativeCurrencyFormat |
|
2689 |
*/ |
|
2690 |
{iNegativeCurrencyFormat=(aBool)?EInBrackets:ELeadingMinusSign;} |
|
2691 |
||
2692 |
||
2693 |
||
2694 |
||
2695 |
inline TBool TLocale::CurrencyTriadsAllowed() const |
|
2696 |
/** |
|
2697 |
Gets whether triads are allowed in currency values. Triads are groups of |
|
2698 |
three digits separated by the thousands separator. |
|
2699 |
||
2700 |
@return True if triads are allowed; false if not. |
|
2701 |
*/ |
|
2702 |
{return(iCurrencyTriadsAllowed);} |
|
2703 |
||
2704 |
||
2705 |
||
2706 |
||
2707 |
inline void TLocale::SetCurrencyTriadsAllowed(TBool aBool) |
|
2708 |
/** |
|
2709 |
Sets whether triads are allowed in currency values. |
|
2710 |
||
2711 |
@param aBool ETrue if triads are allowed; EFalse if triads not allowed. |
|
2712 |
*/ |
|
2713 |
{iCurrencyTriadsAllowed=aBool;} |
|
2714 |
||
2715 |
||
2716 |
||
2717 |
||
2718 |
inline TChar TLocale::ThousandsSeparator() const |
|
2719 |
/** |
|
2720 |
Gets the character used to separate groups of three digits to the left of |
|
2721 |
the decimal separator. |
|
2722 |
||
2723 |
A thousands separator character is only displayed in currency values if currency |
|
2724 |
triads are allowed. |
|
2725 |
||
2726 |
@return The character used as the thousands separator. |
|
2727 |
*/ |
|
2728 |
{return(iThousandsSeparator);} |
|
2729 |
||
2730 |
||
2731 |
||
2732 |
||
2733 |
inline void TLocale::SetThousandsSeparator(const TChar& aChar) |
|
2734 |
/** |
|
2735 |
Sets the character to be used to separate groups of three digits to the left |
|
2736 |
of the decimal separator. |
|
2737 |
||
2738 |
A thousands separator character is only displayed in currency values if currency |
|
2739 |
triads are allowed. |
|
2740 |
||
2741 |
@param aChar The character to be used as the thousands separator. |
|
2742 |
*/ |
|
2743 |
{iThousandsSeparator=aChar;} |
|
2744 |
||
2745 |
||
2746 |
||
2747 |
||
2748 |
inline TChar TLocale::DecimalSeparator() const |
|
2749 |
/** |
|
2750 |
Gets the character used to separate a whole number from its fractional part. |
|
2751 |
||
2752 |
@return The character used as the decimal separator. |
|
2753 |
*/ |
|
2754 |
{return(iDecimalSeparator);} |
|
2755 |
||
2756 |
||
2757 |
||
2758 |
||
2759 |
inline void TLocale::SetDecimalSeparator(const TChar& aChar) |
|
2760 |
/** |
|
2761 |
Sets the character to be used to separate a whole number from its fractional |
|
2762 |
part. |
|
2763 |
||
2764 |
@param aChar The character to be used as the decimal separator. |
|
2765 |
*/ |
|
2766 |
{iDecimalSeparator=aChar;} |
|
2767 |
||
2768 |
||
2769 |
||
2770 |
||
2771 |
inline TChar TLocale::DateSeparator(TInt aIndex) const |
|
2772 |
/** |
|
2773 |
Gets one of the four characters used to separate the day, month and year |
|
2774 |
components of the date. |
|
2775 |
||
2776 |
If the four separators are represented by S0, S1, S2 and S3 and the three |
|
2777 |
date components are represented by XX, YY and ZZ, then the separators are |
|
2778 |
located: S0 XX S1 YY S2 ZZ S3. |
|
2779 |
||
2780 |
@param aIndex An index indicating which of the four separators is being accessed. |
|
2781 |
This must be a value between zero and three inclusive. |
|
2782 |
||
2783 |
@return A date separator character as determined by the value of aIndex. |
|
2784 |
*/ |
|
2785 |
{return(iDateSeparator[aIndex]);} |
|
2786 |
||
2787 |
||
2788 |
||
2789 |
||
2790 |
inline void TLocale::SetDateSeparator(const TChar& aChar,TInt aIndex) |
|
2791 |
/** |
|
2792 |
Sets one of the four characters used to separate the day, month and year |
|
2793 |
components of the date. |
|
2794 |
||
2795 |
If the four separators are represented by S0, S1, S2 and S3 and the three |
|
2796 |
date components are represented by XX, YY and ZZ, then the separators are |
|
2797 |
located: S0 XX S1 YY S2 ZZ S3. |
|
2798 |
||
2799 |
@param aChar A date separator character to be used. |
|
2800 |
@param aIndex An index indicating which of the four separators is being accessed. |
|
2801 |
This must be a value between zero and three inclusive. |
|
2802 |
*/ |
|
2803 |
{__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxDateSeparators,User::Invariant()); |
|
2804 |
iDateSeparator[aIndex]=aChar;} |
|
2805 |
||
2806 |
||
2807 |
||
2808 |
||
2809 |
inline TChar TLocale::TimeSeparator(TInt aIndex) const |
|
2810 |
/** |
|
2811 |
Gets one of the four characters used to separate the hour, second and minute |
|
2812 |
components of the time. |
|
2813 |
||
2814 |
If the four separators are represented by S0, S1, S2 and S3 and the three |
|
2815 |
time components are represented by XX, YY and ZZ, then the separators are |
|
2816 |
located: S0 XX S1 YY S2 ZZ S3. |
|
2817 |
||
2818 |
@param aIndex An index indicating which of the four separators is being |
|
2819 |
accessed. This must be a value between zero and three inclusive. |
|
2820 |
||
2821 |
@return A time separator character as determined by the value of aIndex. |
|
2822 |
*/ |
|
2823 |
||
2824 |
{return(iTimeSeparator[aIndex]);} |
|
2825 |
||
2826 |
||
2827 |
||
2828 |
||
2829 |
inline void TLocale::SetTimeSeparator(const TChar& aChar,TInt aIndex) |
|
2830 |
/** |
|
2831 |
Sets one of the four characters used to separate the hour, minute and second |
|
2832 |
components of the date. |
|
2833 |
||
2834 |
If the four separators are represented by S0, S1, S2 and S3 and the three |
|
2835 |
time components are represented by XX, YY and ZZ, then the separators are |
|
2836 |
located: S0 XX S1 YY S2 ZZ S3. |
|
2837 |
||
2838 |
@param aChar A time separator character to be used. |
|
2839 |
@param aIndex An index indicating which of the four separators is being accessed. |
|
2840 |
This must be a value between zero and three inclusive. |
|
2841 |
*/ |
|
2842 |
{__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxTimeSeparators,User::Invariant()); |
|
2843 |
iTimeSeparator[aIndex]=aChar;} |
|
2844 |
||
2845 |
||
2846 |
||
2847 |
||
2848 |
inline TLocalePos TLocale::AmPmSymbolPosition() const |
|
2849 |
/** |
|
2850 |
Gets the am/pm text position (before or after the time value). |
|
2851 |
||
2852 |
@return The am/pm text position (0 before, 1 after). |
|
2853 |
*/ |
|
2854 |
{return(iAmPmSymbolPosition);} |
|
2855 |
||
2856 |
||
2857 |
||
2858 |
||
2859 |
inline void TLocale::SetAmPmSymbolPosition(TLocalePos aPos) |
|
2860 |
/** |
|
2861 |
Sets the am/pm text position (before or after the time value). |
|
2862 |
||
2863 |
@param aSpace The am/pm text position (0 before, 1 after). |
|
2864 |
*/ |
|
2865 |
{iAmPmSymbolPosition=aPos;} |
|
2866 |
||
2867 |
||
2868 |
||
2869 |
||
2870 |
inline TBool TLocale::AmPmSpaceBetween() const |
|
2871 |
/** |
|
2872 |
Tests whether or not a space is inserted between the time and the preceding |
|
2873 |
or trailing am/pm text. |
|
2874 |
||
2875 |
@return True if a space is inserted between the time and am/pm text; false |
|
2876 |
if not. |
|
2877 |
*/ |
|
2878 |
{return(iAmPmSpaceBetween);} |
|
2879 |
||
2880 |
||
2881 |
||
2882 |
||
2883 |
inline void TLocale::SetAmPmSpaceBetween(TBool aSpace) |
|
2884 |
/** |
|
2885 |
Sets whether a space is inserted between the time and the preceding or trailing |
|
2886 |
am/pm text. |
|
2887 |
||
2888 |
@param aPos ETrue if a space is inserted between the time and am/pm text; |
|
2889 |
EFalse otherwise. |
|
2890 |
*/ |
|
2891 |
{iAmPmSpaceBetween=aSpace;} |
|
2892 |
||
2893 |
||
2894 |
||
2895 |
||
2896 |
inline TUint TLocale::DaylightSaving() const |
|
2897 |
/** |
|
2898 |
Gets the zones in which daylight saving is in effect. |
|
2899 |
||
2900 |
If daylight saving is in effect, one hour is added to the time. |
|
2901 |
||
2902 |
Use TLocale::QueryHomeHasDaylightSavingOn() to find out whether daylight saving |
|
2903 |
is in effect for the home city. This is because the daylight saving setting |
|
2904 |
for the home city may differ from that of the zone in which home is located. |
|
2905 |
||
2906 |
@return A bit mask in which the three least significant bits are defined, |
|
2907 |
indicating which of the three daylight saving zones are adjusted for |
|
2908 |
daylight saving. These bits represent: |
|
2909 |
Northern (non-European countries in the northern hemisphere), |
|
2910 |
Southern (southern hemisphere), |
|
2911 |
and European. |
|
2912 |
||
2913 |
@see TLocale::QueryHomeHasDaylightSavingOn |
|
2914 |
@see TDaylightSavingZone |
|
2915 |
||
2916 |
@deprecated Use the timezone server to retrieve information on timezones and DST. |
|
2917 |
This method will always indicate that DST is inactive, in order to |
|
2918 |
preserve compatibility. |
|
2919 |
*/ |
|
2920 |
{return(iDaylightSaving);} |
|
2921 |
||
2922 |
||
2923 |
||
2924 |
||
2925 |
inline TBool TLocale::QueryHomeHasDaylightSavingOn() const |
|
2926 |
/** |
|
2927 |
Tests whether or not daylight saving is set for the home city. |
|
2928 |
||
2929 |
@return True if home daylight saving is set; false if not. |
|
2930 |
||
2931 |
@deprecated Use the timezone server to retrieve information on timezones and DST. |
|
2932 |
This method will always indicate that DST is inactive, in order to |
|
2933 |
preserve compatibility. |
|
2934 |
*/ |
|
2935 |
{return((iHomeDaylightSavingZone|EDstHome) & iDaylightSaving);} |
|
2936 |
||
2937 |
||
2938 |
||
2939 |
||
2940 |
inline TDaylightSavingZone TLocale::HomeDaylightSavingZone() const |
|
2941 |
/** |
|
2942 |
Gets the daylight saving zone in which the home city is located. |
|
2943 |
||
2944 |
@return The daylight saving zone in which the home city is located. |
|
2945 |
||
2946 |
@deprecated Use the timezone server to retrieve information on timezones and DST. |
|
2947 |
*/ |
|
2948 |
{return(iHomeDaylightSavingZone);} |
|
2949 |
||
2950 |
||
2951 |
||
2952 |
||
2953 |
inline TUint TLocale::WorkDays() const |
|
2954 |
/** |
|
2955 |
Gets a bit mask representing the days of the week which are considered as |
|
2956 |
working days. |
|
2957 |
||
2958 |
@return A bit mask of seven bits indicating (by being set) which days are |
|
2959 |
workdays. The least significant bit corresponds to Monday, the next bit to |
|
2960 |
Tuesday and so on. |
|
2961 |
*/ |
|
2962 |
{return(iWorkDays);} |
|
2963 |
||
2964 |
||
2965 |
||
2966 |
||
2967 |
inline void TLocale::SetWorkDays(TUint aMask) |
|
2968 |
/** |
|
2969 |
Sets the days of the week which are considered as working days. |
|
2970 |
||
2971 |
@param aMask A bit mask of seven bits indicating (by being set) which days |
|
2972 |
are workdays. The least significant bit corresponds to Monday, the |
|
2973 |
next bit is Tuesday and so on. |
|
2974 |
*/ |
|
2975 |
{iWorkDays=aMask;} |
|
2976 |
||
2977 |
||
2978 |
||
2979 |
||
2980 |
inline TDay TLocale::StartOfWeek() const |
|
2981 |
/** |
|
2982 |
Gets the day which is considered the first day of the week. |
|
2983 |
||
2984 |
@return The first day of the week. |
|
2985 |
*/ |
|
2986 |
{return(iStartOfWeek);} |
|
2987 |
||
2988 |
||
2989 |
||
2990 |
||
2991 |
inline void TLocale::SetStartOfWeek(TDay aDay) |
|
2992 |
/** |
|
2993 |
Sets the day which is considered to be the first day of the week. |
|
2994 |
||
2995 |
@param aDay The first day of the week. |
|
2996 |
*/ |
|
2997 |
{iStartOfWeek=aDay;} |
|
2998 |
||
2999 |
||
3000 |
||
3001 |
||
3002 |
inline TClockFormat TLocale::ClockFormat() const |
|
3003 |
/** |
|
3004 |
Gets the clock display format. |
|
3005 |
||
3006 |
@return The clock display format. |
|
3007 |
*/ |
|
3008 |
{return(iClockFormat);} |
|
3009 |
||
3010 |
||
3011 |
||
3012 |
||
3013 |
inline void TLocale::SetClockFormat(TClockFormat aFormat) |
|
3014 |
/** |
|
3015 |
Sets the clock display format. |
|
3016 |
||
3017 |
@param aFormat The clock display format. |
|
3018 |
*/ |
|
3019 |
{iClockFormat=aFormat;} |
|
3020 |
||
3021 |
||
3022 |
||
3023 |
||
3024 |
inline TUnitsFormat TLocale::UnitsGeneral() const |
|
3025 |
/** |
|
3026 |
Gets the general units of measurement. |
|
3027 |
||
3028 |
This function should be used when both short and long distances use the |
|
3029 |
same units of measurement. |
|
3030 |
||
3031 |
@return General units of measurement. |
|
3032 |
*/ |
|
3033 |
{return(iUnitsGeneral);} |
|
3034 |
||
3035 |
||
3036 |
||
3037 |
||
3038 |
inline void TLocale::SetUnitsGeneral(TUnitsFormat aFormat) |
|
3039 |
/** |
|
3040 |
Sets the general units of measurement. |
|
3041 |
This function should be used when both short and long distances use the |
|
3042 |
same units of measurement. |
|
3043 |
||
3044 |
@param aFormat General units of measurement. |
|
3045 |
*/ |
|
3046 |
{iUnitsGeneral=aFormat;} |
|
3047 |
||
3048 |
||
3049 |
||
3050 |
||
3051 |
inline TUnitsFormat TLocale::UnitsDistanceShort() const |
|
3052 |
/** |
|
3053 |
Gets the units of measurement for short distances. |
|
3054 |
||
3055 |
Short distances are those which would normally be represented by either |
|
3056 |
metres and centimetres or feet and inches. |
|
3057 |
||
3058 |
@return Units of measurement for short distances. |
|
3059 |
*/ |
|
3060 |
{return(iUnitsDistanceShort);} |
|
3061 |
||
3062 |
||
3063 |
||
3064 |
||
3065 |
inline void TLocale::SetUnitsDistanceShort(TUnitsFormat aFormat) |
|
3066 |
/** |
|
3067 |
Sets the units of measurement for short distances. |
|
3068 |
||
3069 |
Short distances are those which would normally be represented by either |
|
3070 |
metres and centimetres or feet and inches. |
|
3071 |
||
3072 |
@param aFormat Units of measurement for short distances. |
|
3073 |
*/ |
|
3074 |
{iUnitsDistanceShort=aFormat;} |
|
3075 |
||
3076 |
||
3077 |
||
3078 |
||
3079 |
inline TUnitsFormat TLocale::UnitsDistanceLong() const |
|
3080 |
/** |
|
3081 |
Gets the units of measurement for long distances. |
|
3082 |
||
3083 |
Long distances are those which would normally be represented by either |
|
3084 |
miles or kilometres. |
|
3085 |
||
3086 |
@return Units of measurement for long distances. |
|
3087 |
*/ |
|
3088 |
{return(iUnitsDistanceLong);} |
|
3089 |
||
3090 |
||
3091 |
||
3092 |
||
3093 |
inline void TLocale::SetUnitsDistanceLong(TUnitsFormat aFormat) |
|
3094 |
/** |
|
3095 |
Sets the units of measurement for long distances. |
|
3096 |
||
3097 |
Long distances are those which would normally be represented by either |
|
3098 |
miles or kilometres. |
|
3099 |
||
3100 |
@param aFormat Units of measurement for long distances. |
|
3101 |
*/ |
|
3102 |
{iUnitsDistanceLong=aFormat;} |
|
3103 |
||
3104 |
||
3105 |
||
3106 |
||
3107 |
inline void TLocale::SetNegativeCurrencyFormat(TLocale::TNegativeCurrencyFormat aNegativeCurrencyFormat) |
|
3108 |
/** |
|
3109 |
Sets the negative currency format. |
|
3110 |
||
3111 |
@param aNegativeCurrencyFormat How negative currency values are formatted. |
|
3112 |
*/ |
|
3113 |
{iNegativeCurrencyFormat = aNegativeCurrencyFormat;} |
|
3114 |
||
3115 |
||
3116 |
||
3117 |
||
3118 |
inline TLocale::TNegativeCurrencyFormat TLocale::NegativeCurrencyFormat() const |
|
3119 |
/** |
|
3120 |
Gets the negative currency format. |
|
3121 |
||
3122 |
@return How negative currency values are formatted. |
|
3123 |
*/ |
|
3124 |
{return(iNegativeCurrencyFormat);} |
|
3125 |
||
3126 |
||
3127 |
||
3128 |
||
3129 |
inline TBool TLocale::NegativeLoseSpace() const |
|
3130 |
/** |
|
3131 |
Gets whether negative currency values lose the space between the currency |
|
3132 |
symbol and the value. |
|
3133 |
||
3134 |
@return True, if negative currency values lose the space between the value |
|
3135 |
and the symbol; false, if not. |
|
3136 |
*/ |
|
3137 |
{ |
|
3138 |
if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeLoseSpace)==iExtraNegativeCurrencyFormatFlags) |
|
3139 |
return ETrue; |
|
3140 |
else |
|
3141 |
return EFalse; |
|
3142 |
} |
|
3143 |
||
3144 |
||
3145 |
||
3146 |
||
3147 |
inline void TLocale::SetNegativeLoseSpace(TBool aBool) |
|
3148 |
/** |
|
3149 |
Sets whether negative currency values lose the space between the currency symbol |
|
3150 |
and the value. |
|
3151 |
||
3152 |
@param aBool ETrue to set a flag which indicates that negative currency values |
|
3153 |
should lose the space between the value and the symbol. EFalse to unset it. |
|
3154 |
*/ |
|
3155 |
{ |
|
3156 |
if(aBool) |
|
3157 |
iExtraNegativeCurrencyFormatFlags |= EFlagNegativeLoseSpace; |
|
3158 |
else |
|
3159 |
iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeLoseSpace; |
|
3160 |
} |
|
3161 |
||
3162 |
||
3163 |
||
3164 |
||
3165 |
inline TBool TLocale::NegativeCurrencySymbolOpposite() const |
|
3166 |
/** |
|
3167 |
Gets whether in negative currency values, the position of the currency symbol |
|
3168 |
is set to be the opposite of the position used for non-negative values (before |
|
3169 |
or after the value, as set by SetCurrencySymbolPosition()). |
|
3170 |
||
3171 |
@return True, if the currency symbol position for negative currency values |
|
3172 |
is the opposite of the position set by SetCurrencySymbolPosition(); |
|
3173 |
false, otherwise. |
|
3174 |
||
3175 |
@see TLocale::SetCurrencySymbolPosition |
|
3176 |
*/ |
|
3177 |
{ |
|
3178 |
if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeCurrencySymbolOpposite)==iExtraNegativeCurrencyFormatFlags) |
|
3179 |
return ETrue; |
|
3180 |
else |
|
3181 |
return EFalse; |
|
3182 |
} |
|
3183 |
||
3184 |
||
3185 |
||
3186 |
||
3187 |
inline void TLocale::SetNegativeCurrencySymbolOpposite(TBool aBool) |
|
3188 |
/** |
|
3189 |
Sets whether the position of the currency symbol for negative currency values |
|
3190 |
should be the opposite of the position used for non-negative values (before |
|
3191 |
or after the value, as set by SetCurrencySymbolPosition()). |
|
3192 |
||
3193 |
@param aBool ETrue to set the position of the currency symbol in negative |
|
3194 |
currency values to be the opposite of the position as set |
|
3195 |
using SetCurrencySymbolPosition(). EFalse to leave the |
|
3196 |
position unchanged. |
|
3197 |
||
3198 |
@see TLocale::SetCurrencySymbolPosition |
|
3199 |
*/ |
|
3200 |
{ |
|
3201 |
if (aBool) |
|
3202 |
iExtraNegativeCurrencyFormatFlags |= EFlagNegativeCurrencySymbolOpposite; |
|
3203 |
else |
|
3204 |
iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeCurrencySymbolOpposite; |
|
3205 |
} |
|
3206 |
||
3207 |
||
3208 |
||
3209 |
||
3210 |
inline TLanguage TLocale::LanguageDowngrade(TInt aIndex) const |
|
3211 |
/** |
|
3212 |
Gets the language that is stored at the specified index into the customisable |
|
3213 |
part of the language downgrade path. |
|
3214 |
||
3215 |
The second, third and fourth languages in the language downgrade path can |
|
3216 |
be customised. These can be enquired using this function. The first language |
|
3217 |
in the path is always the language of the current locale, as returned by User::Language(). |
|
3218 |
||
3219 |
The languages in the downgrade path are used in turn by the BaflUtils::NearestLanguageFile() |
|
3220 |
function to find the best matching language-specific version of a language-neutral |
|
3221 |
filename. |
|
3222 |
||
3223 |
The full language downgrade path can be retrieved using BaflUtils::GetDowngradePath(). |
|
3224 |
||
3225 |
@param aIndex An index into the customisable part of the language downgrade |
|
3226 |
path. Between zero and two inclusive. |
|
3227 |
||
3228 |
@return The language at the specified index. |
|
3229 |
||
3230 |
@see BaflUtils::NearestLanguageFile |
|
3231 |
@see BaflUtils::GetDowngradePath |
|
3232 |
*/ |
|
3233 |
{ |
|
3234 |
__ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant()); |
|
3235 |
return static_cast<TLanguage>(iLanguageDowngrade[aIndex]); |
|
3236 |
} |
|
3237 |
||
3238 |
||
3239 |
||
3240 |
||
3241 |
inline void TLocale::SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage) |
|
3242 |
/** |
|
3243 |
Sets a language in the customisable part of the language downgrade path. |
|
3244 |
||
3245 |
@param aIndex An index into the customisable part of the path at which to |
|
3246 |
add the language, a value between zero and two. |
|
3247 |
@param aLanguage The language to add. ELangNone is considered to be the last |
|
3248 |
language in the path, no more will be searched, so can be used |
|
3249 |
to specify that no language downgrade is required. |
|
3250 |
||
3251 |
@see BaflUtils::NearestLanguageFile |
|
3252 |
@see BaflUtils::GetDowngradePath |
|
3253 |
*/ |
|
3254 |
{ |
|
3255 |
__ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant()); |
|
3256 |
iLanguageDowngrade[aIndex] = static_cast<TUint16>(aLanguage); |
|
3257 |
} |
|
3258 |
||
3259 |
||
3260 |
||
3261 |
||
3262 |
/** |
|
3263 |
Gets the number mode stored in the locale. |
|
3264 |
||
3265 |
@return The number mode for the locale. |
|
3266 |
*/ |
|
3267 |
inline TDigitType TLocale::DigitType() const |
|
3268 |
{ return iDigitType; } |
|
3269 |
||
3270 |
||
3271 |
||
3272 |
||
3273 |
/** |
|
3274 |
Sets the number mode for the locale. |
|
3275 |
||
3276 |
@param aDigitType The number mode to be set. |
|
3277 |
*/ |
|
3278 |
inline void TLocale::SetDigitType(TDigitType aDigitType) |
|
3279 |
{ iDigitType=aDigitType; } |
|
3280 |
||
3281 |
||
3282 |
||
3283 |
||
3284 |
/** |
|
3285 |
Sets the device time state. |
|
3286 |
||
3287 |
@param aState The device time state. |
|
3288 |
||
3289 |
@deprecated Use the timezone server to coordinate automatic time adjustment. |
|
3290 |
*/ |
|
3291 |
inline void TLocale::SetDeviceTime(TDeviceTimeState aState) |
|
3292 |
{ |
|
3293 |
iDeviceTimeState=aState; |
|
3294 |
} |
|
3295 |
||
3296 |
||
3297 |
/** |
|
3298 |
Get the pointer to the TLocale object contained in this extended locale. |
|
3299 |
||
3300 |
@return Pointer to the TLocale object. |
|
3301 |
*/ |
|
3302 |
inline TLocale* TExtendedLocale::GetLocale() |
|
3303 |
{ return &iLocale; } |
|
3304 |
||
3305 |
||
3306 |
/** |
|
3307 |
Gets the device time state. |
|
3308 |
||
3309 |
@return The device time state. |
|
3310 |
||
3311 |
@deprecated Use the timezone server to coordinate automatic time adjustment. |
|
3312 |
*/ |
|
3313 |
inline TLocale::TDeviceTimeState TLocale::DeviceTime() const |
|
3314 |
{ |
|
3315 |
return iDeviceTimeState; |
|
3316 |
} |
|
3317 |
||
3318 |
||
3319 |
// Class TFindSemaphore |
|
3320 |
inline TFindSemaphore::TFindSemaphore() |
|
3321 |
: TFindHandleBase() |
|
3322 |
/** |
|
3323 |
Constructs the object with a default match pattern. |
|
3324 |
||
3325 |
The default match pattern, as implemented by the base class, is the single |
|
3326 |
character "*". |
|
3327 |
||
3328 |
A new match pattern can be set after construction by calling the Find() member |
|
3329 |
function of the TFindHandleBase base class. |
|
3330 |
||
3331 |
@see TFindHandleBase::Find |
|
3332 |
*/ |
|
3333 |
{} |
|
3334 |
||
3335 |
||
3336 |
||
3337 |
||
3338 |
inline TFindSemaphore::TFindSemaphore(const TDesC &aMatch) |
|
3339 |
: TFindHandleBase(aMatch) |
|
3340 |
/** |
|
3341 |
Constructs this object with the specified match pattern. |
|
3342 |
||
3343 |
A new match pattern can be set after construction by |
|
3344 |
calling TFindHandleBase::Find(). |
|
3345 |
||
3346 |
Note that after construction, the object contains a copy of the supplied |
|
3347 |
match pattern; the source descriptor can, therefore, be safely discarded. |
|
3348 |
||
3349 |
@param aMatch A reference to the descriptor containing the match pattern. |
|
3350 |
||
3351 |
@see TFindHandleBase::Find |
|
3352 |
*/ |
|
3353 |
{} |
|
3354 |
||
3355 |
||
3356 |
||
3357 |
||
3358 |
// Class TFindMutex |
|
3359 |
inline TFindMutex::TFindMutex() |
|
3360 |
: TFindHandleBase() |
|
3361 |
/** |
|
3362 |
Constructs this object with a default match pattern. |
|
3363 |
||
3364 |
The default match pattern, as implemented by the base class, is the single |
|
3365 |
character "*". |
|
3366 |
||
3367 |
A new match pattern can be set after construction by calling the Find() member |
|
3368 |
function of the TFindHandleBase base class. |
|
3369 |
||
3370 |
@see TFindHandleBase::Find |
|
3371 |
*/ |
|
3372 |
{} |
|
3373 |
||
3374 |
||
3375 |
||
3376 |
||
3377 |
inline TFindMutex::TFindMutex(const TDesC &aMatch) |
|
3378 |
: TFindHandleBase(aMatch) |
|
3379 |
/** |
|
3380 |
Constructs this object with the specified match pattern. |
|
3381 |
||
3382 |
A new match pattern can be set after construction by calling the Find() member |
|
3383 |
function of the TFindHandleBase base class. |
|
3384 |
||
3385 |
After construction, the object contains a copy of the supplied match pattern; |
|
3386 |
the source descriptor can, therefore, be safely discarded. |
|
3387 |
||
3388 |
@param aMatch The match pattern. |
|
3389 |
||
3390 |
@see TFindHandleBase::Find |
|
3391 |
*/ |
|
3392 |
{} |
|
3393 |
||
3394 |
||
3395 |
||
3396 |
||
3397 |
// Class TFindChunk |
|
3398 |
inline TFindChunk::TFindChunk() |
|
3399 |
: TFindHandleBase() |
|
3400 |
/** |
|
3401 |
Constructs this object with a default match pattern. |
|
3402 |
||
3403 |
The default match pattern, as implemented by the base class, is |
|
3404 |
the single character "*". |
|
3405 |
||
3406 |
A new match pattern can be set after construction by |
|
3407 |
calling TFindHandleBase::Find(). |
|
3408 |
||
3409 |
@see TFindHandleBase |
|
3410 |
*/ |
|
3411 |
{} |
|
3412 |
||
3413 |
||
3414 |
||
3415 |
||
3416 |
inline TFindChunk::TFindChunk(const TDesC &aMatch) |
|
3417 |
: TFindHandleBase(aMatch) |
|
3418 |
/** |
|
3419 |
Constructs the object with the specified match pattern. |
|
3420 |
||
3421 |
A new match pattern can be set after construction by |
|
3422 |
calling TFindHandleBase::Find(). |
|
3423 |
||
3424 |
@param aMatch The match pattern. |
|
3425 |
||
3426 |
@see TFindHandleBase |
|
3427 |
*/ |
|
3428 |
{} |
|
3429 |
||
3430 |
||
3431 |
||
3432 |
||
3433 |
// Class TFindThread |
|
3434 |
inline TFindThread::TFindThread() |
|
3435 |
: TFindHandleBase() |
|
3436 |
/** |
|
3437 |
Constructs this object with a default match pattern. |
|
3438 |
||
3439 |
The default match pattern, as implemented by the base class, |
|
3440 |
is the single character *. |
|
3441 |
||
3442 |
A new match pattern can be set after construction |
|
3443 |
by calling TFindHandleBase::Find(). |
|
3444 |
||
3445 |
@see TFindHandleBase::Find |
|
3446 |
*/ |
|
3447 |
{} |
|
3448 |
||
3449 |
||
3450 |
||
3451 |
||
3452 |
inline TFindThread::TFindThread(const TDesC &aMatch) |
|
3453 |
: TFindHandleBase(aMatch) |
|
3454 |
/** |
|
3455 |
Constructs this object with the specified match pattern. |
|
3456 |
||
3457 |
A new match pattern can be set after construction |
|
3458 |
by calling the TFindHandleBase::Find(). |
|
3459 |
||
3460 |
@see TFindHandleBase::Find |
|
3461 |
*/ |
|
3462 |
{} |
|
3463 |
||
3464 |
||
3465 |
||
3466 |
||
3467 |
// Class TFindProcess |
|
3468 |
inline TFindProcess::TFindProcess() |
|
3469 |
: TFindHandleBase() |
|
3470 |
/** |
|
3471 |
Constructs this object with a default match pattern. |
|
3472 |
||
3473 |
The default match pattern, as implemented by the base class, |
|
3474 |
is the single character *. |
|
3475 |
||
3476 |
A new match pattern can be set after construction |
|
3477 |
by calling TFindHandleBase::Find(). |
|
3478 |
||
3479 |
@see TFindHandleBase::Find |
|
3480 |
*/ |
|
3481 |
{} |
|
3482 |
||
3483 |
||
3484 |
||
3485 |
||
3486 |
inline TFindProcess::TFindProcess(const TDesC &aMatch) |
|
3487 |
: TFindHandleBase(aMatch) |
|
3488 |
/** |
|
3489 |
Constructs this object with the specified match pattern. |
|
3490 |
||
3491 |
A new match pattern can be set after construction |
|
3492 |
by calling the TFindHandleBase::Find(). |
|
3493 |
||
3494 |
@see TFindHandleBase::Find |
|
3495 |
*/ |
|
3496 |
{} |
|
3497 |
||
3498 |
||
3499 |
||
3500 |
||
3501 |
// Class TFindLogicalDevice |
|
3502 |
/** |
|
3503 |
Constructs the LDD factory object with a default match pattern. |
|
3504 |
||
3505 |
The default match pattern, as implemented by the base class, is the single |
|
3506 |
character "*". |
|
3507 |
||
3508 |
A new match pattern can be set after construction by calling the Find() member |
|
3509 |
function of the TFindHandleBase base class. |
|
3510 |
||
3511 |
@see TFindHandleBase::Find |
|
3512 |
*/ |
|
3513 |
inline TFindLogicalDevice::TFindLogicalDevice() |
|
3514 |
: TFindHandleBase() |
|
3515 |
{} |
|
3516 |
||
3517 |
/** |
|
3518 |
Constructs the LDD factory object with a specified match pattern. |
|
3519 |
||
3520 |
A new match pattern can be set after construction by calling |
|
3521 |
TFindHandleBase::Find(). |
|
3522 |
||
3523 |
@param aMatch The match pattern. |
|
3524 |
||
3525 |
@see TFindHandleBase::Find |
|
3526 |
*/ |
|
3527 |
inline TFindLogicalDevice::TFindLogicalDevice(const TDesC &aMatch) |
|
3528 |
: TFindHandleBase(aMatch) |
|
3529 |
{} |
|
3530 |
||
3531 |
// Class TFindPhysicalDevice |
|
3532 |
/** |
|
3533 |
Constructs the PDD factory object with a default match pattern. |
|
3534 |
||
3535 |
The default match pattern, as implemented by the base class, is the single |
|
3536 |
character "*". |
|
3537 |
||
3538 |
A new match pattern can be set after construction by calling the Find() member |
|
3539 |
function of the TFindHandleBase base class. |
|
3540 |
||
3541 |
@see TFindHandleBase::Find |
|
3542 |
*/ |
|
3543 |
inline TFindPhysicalDevice::TFindPhysicalDevice() |
|
3544 |
: TFindHandleBase() |
|
3545 |
{} |
|
3546 |
||
3547 |
/** |
|
3548 |
Constructs the PDD factory object with a specified match pattern. |
|
3549 |
||
3550 |
A new match pattern can be set after construction by calling |
|
3551 |
TFindHandleBase::Find(). |
|
3552 |
||
3553 |
@param aMatch The match pattern. |
|
3554 |
||
3555 |
@see TFindHandleBase::Find |
|
3556 |
*/ |
|
3557 |
inline TFindPhysicalDevice::TFindPhysicalDevice(const TDesC &aMatch) |
|
3558 |
: TFindHandleBase(aMatch) |
|
3559 |
{} |
|
3560 |
||
3561 |
||
3562 |
||
3563 |
||
3564 |
||
3565 |
// Class TFindServer |
|
3566 |
inline TFindServer::TFindServer() |
|
3567 |
: TFindHandleBase() |
|
3568 |
/** |
|
3569 |
Constructs the object with a default match pattern. |
|
3570 |
||
3571 |
The default match pattern, as implemented by the base class, is the single |
|
3572 |
character "*". |
|
3573 |
||
3574 |
A new match pattern can be set after construction by calling the Find() member |
|
3575 |
function of the TFindHandleBase base class. |
|
3576 |
||
3577 |
@see TFindHandleBase::Find |
|
3578 |
*/ |
|
3579 |
{} |
|
3580 |
||
3581 |
||
3582 |
||
3583 |
||
3584 |
inline TFindServer::TFindServer(const TDesC &aMatch) |
|
3585 |
: TFindHandleBase(aMatch) |
|
3586 |
/** |
|
3587 |
Constructs the object with a specified match pattern. |
|
3588 |
||
3589 |
A new match pattern can be set after construction by calling |
|
3590 |
TFindHandleBase::Find(). |
|
3591 |
||
3592 |
@param aMatch The match pattern. |
|
3593 |
||
3594 |
@see TFindHandleBase::Find |
|
3595 |
*/ |
|
3596 |
{} |
|
3597 |
||
3598 |
||
3599 |
||
3600 |
||
3601 |
// Class TFindLibrary |
|
3602 |
inline TFindLibrary::TFindLibrary() |
|
3603 |
: TFindHandleBase() |
|
3604 |
/** |
|
3605 |
Constructs this object with a default match pattern. |
|
3606 |
||
3607 |
The default match pattern is the single character ‘*’ and is implemented by |
|
3608 |
the base class TFindHandleBase. |
|
3609 |
*/ |
|
3610 |
{} |
|
3611 |
||
3612 |
||
3613 |
||
3614 |
||
3615 |
inline TFindLibrary::TFindLibrary(const TDesC &aMatch) |
|
3616 |
: TFindHandleBase(aMatch) |
|
3617 |
/** |
|
3618 |
Constructs this object with the specified match pattern. |
|
3619 |
||
3620 |
@param aMatch The descriptor containing the match pattern. |
|
3621 |
*/ |
|
3622 |
{} |
|
3623 |
||
3624 |
||
3625 |
||
3626 |
||
3627 |
// Class RDevice |
|
3628 |
/** |
|
3629 |
Opens a handle to an LDD factory object found using a TFindLogicalDevice object. |
|
3630 |
||
3631 |
A TFindLogicalDevice object is used to find all LDD factory objects whose full names match |
|
3632 |
a specified pattern. |
|
3633 |
||
3634 |
@param aFind A reference to the object which is used to find the LDD factory object. |
|
3635 |
@param aType An enumeration whose enumerators define the ownership of this |
|
3636 |
LDD factory object handle. If not explicitly specified, EOwnerProcess is |
|
3637 |
taken as default. |
|
3638 |
||
3639 |
@return KErrNone if successful, otherwise one of the other system wide error |
|
3640 |
codes. |
|
3641 |
*/ |
|
3642 |
inline TInt RDevice::Open(const TFindLogicalDevice& aFind,TOwnerType aType) |
|
3643 |
{return(RHandleBase::Open(aFind,aType));} |
|
3644 |
||
3645 |
||
3646 |
||
3647 |
||
3648 |
// Class RCriticalSection |
|
3649 |
inline TBool RCriticalSection::IsBlocked() const |
|
3650 |
/** |
|
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3651 |
Tests whether the critical section is occupied by any thread. |
0 | 3652 |
|
3653 |
@return True, if the critical section is occupied by another thread. False, |
|
3654 |
otherwise. |
|
3655 |
*/ |
|
3656 |
{return(iBlocked!=1);} |
|
3657 |
||
3658 |
||
3659 |
||
3660 |
||
3661 |
// Class RMutex |
|
3662 |
inline TInt RMutex::Open(const TFindMutex& aFind,TOwnerType aType) |
|
3663 |
/** |
|
3664 |
Opens a handle to the global mutex found using a TFindMutex object. |
|
3665 |
||
3666 |
A TFindMutex object is used to find all global mutexes whose full names match |
|
3667 |
a specified pattern. |
|
3668 |
||
3669 |
By default, any thread in the process can use this instance of RMutex to access |
|
3670 |
the mutex. However, specifying EOwnerThread as the second parameter to this |
|
3671 |
function, means that only the opening thread can use this instance of RMutex |
|
3672 |
to access the mutex; any other thread in this process that wants to access |
|
3673 |
the mutex must either duplicate the handle or use OpenGlobal() again. |
|
3674 |
||
3675 |
@param aFind A reference to the object which is used to find the mutex. |
|
3676 |
@param aType An enumeration whose enumerators define the ownership of this |
|
3677 |
mutex handle. If not explicitly specified, EOwnerProcess is |
|
3678 |
taken as default. |
|
3679 |
||
3680 |
@return KErrNone if successful, otherwise one of the other system wide error |
|
3681 |
codes. |
|
3682 |
*/ |
|
3683 |
{return(RHandleBase::Open(aFind,aType));} |
|
3684 |
||
3685 |
||
3686 |
||
3687 |
||
3688 |
// Class RChunk |
|
3689 |
inline TInt RChunk::Open(const TFindChunk& aFind,TOwnerType aType) |
|
3690 |
/** |
|
3691 |
Opens a handle to the global chunk found using a TFindChunk object. |
|
3692 |
||
3693 |
A TFindChunk object is used to find all chunks whose full names match |
|
3694 |
a specified pattern. |
|
3695 |
||
3696 |
By default, ownership of this chunk handle is vested in the current process, |
|
3697 |
but can be vested in the current thread by passing EOwnerThread as the second |
|
3698 |
parameter to this function. |
|
3699 |
||
3700 |
@param aFind A reference to the TFindChunk object used to find the chunk. |
|
3701 |
@param aType An enumeration whose enumerators define the ownership of this |
|
3702 |
chunk handle. If not explicitly specified, EOwnerProcess is |
|
3703 |
taken as default. |
|
3704 |
||
3705 |
@return KErrNone if successful, otherwise another of the system error codes. |
|
3706 |
*/ |
|
3707 |
{return(RHandleBase::Open(aFind,aType));} |
|
3708 |
||
3709 |
||
3710 |
||
3711 |
||
3712 |
inline TBool RChunk::IsReadable() const |
|
3713 |
/** |
|
3714 |
Tests whether the chunk is mapped into its process address space. |
|
3715 |
||
3716 |
@return True, if the chunk is readable; false, otherwise. |
|
3717 |
*/ |
|
3718 |
{return (Attributes()&RHandleBase::EDirectReadAccess); } |
|
3719 |
||
3720 |
||
3721 |
||
3722 |
||
3723 |
inline TBool RChunk::IsWritable() const |
|
3724 |
/** |
|
3725 |
Tests whether the chunk mapped into its process address space and is writable. |
|
3726 |
||
3727 |
@return True, if the chunk is writable; false, otherwise. |
|
3728 |
*/ |
|
3729 |
{return (Attributes()&RHandleBase::EDirectWriteAccess); } |
|
3730 |
||
3731 |
||
3732 |
||
3733 |
||
3734 |
// Class TObjectId |
|
3735 |
inline TObjectId::TObjectId() |
|
3736 |
/** |
|
3737 |
Default constructor. |
|
3738 |
*/ |
|
3739 |
{} |
|
3740 |
||
3741 |
||
3742 |
||
3743 |
||
3744 |
inline TObjectId::TObjectId(TUint64 aId) |
|
3745 |
: iId(aId) |
|
3746 |
/** |
|
3747 |
Constructor taking an unsigned integer value. |
|
3748 |
||
3749 |
@param aId The value of the object id. |
|
3750 |
*/ |
|
3751 |
{} |
|
3752 |
||
3753 |
||
3754 |
||
3755 |
||
3756 |
inline TUint64 TObjectId::Id() const |
|
3757 |
/** |
|
3758 |
Return the ID as a 64 bit integer |
|
3759 |
*/ |
|
3760 |
{ return iId; } |
|
3761 |
||
3762 |
||
3763 |
||
3764 |
||
3765 |
inline TObjectId::operator TUint() const |
|
3766 |
/** |
|
3767 |
Conversion operator invoked by the compiler when a TObjectId type is passed |
|
3768 |
to a function that is prototyped to take a TUint type. |
|
3769 |
||
3770 |
@see TUint |
|
3771 |
*/ |
|
3772 |
{ return TUint(iId); } |
|
3773 |
||
3774 |
||
3775 |
||
3776 |
||
3777 |
inline TBool TObjectId::operator==(TObjectId aId) const |
|
3778 |
/** |
|
3779 |
Tests whether this thread Id is equal to the specified Id. |
|
3780 |
||
3781 |
@param aId The thread Id to be compared with this thread Id. |
|
3782 |
||
3783 |
@return True, if the thread Ids are equal; false otherwise. |
|
3784 |
*/ |
|
3785 |
{return iId==aId.iId;} |
|
3786 |
||
3787 |
||
3788 |
||
3789 |
||
3790 |
inline TBool TObjectId::operator!=(TObjectId aId) const |
|
3791 |
/** |
|
3792 |
Tests whether this thread Id is unequal to the specified thread Id. |
|
3793 |
||
3794 |
@param aId The thread Id to be compared with this thread Id. |
|
3795 |
||
3796 |
@return True, if the thread Ids are unequal; false otherwise. |
|
3797 |
*/ |
|
3798 |
{return iId!=aId.iId;} |
|
3799 |
||
3800 |
||
3801 |
||
3802 |
||
3803 |
// Class TThreadId |
|
3804 |
inline TThreadId::TThreadId() |
|
3805 |
: TObjectId() |
|
3806 |
/** |
|
3807 |
Default constructor. |
|
3808 |
*/ |
|
3809 |
{} |
|
3810 |
||
3811 |
||
3812 |
||
3813 |
||
3814 |
inline TThreadId::TThreadId(TUint64 aId) |
|
3815 |
: TObjectId(aId) |
|
3816 |
/** |
|
3817 |
Constructor taking an unsigned integer value. |
|
3818 |
||
3819 |
@param aId The value of the thread id. |
|
3820 |
*/ |
|
3821 |
{} |
|
3822 |
||
3823 |
||
3824 |
||
3825 |
||
3826 |
// Class RThread |
|
3827 |
inline RThread::RThread() |
|
3828 |
: RHandleBase(KCurrentThreadHandle) |
|
3829 |
/** |
|
3830 |
Default constructor. |
|
3831 |
||
3832 |
The constructor exists to initialise private data within this handle; it does |
|
3833 |
not create the thread object. |
|
3834 |
||
3835 |
Specifically, it sets the handle-number to the value KCurrentThreadHandle. |
|
3836 |
In effect, the constructor creates a default thread handle. |
|
3837 |
*/ |
|
3838 |
{} |
|
3839 |
||
3840 |
||
3841 |
||
3842 |
||
3843 |
inline TInt RThread::Open(const TFindThread& aFind,TOwnerType aType) |
|
3844 |
/** |
|
3845 |
Opens a handle to the thread found by pattern matching a name. |
|
3846 |
||
3847 |
A TFindThread object is used to find all threads whose full names match a |
|
3848 |
specified pattern. |
|
3849 |
||
3850 |
By default, ownership of this thread handle is vested in the current process, |
|
3851 |
but can be vested in the current thread by passing EOwnerThread as the second |
|
3852 |
parameter to this function. |
|
3853 |
||
3854 |
@param aFind A reference to the TFindThread object used to find the thread. |
|
3855 |
@param aType An enumeration whose enumerators define the ownership of this |
|
3856 |
thread handle. If not explicitly specified, EOwnerProcess is |
|
3857 |
taken as default. |
|
3858 |
||
3859 |
@return KErrNone if successful, otherwise one of the other system-wide error codes. |
|
3860 |
*/ |
|
3861 |
{return(RHandleBase::Open(aFind,aType));} |
|
3862 |
||
3863 |
||
3864 |
||
3865 |
||
3866 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
3867 |
||
3868 |
inline TBool RThread::HasCapability(TCapability aCapability, const char* aDiagnostic) const |
|
3869 |
{ |
|
3870 |
return DoHasCapability(aCapability, aDiagnostic); |
|
3871 |
} |
|
3872 |
||
3873 |
inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const |
|
3874 |
{ |
|
3875 |
return DoHasCapability(aCapability1, aCapability2, aDiagnostic); |
|
3876 |
} |
|
3877 |
||
3878 |
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
3879 |
||
3880 |
// Only available to NULL arguments |
|
3881 |
inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const |
|
3882 |
{ |
|
3883 |
return DoHasCapability(aCapability); |
|
3884 |
} |
|
3885 |
||
3886 |
inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const |
|
3887 |
{ |
|
3888 |
return DoHasCapability(aCapability1, aCapability2); |
|
3889 |
} |
|
3890 |
||
3891 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__ |
|
3892 |
// For things using KSuppressPlatSecDiagnostic |
|
3893 |
inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
3894 |
{ |
|
3895 |
return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue); |
|
3896 |
} |
|
3897 |
||
3898 |
inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
3899 |
{ |
|
3900 |
return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue); |
|
3901 |
} |
|
3902 |
||
3903 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__ |
|
3904 |
||
3905 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
3906 |
||
3907 |
// Class TProcessId |
|
3908 |
inline TProcessId::TProcessId() |
|
3909 |
: TObjectId() |
|
3910 |
/** |
|
3911 |
Default constructor. |
|
3912 |
*/ |
|
3913 |
{} |
|
3914 |
||
3915 |
||
3916 |
||
3917 |
||
3918 |
inline TProcessId::TProcessId(TUint64 aId) |
|
3919 |
: TObjectId(aId) |
|
3920 |
/** |
|
3921 |
Constructor taking an unsigned integer value. |
|
3922 |
||
3923 |
@param aId The value of the process id. |
|
3924 |
*/ |
|
3925 |
{} |
|
3926 |
||
3927 |
||
3928 |
||
3929 |
||
3930 |
// Class RProcess |
|
3931 |
inline RProcess::RProcess() |
|
3932 |
: RHandleBase(KCurrentProcessHandle) |
|
3933 |
/** |
|
3934 |
Default constructor. |
|
3935 |
||
3936 |
The constructor exists to initialise private data within this handle; it does |
|
3937 |
not create the process object. |
|
3938 |
||
3939 |
Specifically, it sets the handle-number to the value KCurrentProcessHandle. |
|
3940 |
In effect, the constructor creates a default process handle. |
|
3941 |
*/ |
|
3942 |
{} |
|
3943 |
||
3944 |
||
3945 |
||
3946 |
||
3947 |
inline RProcess::RProcess(TInt aHandle) |
|
3948 |
: RHandleBase(aHandle) |
|
3949 |
/** |
|
3950 |
Constructor taking a handle number. |
|
3951 |
||
3952 |
@param aHandle The handle number to be used to construct this RProcess handle. |
|
3953 |
*/ |
|
3954 |
{} |
|
3955 |
||
3956 |
||
3957 |
||
3958 |
||
3959 |
inline TInt RProcess::Open(const TFindProcess& aFind,TOwnerType aType) |
|
3960 |
/** |
|
3961 |
Opens a handle to the process found by pattern matching a name. |
|
3962 |
||
3963 |
A TFindProcess object is used to find all processes whose full names match |
|
3964 |
a specified pattern. |
|
3965 |
||
3966 |
By default, ownership of this process handle is vested in the current process, |
|
3967 |
but can be vested in the current thread by passing EOwnerThread as the second |
|
3968 |
parameter to this function. |
|
3969 |
||
3970 |
@param aFind A reference to the TFindProcess object used to find the process. |
|
3971 |
@param aType An enumeration whose enumerators define the ownership of this |
|
3972 |
process handle. If not explicitly specified, EOwnerProcess is taken |
|
3973 |
as default. |
|
3974 |
||
3975 |
@return KErrNone if successful, otherwise one of the other system-wide error codes. |
|
3976 |
*/ |
|
3977 |
{return(RHandleBase::Open(aFind,aType));} |
|
3978 |
||
3979 |
||
3980 |
||
3981 |
||
3982 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
3983 |
||
3984 |
inline TBool RProcess::HasCapability(TCapability aCapability, const char* aDiagnostic) const |
|
3985 |
{ |
|
3986 |
return DoHasCapability(aCapability, aDiagnostic); |
|
3987 |
} |
|
3988 |
||
3989 |
inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const |
|
3990 |
{ |
|
3991 |
return DoHasCapability(aCapability1, aCapability2, aDiagnostic); |
|
3992 |
} |
|
3993 |
||
3994 |
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
3995 |
||
3996 |
// Only available to NULL arguments |
|
3997 |
inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const |
|
3998 |
{ |
|
3999 |
return DoHasCapability(aCapability); |
|
4000 |
} |
|
4001 |
||
4002 |
inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const |
|
4003 |
{ |
|
4004 |
return DoHasCapability(aCapability1, aCapability2); |
|
4005 |
} |
|
4006 |
||
4007 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__ |
|
4008 |
// For things using KSuppressPlatSecDiagnostic |
|
4009 |
inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
4010 |
{ |
|
4011 |
return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue); |
|
4012 |
} |
|
4013 |
||
4014 |
inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
4015 |
{ |
|
4016 |
return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue); |
|
4017 |
} |
|
4018 |
||
4019 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__ |
|
4020 |
||
4021 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
4022 |
||
4023 |
||
4024 |
||
4025 |
||
4026 |
||
4027 |
// Class RSessionBase |
|
4028 |
||
4029 |
||
4030 |
/** |
|
4031 |
Creates a session with a server, specifying no message slots. |
|
4032 |
||
4033 |
It should be called as part of session initialisation in the derived class. |
|
4034 |
||
4035 |
Message slots are not pre-allocated for the session but are taken from |
|
4036 |
a system-wide pool allowing up to 255 asynchronous messages to be outstanding. |
|
4037 |
This raises a risk of failure due to lack of memory and, therefore, this mode |
|
4038 |
of operation is not viable for sessions that make guarantees about the failure |
|
4039 |
modes of asynchonous services. |
|
4040 |
||
4041 |
@param aServer The name of the server with which a session is to |
|
4042 |
be established. |
|
4043 |
@param aVersion The lowest version of the server with which this client |
|
4044 |
is compatible |
|
4045 |
||
4046 |
@return KErrNone if successful, otherwise one of the other system-wide error |
|
4047 |
codes. |
|
4048 |
*/ |
|
4049 |
inline TInt RSessionBase::CreateSession(const TDesC& aServer,const TVersion& aVersion) |
|
4050 |
{return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);} |
|
4051 |
||
4052 |
||
4053 |
||
4054 |
||
4055 |
/** |
|
4056 |
Creates a session with a server, specifying no message slots. |
|
4057 |
||
4058 |
It should be called as part of session initialisation in the derived class. |
|
4059 |
||
4060 |
Message slots are not pre-allocated for the session but are taken from |
|
4061 |
a system-wide pool allowing up to 255 asynchronous messages to be outstanding. |
|
4062 |
This raises a risk of failure due to lack of memory and, therefore, this mode |
|
4063 |
of operation is not viable for sessions that make guarantees about the failure |
|
4064 |
modes of asynchonous services. |
|
4065 |
||
4066 |
@param aServer A handle to a server with which a session is to be established. |
|
4067 |
@param aVersion The lowest version of the server with which this client |
|
4068 |
is compatible |
|
4069 |
||
4070 |
@return KErrNone if successful, otherwise one of the other system-wide error |
|
4071 |
codes. |
|
4072 |
*/ |
|
4073 |
inline TInt RSessionBase::CreateSession(RServer2 aServer,const TVersion& aVersion) |
|
4074 |
{return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);} |
|
4075 |
||
4076 |
||
4077 |
||
4078 |
||
4079 |
/** |
|
4080 |
Issues a blind request to the server with the specified function number, |
|
4081 |
and arguments. |
|
4082 |
||
4083 |
A blind request is one where the server does not issue a response |
|
4084 |
to the client. |
|
4085 |
||
4086 |
@param aFunction The function number identifying the request. |
|
4087 |
@param aArgs A set of up to 4 arguments and their types to be passed |
|
4088 |
to the server. |
|
4089 |
||
4090 |
@return KErrNone, if the send operation is successful; |
|
4091 |
KErrServerTerminated, if the server no longer present; |
|
4092 |
KErrServerBusy, if there are no message slots available; |
|
4093 |
KErrNoMemory, if there is insufficient memory available. |
|
4094 |
||
4095 |
@panic USER 72 if the function number is negative. |
|
4096 |
*/ |
|
4097 |
inline TInt RSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const |
|
4098 |
{return DoSend(aFunction,&aArgs);} |
|
4099 |
||
4100 |
||
4101 |
||
4102 |
||
4103 |
/** |
|
4104 |
Issues an asynchronous request to the server with the specified function |
|
4105 |
number and arguments. |
|
4106 |
||
4107 |
The completion status of the request is returned via the request |
|
4108 |
status object, aStatus. |
|
4109 |
||
4110 |
@param aFunction The function number identifying the request. |
|
4111 |
@param aArgs A set of up to 4 arguments and their types to be passed |
|
4112 |
to the server. |
|
4113 |
@param aStatus The request status object used to contain the completion status |
|
4114 |
of the request. |
|
4115 |
||
4116 |
@panic USER 72 if the function number is negative. |
|
4117 |
*/ |
|
4118 |
inline void RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const |
|
4119 |
{DoSendReceive(aFunction,&aArgs,aStatus);} |
|
4120 |
||
4121 |
||
4122 |
||
4123 |
||
4124 |
/** |
|
4125 |
Issues a synchronous request to the server with the specified function number |
|
4126 |
and arguments. |
|
4127 |
||
4128 |
@param aFunction The function number identifying the request. |
|
4129 |
@param aArgs A set of up to 4 arguments and their types to be passed |
|
4130 |
to the server. |
|
4131 |
||
4132 |
@return KErrNone, if the send operation is successful; |
|
4133 |
KErrServerTerminated, if the server no longer present; |
|
4134 |
KErrServerBusy, if there are no message slots available; |
|
4135 |
KErrNoMemory, if there is insufficient memory available. |
|
4136 |
||
4137 |
@panic USER 72 if the function number is negative. |
|
4138 |
*/ |
|
4139 |
inline TInt RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const |
|
4140 |
{return DoSendReceive(aFunction,&aArgs);} |
|
4141 |
||
4142 |
||
4143 |
||
4144 |
||
4145 |
/** |
|
4146 |
Issues a blind request to the server with the specified function number, |
|
4147 |
but with no arguments. |
|
4148 |
||
4149 |
A blind request is one where the server does not issue a response |
|
4150 |
to the client. |
|
4151 |
||
4152 |
@param aFunction The function number identifying the request. |
|
4153 |
||
4154 |
@return KErrNone, if the send operation is successful; |
|
4155 |
KErrServerTerminated, if the server no longer present; |
|
4156 |
KErrServerBusy, if there are no message slots available; |
|
4157 |
KErrNoMemory, if there is insufficient memory available. |
|
4158 |
||
4159 |
@panic USER 72 if the function number is negative. |
|
4160 |
*/ |
|
4161 |
inline TInt RSessionBase::Send(TInt aFunction) const |
|
4162 |
{return DoSend(aFunction,NULL);} |
|
4163 |
||
4164 |
||
4165 |
||
4166 |
||
4167 |
/** |
|
4168 |
Issues an asynchronous request to the server with the specified function |
|
4169 |
number, but with no arguments. |
|
4170 |
||
4171 |
The completion status of the request is returned via the request |
|
4172 |
status object, aStatus. |
|
4173 |
||
4174 |
@param aFunction The function number identifying the request. |
|
4175 |
@param aStatus The request status object used to contain the completion |
|
4176 |
status of the request. |
|
4177 |
||
4178 |
@panic USER 72 if the function number is negative. |
|
4179 |
*/ |
|
4180 |
inline void RSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const |
|
4181 |
{ DoSendReceive(aFunction,NULL,aStatus);} |
|
4182 |
||
4183 |
||
4184 |
||
4185 |
||
4186 |
/** |
|
4187 |
Sets the handle-number of this handle to the specified |
|
4188 |
value. |
|
4189 |
||
4190 |
The function can take a (zero or positive) handle-number, |
|
4191 |
or a (negative) error number. |
|
4192 |
||
4193 |
If aHandleOrError represents a handle-number, then the handle-number of this handle |
|
4194 |
is set to that value. |
|
4195 |
If aHandleOrError represents an error number, then the handle-number of this handle is set to zero |
|
4196 |
and the negative value is returned. |
|
4197 |
||
4198 |
@param aHandleOrError A handle-number, if zero or positive; an error value, if negative. |
|
4199 |
||
4200 |
@return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise. |
|
4201 |
*/ |
|
4202 |
inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError) |
|
4203 |
{ return RHandleBase::SetReturnedHandle(aHandleOrError);} |
|
4204 |
||
4205 |
||
4206 |
||
4207 |
||
4208 |
inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle) |
|
4209 |
{ return RHandleBase::SetReturnedHandle(aHandleOrError,aHandle);} |
|
4210 |
/** |
|
4211 |
Issues a synchronous request to the server with the specified function number, |
|
4212 |
but with no arguments. |
|
4213 |
||
4214 |
@param aFunction The function number identifying the request. |
|
4215 |
||
4216 |
@return KErrNone, if the send operation is successful; |
|
4217 |
KErrServerTerminated, if the server no longer present; |
|
4218 |
KErrServerBusy, if there are no message slots available; |
|
4219 |
KErrNoMemory, if there is insufficient memory available. |
|
4220 |
||
4221 |
@panic USER 72 if the function number is negative. |
|
4222 |
*/ |
|
4223 |
inline TInt RSessionBase::SendReceive(TInt aFunction) const |
|
4224 |
{return DoSendReceive(aFunction,NULL);} |
|
4225 |
||
4226 |
||
4227 |
||
4228 |
||
4229 |
// Class RSubSessionBase |
|
4230 |
inline RSubSessionBase::RSubSessionBase() |
|
4231 |
: iSubSessionHandle(0) |
|
4232 |
/** |
|
4233 |
Default constructor |
|
4234 |
*/ |
|
4235 |
{} |
|
4236 |
||
4237 |
||
4238 |
||
4239 |
||
4240 |
inline TInt RSubSessionBase::SubSessionHandle() const |
|
4241 |
/** |
|
4242 |
Gets the sub-session handle number. |
|
4243 |
||
4244 |
This number is automatically passed to the server when making requests and is |
|
4245 |
used to identify the appropriate server-side sub-session. |
|
4246 |
||
4247 |
@return The sub-session handle number. |
|
4248 |
*/ |
|
4249 |
{return iSubSessionHandle;} |
|
4250 |
||
4251 |
||
4252 |
||
4253 |
||
4254 |
/** |
|
4255 |
Creates a new sub-session within an existing session. |
|
4256 |
||
4257 |
@param aSession The session to which this sub-session will belong. |
|
4258 |
@param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session. |
|
4259 |
@param aArgs The message arguments. |
|
4260 |
||
4261 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
4262 |
*/ |
|
4263 |
inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs) |
|
4264 |
{ return DoCreateSubSession(aSession,aFunction,&aArgs); } |
|
4265 |
||
4266 |
||
4267 |
||
4268 |
||
4269 |
/** |
|
4270 |
Creates a new sub-session within an existing session. |
|
4271 |
||
4272 |
This variant sends no message arguments to the server. |
|
4273 |
||
4274 |
@param aSession The session to which this sub-session will belong. |
|
4275 |
@param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session. |
|
4276 |
||
4277 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
4278 |
*/ |
|
4279 |
inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction) |
|
4280 |
{ return DoCreateSubSession(aSession,aFunction,NULL); } |
|
4281 |
||
4282 |
||
4283 |
||
4284 |
||
4285 |
/** |
|
4286 |
Sends a blind message to the server - no reply is expected. |
|
4287 |
||
4288 |
A set of message arguments is passed that can be used to specify client |
|
4289 |
addresses, which the server can use to read from and write to the client |
|
4290 |
address space. |
|
4291 |
||
4292 |
Note that this function can fail if there are no available message-slots, either |
|
4293 |
in the system wide pool (if this is being used), or in the session reserved pool |
|
4294 |
(if this is being used). If the client request is synchronous, then always use |
|
4295 |
the synchronous variant of SendReceive(); this is guaranteed to reach the server. |
|
4296 |
||
4297 |
@param aFunction The opcode specifying the requested service. |
|
4298 |
@param aArgs The message arguments. |
|
4299 |
||
4300 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
4301 |
*/ |
|
4302 |
inline TInt RSubSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const |
|
4303 |
{return DoSend(aFunction,&aArgs);} |
|
4304 |
||
4305 |
||
4306 |
||
4307 |
||
4308 |
/** |
|
4309 |
Sends a message to the server and waits asynchronously for the reply. |
|
4310 |
||
4311 |
An opcode specifies the service required. |
|
4312 |
A set of message arguments is passed that can be used to specify client addresses, |
|
4313 |
which the server can use to read from and write to the client address space. |
|
4314 |
||
4315 |
Note that this function can fail if there are no available message-slots, |
|
4316 |
either in the system wide pool (if this is being used), or in the session |
|
4317 |
reserved pool (if this is being used). If the client request is synchronous, |
|
4318 |
then always use the synchronous variant of SendReceive(); |
|
4319 |
this is guaranteed to reach the server. |
|
4320 |
||
4321 |
@param aFunction The opcode specifying the requested service. |
|
4322 |
@param aArgs The message arguments. |
|
4323 |
@param aStatus A request status which indicates the completion status of the asynchronous request. |
|
4324 |
*/ |
|
4325 |
inline void RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const |
|
4326 |
{DoSendReceive(aFunction,&aArgs,aStatus);} |
|
4327 |
||
4328 |
||
4329 |
||
4330 |
||
4331 |
/** |
|
4332 |
Sends a message to the server and waits synchronously for a reply. |
|
4333 |
||
4334 |
An opcode specifies the service required. |
|
4335 |
A set of message arguments is passed that can be used to specify client addresses, |
|
4336 |
which the server can use to read from and write to the client address space. |
|
4337 |
||
4338 |
Note that this function will only fail if the server itself fails or environmental |
|
4339 |
errors occur in the server. All requests made using this function are guaranteed to |
|
4340 |
reach the server. This means that all synchronous client requests (typically those |
|
4341 |
that return void) should be routed through this synchronous variant of SendReceive(). |
|
4342 |
||
4343 |
@param aFunction The opcode specifying the requested service. |
|
4344 |
@param aArgs The message arguments. |
|
4345 |
||
4346 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
4347 |
*/ |
|
4348 |
inline TInt RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const |
|
4349 |
{return DoSendReceive(aFunction,&aArgs);} |
|
4350 |
||
4351 |
||
4352 |
||
4353 |
||
4354 |
/** |
|
4355 |
Sends a blind message to the server - no reply is expected. |
|
4356 |
||
4357 |
This variant sends no message arguments to the server. |
|
4358 |
||
4359 |
@param aFunction The opcode specifying the requested service. |
|
4360 |
||
4361 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
4362 |
*/ |
|
4363 |
inline TInt RSubSessionBase::Send(TInt aFunction) const |
|
4364 |
{return DoSend(aFunction,NULL);} |
|
4365 |
||
4366 |
||
4367 |
||
4368 |
||
4369 |
/** |
|
4370 |
Sends a message to the server and waits asynchronously for the reply. |
|
4371 |
||
4372 |
An opcode specifies the service required. |
|
4373 |
This variant sends no message arguments to the server. |
|
4374 |
||
4375 |
@param aFunction The opcode specifying the requested service. |
|
4376 |
@param aStatus A request status which indicates the completion status of the asynchronous request. |
|
4377 |
*/ |
|
4378 |
inline void RSubSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const |
|
4379 |
{ DoSendReceive(aFunction,NULL,aStatus);} |
|
4380 |
||
4381 |
||
4382 |
||
4383 |
||
4384 |
/** |
|
4385 |
Sends a message to the server and waits synchronously for a reply. |
|
4386 |
||
4387 |
An opcode specifies the service required. |
|
4388 |
This variant sends no message arguments to the server. |
|
4389 |
||
4390 |
@param aFunction The opcode specifying the requested service. |
|
4391 |
||
4392 |
@return KErrNone if successful, otherwise one of the system-wide error codes. |
|
4393 |
*/ |
|
4394 |
inline TInt RSubSessionBase::SendReceive(TInt aFunction) const |
|
4395 |
{return DoSendReceive(aFunction,NULL);} |
|
4396 |
||
4397 |
||
4398 |
||
4399 |
||
4400 |
// Class RRefBase |
|
4401 |
||
4402 |
/** |
|
4403 |
Default constructor. |
|
4404 |
*/ |
|
4405 |
inline RRefBase::RRefBase() |
|
4406 |
: iPtr(NULL) |
|
4407 |
{} |
|
4408 |
||
4409 |
||
4410 |
||
4411 |
/** |
|
4412 |
Copy constructor. |
|
4413 |
||
4414 |
@param aRef A reference to the object to be copied. |
|
4415 |
*/ |
|
4416 |
inline RRefBase::RRefBase(const RRefBase &aRef) |
|
4417 |
{Copy(aRef);} |
|
4418 |
||
4419 |
||
4420 |
||
4421 |
||
4422 |
// Class RRef |
|
4423 |
||
4424 |
||
4425 |
/** |
|
4426 |
Default constructor. |
|
4427 |
*/ |
|
4428 |
template <class T> |
|
4429 |
inline RRef<T>::RRef() |
|
4430 |
{} |
|
4431 |
||
4432 |
||
4433 |
||
4434 |
/** |
|
4435 |
Copy constructor. |
|
4436 |
||
4437 |
The constructor frees any existing contained object, and takes ownership of |
|
4438 |
the object owned by anObject. |
|
4439 |
||
4440 |
@param anObject A reference to another 'reference' object. |
|
4441 |
On return from this constructor, anObject may be safely |
|
4442 |
orphaned if it lives on the program stack. |
|
4443 |
*/ |
|
4444 |
template <class T> |
|
4445 |
inline RRef<T>::RRef(const RRef<T> &anObject) |
|
4446 |
{Copy(anObject);} |
|
4447 |
||
4448 |
||
4449 |
||
4450 |
||
4451 |
/** |
|
4452 |
Assignment operator. |
|
4453 |
||
4454 |
The constructor frees any existing contained object, and takes ownership of |
|
4455 |
the object owned by anObject. |
|
4456 |
||
4457 |
@param anObject A reference to another 'reference' object. |
|
4458 |
On return from this constructor, anObject may be safely |
|
4459 |
orphaned if it lives on the program stack. |
|
4460 |
*/ |
|
4461 |
template <class T> |
|
4462 |
inline void RRef<T>::operator=(const RRef<T> &anObject) |
|
4463 |
{Copy(anObject);} |
|
4464 |
||
4465 |
||
4466 |
||
4467 |
||
4468 |
/** |
|
4469 |
Gets a pointer to the contained object. |
|
4470 |
||
4471 |
@return A pointer to the contained object |
|
4472 |
*/ |
|
4473 |
template <class T> |
|
4474 |
inline T *RRef<T>::operator->() |
|
4475 |
{return((T *)iPtr);} |
|
4476 |
||
4477 |
||
4478 |
||
4479 |
||
4480 |
/** |
|
4481 |
Gets a pointer to the contained object. |
|
4482 |
||
4483 |
@return A pointer to the contained object |
|
4484 |
*/ |
|
4485 |
template <class T> |
|
4486 |
inline RRef<T>::operator T*() |
|
4487 |
{return((T *)iPtr);} |
|
4488 |
||
4489 |
||
4490 |
||
4491 |
||
4492 |
/** |
|
4493 |
Creates a copy of the specified object, which is to be contained by |
|
4494 |
this reference object. |
|
4495 |
||
4496 |
The amount of memory set aside to contain the object is defined by the size |
|
4497 |
of the object |
|
4498 |
||
4499 |
@param anObject The object to be packaged up by this reference object. |
|
4500 |
*/ |
|
4501 |
template <class T> |
|
4502 |
void RRef<T>::Alloc(const T &anObject) |
|
4503 |
{DoAlloc(&anObject,sizeof(T));} |
|
4504 |
||
4505 |
||
4506 |
||
4507 |
||
4508 |
/** |
|
4509 |
Creates a copy of the specified object, which is to be contained by |
|
4510 |
this reference object. |
|
4511 |
||
4512 |
The amount of memory set aside to contain the object is defined by aSize. |
|
4513 |
||
4514 |
@param anObject The object to be packaged up by this reference object. |
|
4515 |
@param aSize The amount of memory to be set aside to contain the object. |
|
4516 |
You must make sure that this is big enough. |
|
4517 |
*/ |
|
4518 |
template <class T> |
|
4519 |
void RRef<T>::Alloc(const T &anObject,TInt aSize) |
|
4520 |
{DoAlloc(&anObject,aSize);} |
|
4521 |
||
4522 |
||
4523 |
||
4524 |
||
4525 |
/** |
|
4526 |
Creates a copy of the specified object, which is to be contained by |
|
4527 |
this reference object, and leaves on failure. |
|
4528 |
||
4529 |
The amount of memory set aside to contain the object is defined by the size |
|
4530 |
of the object |
|
4531 |
||
4532 |
@param anObject The object to be packaged up by this reference object. |
|
4533 |
*/ |
|
4534 |
template <class T> |
|
4535 |
void RRef<T>::AllocL(const T &anObject) |
|
4536 |
{DoAllocL(&anObject,sizeof(T));} |
|
4537 |
||
4538 |
||
4539 |
||
4540 |
||
4541 |
/** |
|
4542 |
Creates a copy of the specified object, which is to be contained by |
|
4543 |
this reference object, and leaves on failure. |
|
4544 |
||
4545 |
The amount of memory set aside to contain the object is defined by aSize. |
|
4546 |
||
4547 |
@param anObject The object to be packaged up by this reference object. |
|
4548 |
@param aSize The amount of memory to be set aside to contain the object. |
|
4549 |
You must make sure that this is big enough. |
|
4550 |
*/ |
|
4551 |
template <class T> |
|
4552 |
void RRef<T>::AllocL(const T &anObject,TInt aSize) |
|
4553 |
{DoAllocL(&anObject,aSize);} |
|
4554 |
||
4555 |
||
4556 |
||
4557 |
||
4558 |
// Class TRegion |
|
4559 |
inline TBool TRegion::CheckError() const |
|
4560 |
/** |
|
4561 |
Tests whether the region's error flag is set. |
|
4562 |
||
4563 |
The error flag may be set: |
|
4564 |
||
4565 |
1. when an attempt to allocate more memory for the region fails |
|
4566 |
||
4567 |
2. if an attempt is made to expand a fixed size region beyond its allocated |
|
4568 |
size |
|
4569 |
||
4570 |
3. if ForceError() has been called. |
|
4571 |
||
4572 |
Use Clear() to unset the error flag, clear the region and free all allocated |
|
4573 |
memory. |
|
4574 |
||
4575 |
@return True, if the error flag is set; false, otherwise. |
|
4576 |
||
4577 |
@see TRegion::ForceError |
|
4578 |
@see TRegion::Clear |
|
4579 |
*/ |
|
4580 |
{return(iError);} |
|
4581 |
||
4582 |
||
4583 |
||
4584 |
||
4585 |
inline TInt TRegion::Count() const |
|
4586 |
/** |
|
4587 |
Gets the number of rectangles in this region. |
|
4588 |
||
4589 |
@return The number of rectangles. |
|
4590 |
*/ |
|
4591 |
{return(iCount);} |
|
4592 |
||
4593 |
||
4594 |
||
4595 |
||
4596 |
inline const TRect *TRegion::RectangleList() const |
|
4597 |
/** |
|
4598 |
Gets a pointer to the array of rectangles defining this region. |
|
4599 |
||
4600 |
@return Pointer to the array of rectangles. Note that array is a standard |
|
4601 |
C++ array, i.e. a concatenated set of TRect objects. Use Count() to |
|
4602 |
get the number of rectangles. |
|
4603 |
||
4604 |
@see TRegion::Count |
|
4605 |
*/ |
|
4606 |
{return(((TRegion *)this)->RectangleListW());} |
|
4607 |
||
4608 |
||
4609 |
||
4610 |
||
4611 |
inline TRegion::TRegion() |
|
4612 |
{} |
|
4613 |
||
4614 |
||
4615 |
||
4616 |
||
4617 |
// Class RRegion |
|
4618 |
inline TInt RRegion::CheckSpare() const |
|
4619 |
/** |
|
4620 |
Gets the number of free memory slots in the region. |
|
4621 |
||
4622 |
This is the number of slots which have been allocated, minus the number in |
|
4623 |
use. |
|
4624 |
||
4625 |
@return The number of free memory slots in the region. |
|
4626 |
*/ |
|
4627 |
{return(iAllocedRects-iCount);} |
|
4628 |
||
4629 |
||
4630 |
||
4631 |
||
4632 |
// Class TRegionFix |
|
4633 |
template <TInt S> |
|
4634 |
inline TRegionFix<S>::TRegionFix() : TRegion(-S) |
|
4635 |
/** |
|
4636 |
Constructs a default fixed size region. |
|
4637 |
*/ |
|
4638 |
{} |
|
4639 |
||
4640 |
||
4641 |
||
4642 |
||
4643 |
template <TInt S> |
|
4644 |
inline TRegionFix<S>::TRegionFix(const TRect &aRect) : TRegion(-S) |
|
4645 |
/** |
|
4646 |
Constructs a fixed size region with a TRect. |
|
4647 |
||
4648 |
@param aRect Rectangle to be added to the newly constructed region. |
|
4649 |
*/ |
|
4650 |
{AddRect(aRect);} |
|
4651 |
||
4652 |
||
4653 |
||
4654 |
||
4655 |
template <TInt S> |
|
4656 |
inline TRegionFix<S>::TRegionFix(const TRegionFix<S> &aRegion) |
|
4657 |
/** |
|
4658 |
Copy constructor. |
|
4659 |
||
4660 |
@param aRegion The TRegionFix object to be copied. |
|
4661 |
*/ |
|
4662 |
{*this=aRegion;} |
|
4663 |
||
4664 |
||
4665 |
||
4666 |
||
4667 |
template <TInt S> |
|
4668 |
inline RRegionBuf<S>::RRegionBuf() : RRegion(-S&(~ERRegionBuf),S) |
|
4669 |
/** |
|
4670 |
Constructs a default object. |
|
4671 |
||
4672 |
The granularity is the value of the template parameter. |
|
4673 |
*/ |
|
4674 |
{} |
|
4675 |
||
4676 |
||
4677 |
||
4678 |
template <TInt S> |
|
4679 |
inline RRegionBuf<S>::RRegionBuf(const RRegion &aRegion) |
|
4680 |
/** |
|
4681 |
Constructs this object from the specified RRegion. |
|
4682 |
||
4683 |
@param aRegion The region to assign to this RRegionBuf. |
|
4684 |
*/ |
|
4685 |
{*this=aRegion;} |
|
4686 |
||
4687 |
||
4688 |
||
4689 |
||
4690 |
template <TInt S> |
|
4691 |
inline RRegionBuf<S>::RRegionBuf(const TRect &aRect) : RRegion(-S&(~ERRegionBuf),S) |
|
4692 |
/** |
|
4693 |
Constructs an RRegionBuf with a TRect. |
|
4694 |
||
4695 |
Its granularity is initialised to the value contained in the template argument. |
|
4696 |
The resulting region consists of the specified single rectangle. |
|
4697 |
||
4698 |
@param aRect The single rectangle with which to initialise the region. |
|
4699 |
*/ |
|
4700 |
{AddRect(aRect);} |
|
4701 |
||
4702 |
||
4703 |
||
4704 |
||
4705 |
template <TInt S> |
|
4706 |
inline RRegionBuf<S>::RRegionBuf(const RRegionBuf<S> &aRegion) |
|
4707 |
/** |
|
4708 |
Copy constructs from an existing RRegionBuf object. |
|
4709 |
||
4710 |
@param aRegion The RRegionBuf to be copied. |
|
4711 |
*/ |
|
4712 |
{*this=aRegion;} |
|
4713 |
||
4714 |
||
4715 |
||
4716 |
||
4717 |
// enum TTimerLockSpec |
|
4718 |
inline TTimerLockSpec &operator++(TTimerLockSpec &aLock) |
|
4719 |
{ |
|
4720 |
return aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1)); |
|
4721 |
} |
|
4722 |
inline TTimerLockSpec operator++(TTimerLockSpec &aLock, TInt) |
|
4723 |
{ |
|
4724 |
TTimerLockSpec l=aLock; |
|
4725 |
aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1)); |
|
4726 |
return l; |
|
4727 |
} |
|
4728 |
||
4729 |
||
4730 |
||
4731 |
||
4732 |
// Class TCheckedUid |
|
4733 |
inline const TUidType& TCheckedUid::UidType() const |
|
4734 |
/** |
|
4735 |
Gets the Uid type contained in this object. |
|
4736 |
||
4737 |
@return The Uid type. |
|
4738 |
*/ |
|
4739 |
{return(iType);} |
|
4740 |
||
4741 |
||
4742 |
||
4743 |
||
4744 |
// Array deletion support, uses CBase deletion (virtual d'tor) for all C-classes |
|
4745 |
template <class T> |
|
4746 |
/** @internalComponent |
|
4747 |
*/ |
|
4748 |
void _DeleteArray(T** aBegin,T** aEnd) |
|
4749 |
{for (;;) if (aBegin<aEnd) delete *aBegin++; else return;} |
|
4750 |
||
4751 |
template <class T> |
|
4752 |
/** @internalComponent |
|
4753 |
*/ |
|
4754 |
struct _ArrayUtil |
|
4755 |
{ |
|
4756 |
static inline void Delete(T* aBegin,T* aEnd,CBase*) |
|
4757 |
{::_DeleteArray((CBase**)aBegin,(CBase**)aEnd);} |
|
4758 |
static inline void Delete(T* aBegin,T* aEnd,TAny*) |
|
4759 |
{::_DeleteArray(aBegin,aEnd);} |
|
4760 |
static inline void Delete(T* aArray,TInt aCount) |
|
4761 |
{Delete(aArray,aArray+aCount,*aArray);} |
|
4762 |
}; |
|
4763 |
||
4764 |
||
4765 |
||
4766 |
||
4767 |
#ifndef __TOOLS__ |
|
4768 |
// Template class TFixedArray |
|
4769 |
IMPORT_C void PanicTFixedArray(); |
|
4770 |
||
4771 |
||
4772 |
||
4773 |
||
4774 |
template <class T,TInt S> |
|
4775 |
inline TFixedArray<T,S>::TFixedArray() |
|
4776 |
/** |
|
4777 |
Default constructor. |
|
4778 |
||
4779 |
Constructs an uninitialised C++ array. |
|
4780 |
*/ |
|
4781 |
{} |
|
4782 |
||
4783 |
||
4784 |
||
4785 |
||
4786 |
template <class T,TInt S> |
|
4787 |
inline void TFixedArray<T,S>::Copy(const T* aList,TInt aLength) |
|
4788 |
/** |
|
4789 |
Copies the specified set of contiguous objects into the C++ array. |
|
4790 |
||
4791 |
The copy operation starts at the beginning of the array, replacing |
|
4792 |
any existing data. |
|
4793 |
||
4794 |
@param aList A pointer to a set of contiguous objects. |
|
4795 |
@param aLength The number of contiguous objects to be copied. This value must |
|
4796 |
not be negative and must not be greater than the size of the |
|
4797 |
array as defined by the integer template parameter. |
|
4798 |
||
4799 |
@panic USER 133, in a debug build only, if aLength is negative or is greater |
|
4800 |
than the size of the array as defined by the integer template parameter. |
|
4801 |
*/ |
|
4802 |
{__ASSERT_DEBUG(TUint(aLength)<=TUint(S),PanicTFixedArray());Mem::Copy(iRep,aList,aLength*sizeof(T));} |
|
4803 |
||
4804 |
||
4805 |
||
4806 |
||
4807 |
template <class T,TInt S> |
|
4808 |
inline TFixedArray<T,S>::TFixedArray(const T* aList,TInt aLength) |
|
4809 |
/** |
|
4810 |
Constructs a C++ array initialised with the specified objects. |
|
4811 |
||
4812 |
@param aList A pointer to a set of contiguous objects. |
|
4813 |
@param aLength The number of contiguous objects to be copied. This value must |
|
4814 |
not be negative and must not be greater than the size of the |
|
4815 |
array as defined by the integer template parameter. |
|
4816 |
||
4817 |
@panic USER 133, in a debug build only, if aLength is negative or is greater |
|
4818 |
than the size of the array as defined by the integer template parameter. |
|
4819 |
*/ |
|
4820 |
{Copy(aList,aLength);} |
|
4821 |
||
4822 |
||
4823 |
||
4824 |
||
4825 |
template <class T,TInt S> |
|
4826 |
inline void TFixedArray<T,S>::Reset() |
|
4827 |
/** |
|
4828 |
Fills every element of the array with binary zeroes. |
|
4829 |
*/ |
|
4830 |
{Mem::FillZ(iRep,sizeof(iRep));} |
|
4831 |
||
4832 |
||
4833 |
||
4834 |
||
4835 |
template <class T,TInt S> |
|
4836 |
inline TInt TFixedArray<T,S>::Count() const |
|
4837 |
/** |
|
4838 |
Gets the size of the array. |
|
4839 |
||
4840 |
For any instance of this class, the array size |
|
4841 |
is fixed and has the same value as the integer template parameter. |
|
4842 |
||
4843 |
@return The size of the array. |
|
4844 |
*/ |
|
4845 |
{return S;} |
|
4846 |
||
4847 |
||
4848 |
||
4849 |
||
4850 |
template <class T,TInt S> |
|
4851 |
inline TInt TFixedArray<T,S>::Length() const |
|
4852 |
/** |
|
4853 |
Gets the size of an array element, in bytes. |
|
4854 |
||
4855 |
@return The size of an array element, in bytes. |
|
4856 |
*/ |
|
4857 |
{return sizeof(T);} |
|
4858 |
||
4859 |
||
4860 |
||
4861 |
||
4862 |
template <class T,TInt S> |
|
4863 |
inline TBool TFixedArray<T,S>::InRange(TInt aIndex) |
|
4864 |
{return TUint(aIndex)<S;} |
|
4865 |
||
4866 |
||
4867 |
||
4868 |
||
4869 |
template <class T,TInt S> |
|
4870 |
inline T& TFixedArray<T,S>::operator[](TInt aIndex) |
|
4871 |
/** |
|
4872 |
Gets a reference to the specified element within the C++ array. |
|
4873 |
||
4874 |
@param aIndex The position of the element within the array. This is an offset value; |
|
4875 |
a zero value refers to the first element in the array. This value must be |
|
4876 |
greater than or equal to zero and less than the size of the array. |
|
4877 |
||
4878 |
@return A reference to an element of the array. |
|
4879 |
||
4880 |
@panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size |
|
4881 |
of the array as defined by the integer template parameter. |
|
4882 |
*/ |
|
4883 |
{__ASSERT_DEBUG(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];} |
|
4884 |
||
4885 |
||
4886 |
||
4887 |
||
4888 |
template <class T,TInt S> |
|
4889 |
inline const T& TFixedArray<T,S>::operator[](TInt aIndex) const |
|
4890 |
/** |
|
4891 |
Gets a const reference to the specified element within the C++ array. |
|
4892 |
||
4893 |
@param aIndex The position of the element within the array. This is an offset value; |
|
4894 |
a zero value refers to the first element in the array. This value must be |
|
4895 |
greater than or equal to zero and less than the size of the array. |
|
4896 |
||
4897 |
@return A const reference to an element of the array; the element cannot be |
|
4898 |
changed through this reference. |
|
4899 |
||
4900 |
@panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size |
|
4901 |
of the array as defined by the integer template parameter. |
|
4902 |
*/ |
|
4903 |
{return CONST_CAST(ThisClass&,*this)[aIndex];} |
|
4904 |
||
4905 |
||
4906 |
||
4907 |
||
4908 |
template <class T,TInt S> |
|
4909 |
inline T& TFixedArray<T,S>::At(TInt aIndex) |
|
4910 |
/** |
|
4911 |
Gets a reference to the specified element within the C++ array. |
|
4912 |
||
4913 |
@param aIndex The position of the element within the array. This is an offset value; |
|
4914 |
a zero value refers to the first element in the array. This value must be |
|
4915 |
greater than or equal to zero and less than the size of the array. |
|
4916 |
||
4917 |
@return A reference to an element of the array. |
|
4918 |
||
4919 |
@panic USER 133, if aIndex is negative or greater than or equal to the size |
|
4920 |
of the array as defined by the integer template parameter. |
|
4921 |
*/ |
|
4922 |
{__ASSERT_ALWAYS(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];} |
|
4923 |
||
4924 |
||
4925 |
||
4926 |
||
4927 |
template <class T,TInt S> |
|
4928 |
inline const T& TFixedArray<T,S>::At(TInt aIndex) const |
|
4929 |
/** |
|
4930 |
Gets a const reference to the specified element within the C++ array. |
|
4931 |
||
4932 |
@param aIndex The position of the element within the array. This is an offset value; |
|
4933 |
a zero value refers to the first element in the array. This value must be |
|
4934 |
greater than or equal to zero and less than the size of the array. |
|
4935 |
||
4936 |
@return A const reference to an element of the array; the element cannot be |
|
4937 |
changed through this reference. |
|
4938 |
||
4939 |
@panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size |
|
4940 |
of the array as defined by the integer template parameter. |
|
4941 |
*/ |
|
4942 |
{return CONST_CAST(ThisClass&,*this).At(aIndex);} |
|
4943 |
||
4944 |
||
4945 |
||
4946 |
||
4947 |
template <class T,TInt S> |
|
4948 |
inline T* TFixedArray<T,S>::Begin() |
|
4949 |
/** |
|
4950 |
Gets a pointer to the first element of the array. |
|
4951 |
||
4952 |
@return A pointer to the first element of the array. |
|
4953 |
*/ |
|
4954 |
{return &iRep[0];} |
|
4955 |
||
4956 |
||
4957 |
||
4958 |
||
4959 |
template <class T,TInt S> |
|
4960 |
inline T* TFixedArray<T,S>::End() |
|
4961 |
/** |
|
4962 |
Gets a pointer to the first byte following the end of the array. |
|
4963 |
||
4964 |
@return A pointer to the first byte following the end of the array. |
|
4965 |
*/ |
|
4966 |
{return &iRep[S];} |
|
4967 |
||
4968 |
||
4969 |
||
4970 |
||
4971 |
template <class T,TInt S> |
|
4972 |
inline const T* TFixedArray<T,S>::Begin() const |
|
4973 |
/** |
|
4974 |
Gets a pointer to the first element of the array. |
|
4975 |
||
4976 |
@return A pointer to a const element of the array. |
|
4977 |
*/ |
|
4978 |
{return &iRep[0];} |
|
4979 |
||
4980 |
||
4981 |
||
4982 |
||
4983 |
template <class T,TInt S> |
|
4984 |
inline const T* TFixedArray<T,S>::End() const |
|
4985 |
/** |
|
4986 |
Gets a pointer to the first byte following the end of the array. |
|
4987 |
||
4988 |
@return A pointer to the const first byte following the end of the array. |
|
4989 |
*/ |
|
4990 |
{return &iRep[S];} |
|
4991 |
||
4992 |
||
4993 |
||
4994 |
||
4995 |
template <class T,TInt S> |
|
4996 |
inline TInt TFixedArray<T,S>::CountFunctionR(const CBase*) |
|
4997 |
{return S;} |
|
4998 |
||
4999 |
||
5000 |
||
5001 |
||
5002 |
template <class T,TInt S> |
|
5003 |
inline const TAny* TFixedArray<T,S>::AtFunctionR(const CBase* aThis,TInt aIndex) |
|
5004 |
{return &REINTERPRET_CAST(const ThisClass&,*aThis)[aIndex];} |
|
5005 |
||
5006 |
||
5007 |
||
5008 |
||
5009 |
template <class T,TInt S> |
|
5010 |
inline TArray<T> TFixedArray<T,S>::Array() const |
|
5011 |
/** |
|
5012 |
Creates and returns a generic array for this C++ array. |
|
5013 |
||
5014 |
@return A generic array for this C++ array. |
|
5015 |
*/ |
|
5016 |
{return TArray<T>(CountFunctionR,AtFunctionR,REINTERPRET_CAST(const CBase*,this));} |
|
5017 |
||
5018 |
||
5019 |
||
5020 |
||
5021 |
template <class T,TInt S> |
|
5022 |
inline void TFixedArray<T,S>::DeleteAll() |
|
5023 |
/** |
|
5024 |
Invokes the delete operator on every member of the array. |
|
5025 |
||
5026 |
The function can only be used for arrays of pointers to CBase derived objects. |
|
5027 |
||
5028 |
If the array is to be used after a call to this function, it is good practice |
|
5029 |
to call TFixedArray<class T,TInt S>::Reset() to set all array elements to |
|
5030 |
NULL. |
|
5031 |
*/ |
|
5032 |
{_ArrayUtil<T>::Delete(iRep,S);} |
|
5033 |
#endif |
|
5034 |
||
5035 |
||
5036 |
||
5037 |
||
5038 |
// class User |
|
5039 |
||
5040 |
inline RHeap* User::SwitchHeap(RAllocator* aHeap) |
|
5041 |
/** |
|
5042 |
Changes the current thread's heap. |
|
5043 |
||
5044 |
@param aHeap A pointer to the new heap handle. |
|
5045 |
||
5046 |
@return A pointer to the old heap handle. |
|
5047 |
*/ |
|
5048 |
{ return (RHeap*)SwitchAllocator(aHeap); } |
|
5049 |
||
5050 |
||
5051 |
||
5052 |
||
5053 |
inline RHeap& User::Heap() |
|
5054 |
/** |
|
5055 |
Gets a reference to the handle to the current thread's heap. |
|
5056 |
||
5057 |
@return A reference to the handle to the current thread's heap. |
|
5058 |
*/ |
|
5059 |
{ return (RHeap&)Allocator(); } |
|
5060 |
||
5061 |
||
5062 |
||
5063 |
||
5064 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
5065 |
||
5066 |
inline TBool User::CreatorHasCapability(TCapability aCapability, const char* aDiagnostic) |
|
5067 |
{ |
|
5068 |
return DoCreatorHasCapability(aCapability, aDiagnostic); |
|
5069 |
} |
|
5070 |
||
5071 |
inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) |
|
5072 |
{ |
|
5073 |
return DoCreatorHasCapability(aCapability1, aCapability2, aDiagnostic); |
|
5074 |
} |
|
5075 |
||
5076 |
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
5077 |
||
5078 |
// Only available to NULL arguments |
|
5079 |
inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) |
|
5080 |
{ |
|
5081 |
return DoCreatorHasCapability(aCapability); |
|
5082 |
} |
|
5083 |
||
5084 |
inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) |
|
5085 |
{ |
|
5086 |
return DoCreatorHasCapability(aCapability1, aCapability2); |
|
5087 |
} |
|
5088 |
||
5089 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__ |
|
5090 |
// For things using KSuppressPlatSecDiagnostic |
|
5091 |
inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) |
|
5092 |
{ |
|
5093 |
return DoCreatorHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue); |
|
5094 |
} |
|
5095 |
||
5096 |
inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) |
|
5097 |
{ |
|
5098 |
return DoCreatorHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue); |
|
5099 |
} |
|
5100 |
||
5101 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__ |
|
5102 |
||
5103 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
5104 |
||
5105 |
||
5106 |
inline const TAny* User::LeaveIfNull(const TAny* aPtr) |
|
5107 |
/** |
|
5108 |
Leaves with the reason code KErrNoMemory, if the specified pointer is NULL. |
|
5109 |
||
5110 |
If the pointer is not NULL, the function simply returns with the value of |
|
5111 |
the pointer. |
|
5112 |
||
5113 |
Used to check pointers to const objects. |
|
5114 |
||
5115 |
@param aPtr The pointer to be tested. |
|
5116 |
||
5117 |
@return If the function returns, the value of aPtr. |
|
5118 |
*/ |
|
5119 |
{ return (const TAny*)LeaveIfNull((TAny*)aPtr); } |
|
5120 |
||
5121 |
/** Sets this TSecurityInfo to the security attributes of this process. */ |
|
5122 |
inline void TSecurityInfo::SetToCurrentInfo() |
|
5123 |
{ new (this) TSecurityInfo(RProcess()); } |
|
5124 |
||
5125 |
/** Constructs a TSecurityInfo using the security attributes of aProcess */ |
|
5126 |
inline void TSecurityInfo::Set(RProcess aProcess) |
|
5127 |
{ new (this) TSecurityInfo(aProcess); } |
|
5128 |
||
5129 |
/** Constructs a TSecurityInfo using the security attributes of the process |
|
5130 |
owning aThread |
|
5131 |
*/ |
|
5132 |
inline void TSecurityInfo::Set(RThread aThread) |
|
5133 |
{ new (this) TSecurityInfo(aThread); } |
|
5134 |
||
5135 |
/** Constructs a TSecurityInfo using the security attributes of the process |
|
5136 |
which sent the message aMsgPtr */ |
|
5137 |
inline void TSecurityInfo::Set(RMessagePtr2 aMsgPtr) |
|
5138 |
{ new (this) TSecurityInfo(aMsgPtr); } |
|
5139 |
||
5140 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
5141 |
||
5142 |
/** Checks this policy against the platform security attributes of aProcess. |
|
5143 |
||
5144 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5145 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5146 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5147 |
check failed. |
|
5148 |
||
5149 |
@param aProcess The RProcess object to check against this TSecurityPolicy. |
|
5150 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5151 |
that may be issued if the policy check fails. |
|
5152 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5153 |
which enables it to be easily removed from the system. |
|
5154 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5155 |
platform security attributes of aProcess, EFalse otherwise. |
|
5156 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5157 |
*/ |
|
5158 |
inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const |
|
5159 |
{ |
|
5160 |
return DoCheckPolicy(aProcess, aDiagnostic); |
|
5161 |
} |
|
5162 |
||
5163 |
/** Checks this policy against the platform security attributes of the process |
|
5164 |
owning aThread. |
|
5165 |
||
5166 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5167 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5168 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5169 |
check failed. |
|
5170 |
||
5171 |
@param aThread The thread whose owning process' platform security attributes |
|
5172 |
are to be checked against this TSecurityPolicy. |
|
5173 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5174 |
that may be issued if the policy check fails. |
|
5175 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5176 |
which enables it to be easily removed from the system. |
|
5177 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5178 |
platform security parameters of the owning process of aThread, EFalse otherwise. |
|
5179 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5180 |
*/ |
|
5181 |
inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const |
|
5182 |
{ |
|
5183 |
return DoCheckPolicy(aThread, aDiagnostic); |
|
5184 |
} |
|
5185 |
||
5186 |
/** Checks this policy against the platform security attributes of the process which sent |
|
5187 |
the given message. |
|
5188 |
||
5189 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5190 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5191 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5192 |
check failed. |
|
5193 |
||
5194 |
@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy. |
|
5195 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5196 |
that may be issued if the policy check fails. |
|
5197 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5198 |
which enables it to be easily removed from the system. |
|
5199 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5200 |
platform security attributes of aMsg, EFalse otherwise. |
|
5201 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5202 |
*/ |
|
5203 |
inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const |
|
5204 |
{ |
|
5205 |
return DoCheckPolicy(aMsgPtr, aDiagnostic); |
|
5206 |
} |
|
5207 |
||
5208 |
/** Checks this policy against the platform security attributes of the process which sent |
|
5209 |
the given message. |
|
5210 |
||
5211 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5212 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5213 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5214 |
check failed. |
|
5215 |
||
5216 |
@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy. |
|
5217 |
@param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs |
|
5218 |
it finds to be missing. |
|
5219 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5220 |
that may be issued if the policy check fails. |
|
5221 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5222 |
which enables it to be easily removed from the system. |
|
5223 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5224 |
platform security attributes of aMsg, EFalse otherwise. |
|
5225 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5226 |
||
5227 |
@internalComponent |
|
5228 |
*/ |
|
5229 |
inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const |
|
5230 |
{ |
|
5231 |
return DoCheckPolicy(aMsgPtr, aMissing, aDiagnostic); |
|
5232 |
} |
|
5233 |
||
5234 |
/** Checks this policy against the platform security attributes of this process' creator. |
|
5235 |
||
5236 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5237 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5238 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5239 |
check failed. |
|
5240 |
||
5241 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5242 |
that may be issued if the policy check fails. |
|
5243 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5244 |
which enables it to be easily removed from the system. |
|
5245 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5246 |
platform security attributes of this process' creator, EFalse otherwise. |
|
5247 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5248 |
*/ |
|
5249 |
inline TBool TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const |
|
5250 |
{ |
|
5251 |
return DoCheckPolicyCreator(aDiagnostic); |
|
5252 |
} |
|
5253 |
||
5254 |
/** |
|
5255 |
@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) |
|
5256 |
*/ |
|
5257 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const |
|
5258 |
{ |
|
5259 |
return (&(*this))->CheckPolicy(aProcess, aDiagnostic); |
|
5260 |
} |
|
5261 |
||
5262 |
/** |
|
5263 |
@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) |
|
5264 |
*/ |
|
5265 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const |
|
5266 |
{ |
|
5267 |
return (&(*this))->CheckPolicy(aThread, aDiagnostic); |
|
5268 |
} |
|
5269 |
||
5270 |
/** |
|
5271 |
@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) |
|
5272 |
*/ |
|
5273 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const |
|
5274 |
{ |
|
5275 |
return (&(*this))->CheckPolicy(aMsgPtr, aDiagnostic); |
|
5276 |
} |
|
5277 |
||
5278 |
/** |
|
5279 |
@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) |
|
5280 |
@internalComponent |
|
5281 |
*/ |
|
5282 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const |
|
5283 |
{ |
|
5284 |
return (&(*this))->CheckPolicy(aMsgPtr, aMissing, aDiagnostic); |
|
5285 |
} |
|
5286 |
||
5287 |
/** |
|
5288 |
@see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) |
|
5289 |
*/ |
|
5290 |
inline TBool TStaticSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const |
|
5291 |
{ |
|
5292 |
return (&(*this))->CheckPolicyCreator(aDiagnostic); |
|
5293 |
} |
|
5294 |
||
5295 |
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
5296 |
||
5297 |
/** Checks this policy against the platform security attributes of aProcess. |
|
5298 |
||
5299 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5300 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5301 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5302 |
check failed. |
|
5303 |
||
5304 |
@param aProcess The RProcess object to check against this TSecurityPolicy. |
|
5305 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5306 |
that may be issued if the policy check fails. |
|
5307 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5308 |
which enables it to be easily removed from the system. |
|
5309 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5310 |
platform security attributes of aProcess, EFalse otherwise. |
|
5311 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5312 |
*/ |
|
5313 |
inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5314 |
{ |
|
5315 |
return DoCheckPolicy(aProcess); |
|
5316 |
} |
|
5317 |
||
5318 |
/** Checks this policy against the platform security attributes of the process |
|
5319 |
owning aThread. |
|
5320 |
||
5321 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5322 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5323 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5324 |
check failed. |
|
5325 |
||
5326 |
@param aThread The thread whose owning process' platform security attributes |
|
5327 |
are to be checked against this TSecurityPolicy. |
|
5328 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5329 |
that may be issued if the policy check fails. |
|
5330 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5331 |
which enables it to be easily removed from the system. |
|
5332 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5333 |
platform security parameters of the owning process of aThread, EFalse otherwise. |
|
5334 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5335 |
*/ |
|
5336 |
inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5337 |
{ |
|
5338 |
return DoCheckPolicy(aThread); |
|
5339 |
} |
|
5340 |
||
5341 |
/** Checks this policy against the platform security attributes of the process which sent |
|
5342 |
the given message. |
|
5343 |
||
5344 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5345 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5346 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5347 |
check failed. |
|
5348 |
||
5349 |
@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy. |
|
5350 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5351 |
that may be issued if the policy check fails. |
|
5352 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5353 |
which enables it to be easily removed from the system. |
|
5354 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5355 |
platform security attributes of aMsg, EFalse otherwise. |
|
5356 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5357 |
*/ |
|
5358 |
inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5359 |
{ |
|
5360 |
return DoCheckPolicy(aMsgPtr); |
|
5361 |
} |
|
5362 |
||
5363 |
/** Checks this policy against the platform security attributes of the process which sent |
|
5364 |
the given message. |
|
5365 |
||
5366 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5367 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5368 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5369 |
check failed. |
|
5370 |
||
5371 |
@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy. |
|
5372 |
@param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs |
|
5373 |
it finds to be missing. |
|
5374 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5375 |
that may be issued if the policy check fails. |
|
5376 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5377 |
which enables it to be easily removed from the system. |
|
5378 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5379 |
platform security attributes of aMsg, EFalse otherwise. |
|
5380 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5381 |
||
5382 |
@internalComponent |
|
5383 |
*/ |
|
5384 |
inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5385 |
{ |
|
5386 |
return DoCheckPolicy(aMsgPtr, aMissing); |
|
5387 |
} |
|
5388 |
||
5389 |
/** Checks this policy against the platform security attributes of this process' creator. |
|
5390 |
||
5391 |
When a check fails the action taken is determined by the system wide Platform Security |
|
5392 |
configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. |
|
5393 |
If PlatSecEnforcement is OFF, then this function will return ETrue even though the |
|
5394 |
check failed. |
|
5395 |
||
5396 |
@param aDiagnostic A string that will be emitted along with any diagnostic message |
|
5397 |
that may be issued if the policy check fails. |
|
5398 |
This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro |
|
5399 |
which enables it to be easily removed from the system. |
|
5400 |
@return ETrue if all the requirements of this TSecurityPolicy are met by the |
|
5401 |
platform security attributes of this process' creator, EFalse otherwise. |
|
5402 |
@panic USER 190 if 'this' is an invalid SSecurityInfo object |
|
5403 |
*/ |
|
5404 |
inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const |
|
5405 |
{ |
|
5406 |
return DoCheckPolicyCreator(); |
|
5407 |
} |
|
5408 |
||
5409 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__ |
|
5410 |
inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5411 |
{ |
|
5412 |
return DoCheckPolicy(aProcess, KSuppressPlatSecDiagnosticMagicValue); |
|
5413 |
} |
|
5414 |
||
5415 |
inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5416 |
{ |
|
5417 |
return DoCheckPolicy(aThread, KSuppressPlatSecDiagnosticMagicValue); |
|
5418 |
} |
|
5419 |
||
5420 |
inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5421 |
{ |
|
5422 |
return DoCheckPolicy(aMsgPtr, KSuppressPlatSecDiagnosticMagicValue); |
|
5423 |
} |
|
5424 |
||
5425 |
inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5426 |
{ |
|
5427 |
return DoCheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnosticMagicValue); |
|
5428 |
} |
|
5429 |
||
5430 |
inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5431 |
{ |
|
5432 |
return DoCheckPolicyCreator(KSuppressPlatSecDiagnosticMagicValue); |
|
5433 |
} |
|
5434 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__ |
|
5435 |
||
5436 |
/** |
|
5437 |
@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) |
|
5438 |
*/ |
|
5439 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5440 |
{ |
|
5441 |
return (&(*this))->CheckPolicy(aProcess); |
|
5442 |
} |
|
5443 |
||
5444 |
/** |
|
5445 |
@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) |
|
5446 |
*/ |
|
5447 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5448 |
{ |
|
5449 |
return (&(*this))->CheckPolicy(aThread); |
|
5450 |
} |
|
5451 |
||
5452 |
/** |
|
5453 |
@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) |
|
5454 |
*/ |
|
5455 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5456 |
{ |
|
5457 |
return (&(*this))->CheckPolicy(aMsgPtr); |
|
5458 |
} |
|
5459 |
||
5460 |
/** |
|
5461 |
@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) |
|
5462 |
@internalComponent |
|
5463 |
*/ |
|
5464 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const |
|
5465 |
{ |
|
5466 |
return (&(*this))->CheckPolicy(aMsgPtr, aMissing); |
|
5467 |
} |
|
5468 |
||
5469 |
/** |
|
5470 |
@see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) |
|
5471 |
*/ |
|
5472 |
inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const |
|
5473 |
{ |
|
5474 |
return (&(*this))->CheckPolicyCreator(); |
|
5475 |
} |
|
5476 |
||
5477 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__ |
|
5478 |
/** |
|
5479 |
@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) |
|
5480 |
*/ |
|
5481 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5482 |
{ |
|
5483 |
return (&(*this))->CheckPolicy(aProcess, KSuppressPlatSecDiagnostic); |
|
5484 |
} |
|
5485 |
||
5486 |
/** |
|
5487 |
@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) |
|
5488 |
*/ |
|
5489 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5490 |
{ |
|
5491 |
return (&(*this))->CheckPolicy(aThread, KSuppressPlatSecDiagnostic); |
|
5492 |
} |
|
5493 |
||
5494 |
/** |
|
5495 |
@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) |
|
5496 |
*/ |
|
5497 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5498 |
{ |
|
5499 |
return (&(*this))->CheckPolicy(aMsgPtr, KSuppressPlatSecDiagnostic); |
|
5500 |
} |
|
5501 |
||
5502 |
/** |
|
5503 |
@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) |
|
5504 |
@internalComponent |
|
5505 |
*/ |
|
5506 |
inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5507 |
{ |
|
5508 |
return (&(*this))->CheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnostic); |
|
5509 |
} |
|
5510 |
||
5511 |
/** |
|
5512 |
@see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) |
|
5513 |
*/ |
|
5514 |
inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
5515 |
{ |
|
5516 |
return (&(*this))->CheckPolicyCreator(KSuppressPlatSecDiagnostic); |
|
5517 |
} |
|
5518 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__ |
|
5519 |
||
5520 |
#endif //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
5521 |
||
5522 |
||
5523 |
||
5524 |
#ifndef __KERNEL_MODE__ |
|
5525 |
||
5526 |
/** |
|
5527 |
Appends an object pointer onto the array. |
|
5528 |
||
5529 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
5530 |
||
5531 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5532 |
||
5533 |
@param anEntry The object pointer to be appended. |
|
5534 |
*/ |
|
5535 |
template <class T> |
|
5536 |
inline void RPointerArray<T>::AppendL(const T* anEntry) |
|
5537 |
{ User::LeaveIfError(Append(anEntry));} |
|
5538 |
||
5539 |
||
5540 |
/** |
|
5541 |
Inserts an object pointer into the array at the specified position. |
|
5542 |
||
5543 |
The function leaves with one of the system wide error codes, if |
|
5544 |
the operation fails. |
|
5545 |
||
5546 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5547 |
||
5548 |
@param anEntry The object pointer to be inserted. |
|
5549 |
@param aPos The position within the array where the object pointer is to be |
|
5550 |
inserted. The position is relative to zero, i.e. zero implies |
|
5551 |
that a pointer is inserted at the beginning of the array. |
|
5552 |
||
5553 |
@panic USER 131, if aPos is negative, or is greater than the number of object |
|
5554 |
pointers currently in the array. |
|
5555 |
*/ |
|
5556 |
template <class T> |
|
5557 |
inline void RPointerArray<T>::InsertL(const T* anEntry, TInt aPos) |
|
5558 |
{ User::LeaveIfError(Insert(anEntry,aPos)); } |
|
5559 |
||
5560 |
||
5561 |
/** |
|
5562 |
Finds the first object pointer in the array which matches the specified object |
|
5563 |
pointer, using a sequential search. |
|
5564 |
||
5565 |
Matching is based on the comparison of pointers. |
|
5566 |
||
5567 |
The find operation always starts at the low index end of the array. There |
|
5568 |
is no assumption about the order of objects in the array. |
|
5569 |
||
5570 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5571 |
||
5572 |
@param anEntry The object pointer to be found. |
|
5573 |
@return The index of the first matching object pointer within the array. |
|
5574 |
@leave KErrNotFound, if no matching object pointer can be found. |
|
5575 |
*/ |
|
5576 |
template <class T> |
|
5577 |
inline TInt RPointerArray<T>::FindL(const T* anEntry) const |
|
5578 |
{ return User::LeaveIfError(Find(anEntry));} |
|
5579 |
||
5580 |
||
5581 |
/** |
|
5582 |
Finds the first object pointer in the array whose object matches the specified |
|
5583 |
object, using a sequential search and a matching algorithm. |
|
5584 |
||
5585 |
The algorithm for determining whether two class T objects match is provided |
|
5586 |
by a function supplied by the caller. |
|
5587 |
||
5588 |
The find operation always starts at the low index end of the array. There |
|
5589 |
is no assumption about the order of objects in the array. |
|
5590 |
||
5591 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5592 |
||
5593 |
@param anEntry The object pointer to be found. |
|
5594 |
@param anIdentity A package encapsulating the function which determines whether |
|
5595 |
two class T objects match. |
|
5596 |
||
5597 |
@return The index of the first matching object pointer within the array. |
|
5598 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5599 |
*/ |
|
5600 |
template <class T> |
|
5601 |
inline TInt RPointerArray<T>::FindL(const T* anEntry, TIdentityRelation<T> anIdentity) const |
|
5602 |
{ return User::LeaveIfError(Find(anEntry, anIdentity));} |
|
5603 |
||
5604 |
||
5605 |
/** |
|
5606 |
Finds the last object pointer in the array which matches the specified object |
|
5607 |
pointer, using a sequential search. |
|
5608 |
||
5609 |
Matching is based on the comparison of pointers. |
|
5610 |
||
5611 |
The find operation always starts at the high index end of the array. There |
|
5612 |
is no assumption about the order of objects in the array. |
|
5613 |
||
5614 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5615 |
||
5616 |
@param anEntry The object pointer to be found. |
|
5617 |
@return The index of the last matching object pointer within the array. |
|
5618 |
@leave KErrNotFound, if no matching object pointer can be found. |
|
5619 |
*/ |
|
5620 |
template <class T> |
|
5621 |
inline TInt RPointerArray<T>::FindReverseL(const T* anEntry) const |
|
5622 |
{ return User::LeaveIfError(FindReverse(anEntry));} |
|
5623 |
||
5624 |
||
5625 |
/** |
|
5626 |
Finds the last object pointer in the array whose object matches the specified |
|
5627 |
object, using a sequential search and a matching algorithm. |
|
5628 |
||
5629 |
The algorithm for determining whether two class T objects match is provided |
|
5630 |
by a function supplied by the caller. |
|
5631 |
||
5632 |
The find operation always starts at the high index end of the array. There |
|
5633 |
is no assumption about the order of objects in the array. |
|
5634 |
||
5635 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5636 |
||
5637 |
@param anEntry The object pointer to be found. |
|
5638 |
@param anIdentity A package encapsulating the function which determines whether |
|
5639 |
two class T objects match. |
|
5640 |
||
5641 |
@return The index of the last matching object pointer within the array. |
|
5642 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5643 |
*/ |
|
5644 |
template <class T> |
|
5645 |
inline TInt RPointerArray<T>::FindReverseL(const T* anEntry, TIdentityRelation<T> anIdentity) const |
|
5646 |
{ return User::LeaveIfError(FindReverse(anEntry, anIdentity));} |
|
5647 |
||
5648 |
||
5649 |
/** |
|
5650 |
Finds the object pointer in the array that matches the specified object |
|
5651 |
pointer, using a binary search technique. |
|
5652 |
||
5653 |
The function assumes that object pointers in the array are in address order. |
|
5654 |
||
5655 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5656 |
||
5657 |
@param anEntry The object pointer to be found. |
|
5658 |
||
5659 |
@return The index of the matching object pointer within the array |
|
5660 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5661 |
*/ |
|
5662 |
template <class T> |
|
5663 |
inline TInt RPointerArray<T>::FindInAddressOrderL(const T* anEntry) const |
|
5664 |
{ return User::LeaveIfError(FindInAddressOrder(anEntry));} |
|
5665 |
||
5666 |
||
5667 |
/** |
|
5668 |
Finds the object pointer in the array whose object matches the specified |
|
5669 |
object, using a binary search technique and an ordering algorithm. |
|
5670 |
||
5671 |
The function assumes that existing object pointers in the array are ordered |
|
5672 |
so that the objects themselves are in object order as determined by an algorithm |
|
5673 |
supplied by the caller and packaged as a TLinearOrder<T>. |
|
5674 |
||
5675 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5676 |
||
5677 |
@param anEntry The object pointer to be found. |
|
5678 |
@param anOrder A package encapsulating the function which determines the order |
|
5679 |
of two class T objects. |
|
5680 |
||
5681 |
@return The index of the matching object pointer within the array. |
|
5682 |
||
5683 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5684 |
*/ |
|
5685 |
template <class T> |
|
5686 |
inline TInt RPointerArray<T>::FindInOrderL(const T* anEntry, TLinearOrder<T> anOrder) const |
|
5687 |
{ return User::LeaveIfError(FindInOrder(anEntry, anOrder));} |
|
5688 |
||
5689 |
||
5690 |
/** |
|
5691 |
Finds the object pointer in the array that matches the specified object |
|
5692 |
pointer, using a binary search technique. |
|
5693 |
||
5694 |
The function assumes that object pointers in the array are in address order. |
|
5695 |
||
5696 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5697 |
||
5698 |
@param anEntry The object pointer to be found. |
|
5699 |
@param anIndex A reference to a TInt into which the |
|
5700 |
function puts an index value: If the function does not leave, |
|
5701 |
this is the index of the matching object pointer within the |
|
5702 |
array. If the function leaves with KErrNotFound, this is the |
|
5703 |
index of the first object pointer within the array which |
|
5704 |
logically follows after anEntry. |
|
5705 |
||
5706 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5707 |
*/ |
|
5708 |
template <class T> |
|
5709 |
inline void RPointerArray<T>::FindInAddressOrderL(const T* anEntry, TInt& anIndex) const |
|
5710 |
{ User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); } |
|
5711 |
||
5712 |
||
5713 |
/** |
|
5714 |
Finds the object pointer in the array whose object matches the specified |
|
5715 |
object, using a binary search technique and an ordering algorithm. |
|
5716 |
||
5717 |
The function assumes that existing object pointers in the array are ordered |
|
5718 |
so that the objects themselves are in object order as determined by an |
|
5719 |
algorithm supplied by the caller and packaged as a TLinearOrder<T>. |
|
5720 |
||
5721 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5722 |
||
5723 |
@param anEntry The object pointer to be found. |
|
5724 |
@param anIndex A TInt supplied by the caller. On return, contains an |
|
5725 |
index value: |
|
5726 |
If the function does not leave, this is the index of the |
|
5727 |
matching object pointer within the array. |
|
5728 |
If the function leaves with KErrNotFound, this is the index of |
|
5729 |
the first object pointer in the array whose object is bigger |
|
5730 |
than the entry being searched for - if no objects pointed to in |
|
5731 |
the array are bigger, then the index value is the same as the |
|
5732 |
total number of object pointers in the array. |
|
5733 |
||
5734 |
@param anOrder A package encapsulating the function which determines the order |
|
5735 |
of two class T objects. |
|
5736 |
||
5737 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5738 |
*/ |
|
5739 |
template <class T> |
|
5740 |
inline void RPointerArray<T>::FindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const |
|
5741 |
{ User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder)); } |
|
5742 |
||
5743 |
||
5744 |
/** |
|
5745 |
Finds the object pointer in the array that matches the specified object |
|
5746 |
pointer, using a binary search technique. |
|
5747 |
||
5748 |
Where there is more than one matching element, it finds the first, the last |
|
5749 |
or any matching element as specified by the value of aMode. |
|
5750 |
||
5751 |
The function assumes that object pointers in the array are in address order. |
|
5752 |
||
5753 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5754 |
||
5755 |
@param anEntry The object pointer to be found. |
|
5756 |
@param aMode Specifies whether to find the first match, the last match or |
|
5757 |
any match, as defined by one of the TArrayFindMode enum values. |
|
5758 |
||
5759 |
@return If there is a matching element, the array index of a matching element - what |
|
5760 |
the index refers to depends on the value of aMode: |
|
5761 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
5762 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
5763 |
if this is EArrayFindMode_Last, then the index refers to first element that follows the |
|
5764 |
last matching element - if the last matching element is also the last element of the array, |
|
5765 |
then the index value is the same as the total number of elements in the array. |
|
5766 |
||
5767 |
@leave KErrNotFound if no matching entry exists. |
|
5768 |
||
5769 |
@see TArrayFindMode |
|
5770 |
*/ |
|
5771 |
template <class T> |
|
5772 |
inline TInt RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt aMode) const |
|
5773 |
{ return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));} |
|
5774 |
||
5775 |
||
5776 |
/** |
|
5777 |
Finds the object pointer in the array whose object matches the specified |
|
5778 |
object, using a binary search technique and an ordering algorithm. |
|
5779 |
||
5780 |
In the case that there is more than one matching element finds the first, last |
|
5781 |
or any match as specified by the value of aMode. |
|
5782 |
||
5783 |
The function assumes that existing object pointers in the array are ordered |
|
5784 |
so that the objects themselves are in object order as determined by an algorithm |
|
5785 |
supplied by the caller and packaged as a TLinearOrder<T> type. |
|
5786 |
||
5787 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5788 |
||
5789 |
@param anEntry The object pointer to be found. |
|
5790 |
@param anOrder A package encapsulating the function which determines the order |
|
5791 |
of two class T objects. |
|
5792 |
@param aMode Specifies whether to find the first match, the last match or any match, |
|
5793 |
as defined by one of the TArrayFindMode enum values. |
|
5794 |
||
5795 |
@return If there is a matching element, the array index of a matching |
|
5796 |
element - what the index refers to depends on the value of aMode: |
|
5797 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
5798 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
5799 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
5800 |
the last matching element - if the last matching element is also the last element of the array, then |
|
5801 |
the index value is the same as the total number of elements in the array. |
|
5802 |
||
5803 |
@leave KErrNotFound if no matching entry exists. |
|
5804 |
||
5805 |
@see TArrayFindMode |
|
5806 |
*/ |
|
5807 |
template <class T> |
|
5808 |
inline TInt RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const |
|
5809 |
{ return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));} |
|
5810 |
||
5811 |
||
5812 |
/** |
|
5813 |
Finds the object pointer in the array that matches the specified object |
|
5814 |
pointer, using a binary search technique. |
|
5815 |
||
5816 |
Where there is more than one matching element, it finds the first, the last or |
|
5817 |
any matching element as specified by the value of aMode. |
|
5818 |
||
5819 |
The function assumes that object pointers in the array are in address order. |
|
5820 |
||
5821 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5822 |
||
5823 |
@param anEntry The object pointer to be found. |
|
5824 |
@param anIndex A TInt type supplied by the caller. On return, it contains an index |
|
5825 |
value depending on whether a match is found and on the value of aMode. |
|
5826 |
If there is no matching element in the array, then this is the index |
|
5827 |
of the first element in the array that is bigger than the element being |
|
5828 |
searched for - if no elements in the array are bigger, then the index |
|
5829 |
value is the same as the total number of elements in the array. |
|
5830 |
If there is a matching element, then what the index refers to depends |
|
5831 |
on the value of aMode: |
|
5832 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
5833 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
5834 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
5835 |
the last matching element - if the last matching element is also the last element |
|
5836 |
of the array, then the index value is the same as the total number of elements in the array. |
|
5837 |
||
5838 |
@param aMode Specifies whether to find the first match, the last match or any match, as defined by |
|
5839 |
one of the TArrayFindMode enum values. |
|
5840 |
||
5841 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5842 |
||
5843 |
@see TArrayFindMode |
|
5844 |
*/ |
|
5845 |
template <class T> |
|
5846 |
inline void RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt& anIndex, TInt aMode) const |
|
5847 |
{ User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); } |
|
5848 |
||
5849 |
||
5850 |
/** |
|
5851 |
Finds the object pointer in the array whose object matches the specified |
|
5852 |
object, using a binary search technique and an ordering algorithm. |
|
5853 |
||
5854 |
Where there is more than one matching element, it finds the first, the last or any |
|
5855 |
matching element as specified by the value of aMode. |
|
5856 |
||
5857 |
The function assumes that existing object pointers in the array are ordered |
|
5858 |
so that the objects themselves are in object order as determined by an |
|
5859 |
algorithm supplied by the caller and packaged as a TLinearOrder<T>. |
|
5860 |
||
5861 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5862 |
||
5863 |
@param anEntry The object pointer to be found. |
|
5864 |
@param anIndex A TInt type supplied by the caller. On return, it contains an index |
|
5865 |
value depending on whether a match is found and on the value of aMode. |
|
5866 |
If there is no matching element in the array, then this is |
|
5867 |
the index of the first element in the array that is bigger than |
|
5868 |
the element being searched for - if no elements in the array are bigger, |
|
5869 |
then the index value is the same as the total number of elements in the array. |
|
5870 |
If there is a matching element, then what the index refers to depends |
|
5871 |
on the value of aMode: |
|
5872 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
5873 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
5874 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
5875 |
the last matching element - if the last matching element is also the last element of |
|
5876 |
the array, then the index value is the same as the total number of elements in the array. |
|
5877 |
||
5878 |
@param anOrder A package encapsulating the function which determines the order |
|
5879 |
of two class T objects. |
|
5880 |
@param aMode Specifies whether to find the first match, the last match or any match, as defined by |
|
5881 |
one of the TArrayFindModeenum values. |
|
5882 |
||
5883 |
@leave KErrNotFound, if no suitable object pointer can be found. |
|
5884 |
||
5885 |
@see TArrayFindMode |
|
5886 |
*/ |
|
5887 |
template <class T> |
|
5888 |
inline void RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const |
|
5889 |
{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode)); } |
|
5890 |
||
5891 |
||
5892 |
/** |
|
5893 |
Inserts an object pointer into the array in address order. |
|
5894 |
||
5895 |
No duplicate entries are permitted. |
|
5896 |
The function assumes that existing object pointers within the array are in |
|
5897 |
address order. |
|
5898 |
||
5899 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
5900 |
||
5901 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5902 |
||
5903 |
@param anEntry The object pointer to be inserted. |
|
5904 |
*/ |
|
5905 |
template <class T> |
|
5906 |
inline void RPointerArray<T>::InsertInAddressOrderL(const T* anEntry) |
|
5907 |
{ User::LeaveIfError(InsertInAddressOrder(anEntry)); } |
|
5908 |
||
5909 |
||
5910 |
/** |
|
5911 |
Inserts an object pointer into the array so that the object itself is in object |
|
5912 |
order. |
|
5913 |
||
5914 |
The algorithm for determining the order of two class T objects is provided |
|
5915 |
by a function supplied by the caller. |
|
5916 |
||
5917 |
No duplicate entries are permitted. |
|
5918 |
||
5919 |
The function assumes that the array is ordered so that the referenced objects |
|
5920 |
are in object order. |
|
5921 |
||
5922 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
5923 |
||
5924 |
Note that the array remains unchanged following an attempt to insert a duplicate |
|
5925 |
entry. |
|
5926 |
||
5927 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5928 |
||
5929 |
@param anEntry The object pointer to be inserted. |
|
5930 |
@param anOrder A package encapsulating the function which determines the order |
|
5931 |
of two class T objects. |
|
5932 |
*/ |
|
5933 |
template <class T> |
|
5934 |
inline void RPointerArray<T>::InsertInOrderL(const T* anEntry, TLinearOrder<T> anOrder) |
|
5935 |
{ User::LeaveIfError(InsertInOrder(anEntry, anOrder)); } |
|
5936 |
||
5937 |
||
5938 |
/** |
|
5939 |
Inserts an object pointer into the array in address order, allowing duplicates. |
|
5940 |
||
5941 |
If the new object pointer is a duplicate of an existing object pointer in |
|
5942 |
the array, then the new pointer is inserted after the existing one. If more |
|
5943 |
than one duplicate object pointer already exists in the array, then any new |
|
5944 |
duplicate pointer is inserted after the last one. |
|
5945 |
||
5946 |
The function assumes that existing object pointers within the array are in |
|
5947 |
address order. |
|
5948 |
||
5949 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
5950 |
||
5951 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5952 |
||
5953 |
@param anEntry The object pointer to be inserted. |
|
5954 |
*/ |
|
5955 |
template <class T> |
|
5956 |
inline void RPointerArray<T>::InsertInAddressOrderAllowRepeatsL(const T* anEntry) |
|
5957 |
{ User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); } |
|
5958 |
||
5959 |
||
5960 |
/** |
|
5961 |
Inserts an object pointer into the array so that the object itself is in object |
|
5962 |
order, allowing duplicates |
|
5963 |
||
5964 |
The algorithm for determining the order of two class T objects is provided |
|
5965 |
by a function supplied by the caller. |
|
5966 |
||
5967 |
If the specified object is a duplicate of an existing object, then the new |
|
5968 |
pointer is inserted after the pointer to the existing object. If more than |
|
5969 |
one duplicate object already exists, then the new pointer is inserted after |
|
5970 |
the pointer to the last one. |
|
5971 |
||
5972 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
5973 |
||
5974 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
5975 |
||
5976 |
@param anEntry The object pointer to be inserted. |
|
5977 |
@param anOrder A package encapsulating the function which determines the order |
|
5978 |
of two class T objects. |
|
5979 |
*/ |
|
5980 |
template <class T> |
|
5981 |
inline void RPointerArray<T>::InsertInOrderAllowRepeatsL(const T* anEntry, TLinearOrder<T> anOrder) |
|
5982 |
{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder)); } |
|
5983 |
||
5984 |
||
5985 |
||
5986 |
/** |
|
5987 |
Reserves space for the specified number of elements. |
|
5988 |
||
5989 |
After a call to this function, the memory allocated to the array is sufficient |
|
5990 |
to hold the number of object pointers specified. Adding new object pointers to the array |
|
5991 |
does not result in a re-allocation of memory until the the total number of |
|
5992 |
pointers exceeds the specified count. |
|
5993 |
||
5994 |
@param aCount The number of object pointers for which space should be reserved |
|
5995 |
@leave KErrNoMemory If the requested amount of memory could not be allocated |
|
5996 |
*/ |
|
5997 |
template <class T> |
|
5998 |
inline void RPointerArray<T>::ReserveL(TInt aCount) |
|
5999 |
{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); } |
|
6000 |
||
6001 |
||
6002 |
||
6003 |
// Specialization for RPointerArray<TAny> |
|
6004 |
||
6005 |
/** |
|
6006 |
Appends an pointer onto the array. |
|
6007 |
||
6008 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6009 |
||
6010 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6011 |
||
6012 |
@param anEntry The pointer to be appended. |
|
6013 |
*/ |
|
6014 |
inline void RPointerArray<TAny>::AppendL(const TAny* anEntry) |
|
6015 |
{ User::LeaveIfError(Append(anEntry));} |
|
6016 |
||
6017 |
||
6018 |
/** |
|
6019 |
Inserts an pointer into the array at the specified position. |
|
6020 |
||
6021 |
The function leaves with one of the system wide error codes, if |
|
6022 |
the operation fails. |
|
6023 |
||
6024 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6025 |
||
6026 |
@param anEntry The pointer to be inserted. |
|
6027 |
@param aPos The position within the array where the pointer is to be |
|
6028 |
inserted. The position is relative to zero, i.e. zero implies |
|
6029 |
that a pointer is inserted at the beginning of the array. |
|
6030 |
||
6031 |
@panic USER 131, if aPos is negative, or is greater than the number of object |
|
6032 |
pointers currently in the array. |
|
6033 |
*/ |
|
6034 |
inline void RPointerArray<TAny>::InsertL(const TAny* anEntry, TInt aPos) |
|
6035 |
{ User::LeaveIfError(Insert(anEntry,aPos)); } |
|
6036 |
||
6037 |
||
6038 |
/** |
|
6039 |
Finds the first pointer in the array which matches the specified pointer, using |
|
6040 |
a sequential search. |
|
6041 |
||
6042 |
Matching is based on the comparison of pointers. |
|
6043 |
||
6044 |
The find operation always starts at the low index end of the array. There |
|
6045 |
is no assumption about the order of objects in the array. |
|
6046 |
||
6047 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6048 |
||
6049 |
@param anEntry The pointer to be found. |
|
6050 |
@return The index of the first matching pointer within the array. |
|
6051 |
@leave KErrNotFound, if no matching pointer can be found. |
|
6052 |
*/ |
|
6053 |
inline TInt RPointerArray<TAny>::FindL(const TAny* anEntry) const |
|
6054 |
{ return User::LeaveIfError(Find(anEntry));} |
|
6055 |
||
6056 |
||
6057 |
/** |
|
6058 |
Finds the last pointer in the array which matches the specified pointer, using |
|
6059 |
a sequential search. |
|
6060 |
||
6061 |
Matching is based on the comparison of pointers. |
|
6062 |
||
6063 |
The find operation always starts at the high index end of the array. There |
|
6064 |
is no assumption about the order of objects in the array. |
|
6065 |
||
6066 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6067 |
||
6068 |
@param anEntry The pointer to be found. |
|
6069 |
@return The index of the last matching pointer within the array. |
|
6070 |
@leave KErrNotFound, if no matching pointer can be found. |
|
6071 |
*/ |
|
6072 |
inline TInt RPointerArray<TAny>::FindReverseL(const TAny* anEntry) const |
|
6073 |
{ return User::LeaveIfError(FindReverse(anEntry));} |
|
6074 |
||
6075 |
||
6076 |
/** |
|
6077 |
Finds the pointer in the array that matches the specified pointer, using a |
|
6078 |
binary search technique. |
|
6079 |
||
6080 |
The function assumes that pointers in the array are in address order. |
|
6081 |
||
6082 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6083 |
||
6084 |
@param anEntry The pointer to be found. |
|
6085 |
||
6086 |
@return The index of the matching pointer within the array |
|
6087 |
@leave KErrNotFound, if no suitable pointer can be found. |
|
6088 |
*/ |
|
6089 |
inline TInt RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry) const |
|
6090 |
{ return User::LeaveIfError(FindInAddressOrder(anEntry));} |
|
6091 |
||
6092 |
||
6093 |
/** |
|
6094 |
Finds the pointer in the array that matches the specified pointer, using a |
|
6095 |
binary search technique. |
|
6096 |
||
6097 |
The function assumes that pointers in the array are in address order. |
|
6098 |
||
6099 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6100 |
||
6101 |
@param anEntry The pointer to be found. |
|
6102 |
@param anIndex A reference to a TInt into which the |
|
6103 |
function puts an index value: If the function does not leave, |
|
6104 |
this is the index of the matching pointer within the array. If the |
|
6105 |
function leaves with KErrNotFound, this is the index of the last |
|
6106 |
pointer within the array which logically precedes |
|
6107 |
anEntry. |
|
6108 |
||
6109 |
@leave KErrNotFound, if no suitable pointer can be found. |
|
6110 |
*/ |
|
6111 |
inline void RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry, TInt& anIndex) const |
|
6112 |
{ User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); } |
|
6113 |
||
6114 |
||
6115 |
/** |
|
6116 |
Finds the pointer in the array that matches the specified pointer, using a |
|
6117 |
binary search technique. |
|
6118 |
||
6119 |
Where there is more than one matching element, it finds the first, the last |
|
6120 |
or any matching element as specified by the value of aMode. |
|
6121 |
||
6122 |
The function assumes that pointers in the array are in address order. |
|
6123 |
||
6124 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6125 |
||
6126 |
@param anEntry The pointer to be found. |
|
6127 |
@param aMode Specifies whether to find the first match, the last match or |
|
6128 |
any match, as defined by one of the TArrayFindMode enum values. |
|
6129 |
||
6130 |
@return If there is a matching element, the array index of a matching element - what |
|
6131 |
the index refers to depends on the value of aMode: |
|
6132 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6133 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6134 |
if this is EArrayFindMode_Last, then the index refers to first element that follows the |
|
6135 |
last matching element - if the last matching element is also the last element of the array, |
|
6136 |
then the index value is the same as the total number of elements in the array. |
|
6137 |
||
6138 |
@leave KErrNotFound if no matching entry exists. |
|
6139 |
||
6140 |
@see TArrayFindMode |
|
6141 |
*/ |
|
6142 |
inline TInt RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt aMode) const |
|
6143 |
{ return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));} |
|
6144 |
||
6145 |
||
6146 |
/** |
|
6147 |
Finds the pointer in the array that matches the specified pointer, using a |
|
6148 |
binary search technique. |
|
6149 |
||
6150 |
Where there is more than one matching element, it finds the first, the last or |
|
6151 |
any matching element as specified by the value of aMode. |
|
6152 |
||
6153 |
The function assumes that pointers in the array are in address order. |
|
6154 |
||
6155 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6156 |
||
6157 |
@param anEntry The pointer to be found. |
|
6158 |
@param anIndex A TInt type supplied by the caller. On return, it contains an index |
|
6159 |
value depending on whether a match is found and on the value of aMode. |
|
6160 |
If there is no matching element in the array, then this is the index |
|
6161 |
of the first element in the array that is bigger than the element being |
|
6162 |
searched for - if no elements in the array are bigger, then the index |
|
6163 |
value is the same as the total number of elements in the array. |
|
6164 |
If there is a matching element, then what the index refers to depends |
|
6165 |
on the value of aMode: |
|
6166 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6167 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6168 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6169 |
the last matching element - if the last matching element is also the last element |
|
6170 |
of the array, then the index value is the same as the total number of elements in the array. |
|
6171 |
||
6172 |
@param aMode Specifies whether to find the first match, the last match or any match, as defined by |
|
6173 |
one of the TArrayFindMode enum values. |
|
6174 |
||
6175 |
@leave KErrNotFound, if no suitable pointer can be found. |
|
6176 |
||
6177 |
@see TArrayFindMode |
|
6178 |
*/ |
|
6179 |
inline void RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt& anIndex, TInt aMode) const |
|
6180 |
{ User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); } |
|
6181 |
||
6182 |
||
6183 |
/** |
|
6184 |
Inserts an pointer into the array in address order. |
|
6185 |
||
6186 |
No duplicate entries are permitted. The function assumes that existing pointers |
|
6187 |
within the array are in address order. |
|
6188 |
||
6189 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6190 |
||
6191 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6192 |
||
6193 |
@param anEntry The pointer to be inserted. |
|
6194 |
*/ |
|
6195 |
inline void RPointerArray<TAny>::InsertInAddressOrderL(const TAny* anEntry) |
|
6196 |
{ User::LeaveIfError(InsertInAddressOrder(anEntry)); } |
|
6197 |
||
6198 |
||
6199 |
/** |
|
6200 |
Inserts an pointer into the array in address order, allowing duplicates. |
|
6201 |
||
6202 |
If the new pointer is a duplicate of an existing pointer in the array, then the |
|
6203 |
new pointer is inserted after the existing one. If more than one duplicate |
|
6204 |
pointer already exists in the array, then any new duplicate pointer is inserted |
|
6205 |
after the last one. |
|
6206 |
||
6207 |
The function assumes that existing pointers within the array are in address |
|
6208 |
order. |
|
6209 |
||
6210 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6211 |
||
6212 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6213 |
||
6214 |
@param anEntry The pointer to be inserted. |
|
6215 |
*/ |
|
6216 |
inline void RPointerArray<TAny>::InsertInAddressOrderAllowRepeatsL(const TAny* anEntry) |
|
6217 |
{ User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); } |
|
6218 |
||
6219 |
||
6220 |
/** |
|
6221 |
Apends an object onto the array. |
|
6222 |
||
6223 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6224 |
||
6225 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6226 |
||
6227 |
@param anEntry A reference to the object of type class T to be appended. |
|
6228 |
*/ |
|
6229 |
template <class T> |
|
6230 |
inline void RArray<T>::AppendL(const T& anEntry) |
|
6231 |
{ User::LeaveIfError(Append(anEntry));} |
|
6232 |
||
6233 |
||
6234 |
/** |
|
6235 |
Inserts an object into the array at a specified position. |
|
6236 |
||
6237 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6238 |
||
6239 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6240 |
||
6241 |
@param anEntry The class T object to be inserted. |
|
6242 |
@param aPos The position within the array where the object is to |
|
6243 |
be inserted. The position is relative to zero, i.e. zero |
|
6244 |
implies that an object is inserted at the beginning of |
|
6245 |
the array. |
|
6246 |
||
6247 |
@panic USER 131, if aPos is negative or is greater than the number of objects |
|
6248 |
currently in the array. |
|
6249 |
*/ |
|
6250 |
template <class T> |
|
6251 |
inline void RArray<T>::InsertL(const T& anEntry, TInt aPos) |
|
6252 |
{ User::LeaveIfError(Insert(anEntry, aPos));} |
|
6253 |
||
6254 |
||
6255 |
/** |
|
6256 |
Finds the first object in the array which matches the specified object using |
|
6257 |
a sequential search. |
|
6258 |
||
6259 |
Matching is based on the comparison of a TInt value at the key offset position |
|
6260 |
within the objects. |
|
6261 |
||
6262 |
For classes which define their own equality operator (==), the alternative method |
|
6263 |
FindL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended. |
|
6264 |
||
6265 |
The find operation always starts at the low index end of the array. There |
|
6266 |
is no assumption about the order of objects in the array. |
|
6267 |
||
6268 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6269 |
||
6270 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6271 |
||
6272 |
@return The index of the first matching object within the array. |
|
6273 |
@leave KErrNotFound, if no matching object can be found. |
|
6274 |
*/ |
|
6275 |
template <class T> |
|
6276 |
inline TInt RArray<T>::FindL(const T& anEntry) const |
|
6277 |
{ return User::LeaveIfError(Find(anEntry));} |
|
6278 |
||
6279 |
||
6280 |
/** |
|
6281 |
Finds the first object in the array which matches the specified object using |
|
6282 |
a sequential search and a matching algorithm. |
|
6283 |
||
6284 |
The algorithm for determining whether two class T type objects match is provided |
|
6285 |
by a function supplied by the caller. |
|
6286 |
||
6287 |
Such a function need not be supplied if an equality operator (==) is defined for class T. |
|
6288 |
In this case, default construction of anIdentity provides matching. |
|
6289 |
||
6290 |
See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details. |
|
6291 |
||
6292 |
The find operation always starts at the low index end of the array. There |
|
6293 |
is no assumption about the order of objects in the array. |
|
6294 |
||
6295 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6296 |
||
6297 |
@param anEntry A reference to an object of type class T to be used |
|
6298 |
for matching. |
|
6299 |
@param anIdentity A package encapsulating the function which determines whether |
|
6300 |
two class T type objects match. |
|
6301 |
||
6302 |
@return The index of the first matching object within the array. |
|
6303 |
@leave KErrNotFound, if no matching object can be found. |
|
6304 |
*/ |
|
6305 |
template <class T> |
|
6306 |
inline TInt RArray<T>::FindL(const T& anEntry, TIdentityRelation<T> anIdentity) const |
|
6307 |
{ return User::LeaveIfError(Find(anEntry, anIdentity));} |
|
6308 |
||
6309 |
||
6310 |
/** |
|
6311 |
Finds the last object in the array which matches the specified object using |
|
6312 |
a sequential search. |
|
6313 |
||
6314 |
Matching is based on the comparison of a TInt value at the key offset position |
|
6315 |
within the objects. |
|
6316 |
||
6317 |
For classes which define their own equality operator (==), the alternative method |
|
6318 |
FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended. |
|
6319 |
||
6320 |
The find operation always starts at the high index end of the array. There |
|
6321 |
is no assumption about the order of objects in the array. |
|
6322 |
||
6323 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6324 |
||
6325 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6326 |
||
6327 |
@return The index of the last matching object within the array. |
|
6328 |
@leave KErrNotFound, if no matching object can be found. |
|
6329 |
*/ |
|
6330 |
template <class T> |
|
6331 |
inline TInt RArray<T>::FindReverseL(const T& anEntry) const |
|
6332 |
{ return User::LeaveIfError(FindReverse(anEntry));} |
|
6333 |
||
6334 |
||
6335 |
/** |
|
6336 |
Finds the last object in the array which matches the specified object using |
|
6337 |
a sequential search and a matching algorithm. |
|
6338 |
||
6339 |
The algorithm for determining whether two class T type objects match is provided |
|
6340 |
by a function supplied by the caller. |
|
6341 |
||
6342 |
Such a function need not be supplied if an equality operator (==) is defined for class T. |
|
6343 |
In this case, default construction of anIdentity provides matching. |
|
6344 |
||
6345 |
See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details. |
|
6346 |
||
6347 |
The find operation always starts at the high index end of the array. There |
|
6348 |
is no assumption about the order of objects in the array. |
|
6349 |
||
6350 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6351 |
||
6352 |
@param anEntry A reference to an object of type class T to be used |
|
6353 |
for matching. |
|
6354 |
@param anIdentity A package encapsulating the function which determines whether |
|
6355 |
two class T type objects match. |
|
6356 |
||
6357 |
@return The index of the last matching object within the array. |
|
6358 |
@leave KErrNotFound, if no matching object can be found. |
|
6359 |
*/ |
|
6360 |
template <class T> |
|
6361 |
inline TInt RArray<T>::FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) const |
|
6362 |
{ return User::LeaveIfError(FindReverse(anEntry, anIdentity));} |
|
6363 |
||
6364 |
||
6365 |
/** |
|
6366 |
Finds the object in the array which matches the specified object using a binary |
|
6367 |
search technique. |
|
6368 |
||
6369 |
The function assumes that existing objects within the array are in signed |
|
6370 |
key order. |
|
6371 |
||
6372 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6373 |
||
6374 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6375 |
||
6376 |
@return The index of the matching object within the array. |
|
6377 |
@leave KErrNotFound, if no matching object can be found. |
|
6378 |
*/ |
|
6379 |
template <class T> |
|
6380 |
inline TInt RArray<T>::FindInSignedKeyOrderL(const T& anEntry) const |
|
6381 |
{ return User::LeaveIfError(FindInSignedKeyOrder(anEntry));} |
|
6382 |
||
6383 |
||
6384 |
/** |
|
6385 |
Finds the object in the array which matches the specified object using a binary |
|
6386 |
search technique. |
|
6387 |
||
6388 |
The function assumes that existing objects within the array are in unsigned |
|
6389 |
key order. |
|
6390 |
||
6391 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6392 |
||
6393 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6394 |
||
6395 |
@return The index of the matching object within the array. |
|
6396 |
@leave KErrNotFound, if no matching object can be found. |
|
6397 |
*/ |
|
6398 |
template <class T> |
|
6399 |
inline TInt RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry) const |
|
6400 |
{ return User::LeaveIfError(FindInUnsignedKeyOrder(anEntry));} |
|
6401 |
||
6402 |
||
6403 |
/** |
|
6404 |
Finds the object in the array which matches the specified object using a binary |
|
6405 |
search technique and an ordering algorithm. |
|
6406 |
||
6407 |
The function assumes that existing objects within the array are in object |
|
6408 |
order as determined by an algorithm supplied by the caller and packaged as |
|
6409 |
a TLinearOrder<T>. |
|
6410 |
||
6411 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6412 |
||
6413 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6414 |
@param anOrder A package encapsulating the function which determines the order |
|
6415 |
of two class T objects. |
|
6416 |
||
6417 |
@return The index of the matching object within the array. |
|
6418 |
@leave KErrNotFound if no matching object can be found. |
|
6419 |
*/ |
|
6420 |
template <class T> |
|
6421 |
inline TInt RArray<T>::FindInOrderL(const T& anEntry, TLinearOrder<T> anOrder) const |
|
6422 |
{ return User::LeaveIfError(FindInOrder(anEntry, anOrder));} |
|
6423 |
||
6424 |
||
6425 |
/** |
|
6426 |
Finds the object in the array which matches the specified object using a binary |
|
6427 |
search technique. |
|
6428 |
||
6429 |
The function assumes that existing objects within the array are in signed |
|
6430 |
key order. |
|
6431 |
||
6432 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6433 |
||
6434 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6435 |
@param anIndex On return contains an index value of the matching object within the array. |
|
6436 |
If the function leaves with KErrNotFound,this is the index of the |
|
6437 |
first element in the array whose key is bigger than the key of the |
|
6438 |
element being sought. If there are no elements in the array with |
|
6439 |
a bigger key, then the index value is the same as the total |
|
6440 |
number of elements in the array. |
|
6441 |
@leave KErrNotFound, if no matching object can be found. |
|
6442 |
*/ |
|
6443 |
template <class T> |
|
6444 |
inline void RArray<T>::FindInSignedKeyOrderL(const T& anEntry, TInt& anIndex) const |
|
6445 |
{ User::LeaveIfError(FindInSignedKeyOrder(anEntry, anIndex));} |
|
6446 |
||
6447 |
||
6448 |
/** |
|
6449 |
Finds the object in the array which matches the specified object using a binary |
|
6450 |
search technique. |
|
6451 |
||
6452 |
The function assumes that existing objects within the array are in unsigned |
|
6453 |
key order. |
|
6454 |
||
6455 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6456 |
||
6457 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6458 |
@param anIndex On return contains an index value of the matching object within the array. |
|
6459 |
If the function leaves with KErrNotFound, this is the index of the |
|
6460 |
first element in the array whose key is bigger than the key of the |
|
6461 |
element being sought. If there are no elements in the array with |
|
6462 |
a bigger key, then the index value is the same as the total |
|
6463 |
number of elements in the array. |
|
6464 |
@leave KErrNotFound, if no matching object can be found. |
|
6465 |
*/ |
|
6466 |
template <class T> |
|
6467 |
inline void RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex) const |
|
6468 |
{ User::LeaveIfError(FindInUnsignedKeyOrder(anEntry, anIndex));} |
|
6469 |
||
6470 |
||
6471 |
/** |
|
6472 |
Finds the object in the array which matches the specified object using a binary |
|
6473 |
search technique and an ordering algorithm. |
|
6474 |
||
6475 |
The function assumes that existing objects within the array are in object |
|
6476 |
order as determined by an algorithm supplied by the caller and packaged as |
|
6477 |
a TLinearOrder<T>. |
|
6478 |
||
6479 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6480 |
||
6481 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6482 |
@param anIndex On return contains the index value of the matching object within the array |
|
6483 |
If the function leaves with KErrNotFound, this is the index of |
|
6484 |
the first element in the array that is bigger than the element |
|
6485 |
being searched for - if no elements in the array are bigger, |
|
6486 |
then the index value is the same as the total number of elements |
|
6487 |
in the array. |
|
6488 |
@param anOrder A package encapsulating the function which determines the order |
|
6489 |
of two class T objects. |
|
6490 |
||
6491 |
@leave KErrNotFound if no matching object can be found. |
|
6492 |
*/ |
|
6493 |
template <class T> |
|
6494 |
inline void RArray<T>::FindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const |
|
6495 |
{ User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder));} |
|
6496 |
||
6497 |
||
6498 |
/** |
|
6499 |
Finds the object in the array which matches the specified object using a binary |
|
6500 |
search technique. |
|
6501 |
||
6502 |
The element ordering is determined by a signed 32-bit word |
|
6503 |
(the key) embedded in each array element. In the case that there is more than |
|
6504 |
one matching element, finds the first, last or any match as specified. |
|
6505 |
||
6506 |
The function assumes that existing objects within the array are in signed |
|
6507 |
key order. |
|
6508 |
||
6509 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6510 |
||
6511 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6512 |
@param aMode Specifies whether to find the first match, the last match or |
|
6513 |
any match, as defined by one of the TArrayFindMode enum values. |
|
6514 |
||
6515 |
@return The array index of a matching element - what the index refers to |
|
6516 |
depends on the value of aMode: |
|
6517 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6518 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6519 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6520 |
the last matching element - if the last matching element is also the last element of |
|
6521 |
the array, then the index value is the same as the total number of elements in the array. |
|
6522 |
@leave KErrNotFound if no matching entry exists. |
|
6523 |
||
6524 |
@see TArrayFindMode |
|
6525 |
*/ |
|
6526 |
template <class T> |
|
6527 |
inline TInt RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt aMode) const |
|
6528 |
{ return User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, aMode));} |
|
6529 |
||
6530 |
||
6531 |
/** |
|
6532 |
Finds the object in the array which matches the specified object using a binary |
|
6533 |
search technique. |
|
6534 |
||
6535 |
The element ordering is determined by an unsigned 32-bit word |
|
6536 |
(the key) embedded in each array element. In the case that there is more than |
|
6537 |
one matching element, finds the first, last or any match as specified. |
|
6538 |
||
6539 |
The function assumes that existing objects within the array are in unsigned |
|
6540 |
key order. |
|
6541 |
||
6542 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6543 |
||
6544 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6545 |
@param aMode Specifies whether to find the first match, the last match or any |
|
6546 |
match, as defined by one of the TArrayFindMode enum values. |
|
6547 |
||
6548 |
@return The array index of a matching element - what the index refers to |
|
6549 |
depends on the value of aMode: |
|
6550 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6551 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6552 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6553 |
the last matching element - if the last matching element is also the last element |
|
6554 |
of the array, then the index value is the same as the total number of elements in the array. |
|
6555 |
||
6556 |
@leave KErrNotFound if no matching entry exists. |
|
6557 |
||
6558 |
@see TArrayFindMode |
|
6559 |
*/ |
|
6560 |
template <class T> |
|
6561 |
inline TInt RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt aMode) const |
|
6562 |
{ return User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, aMode));} |
|
6563 |
||
6564 |
||
6565 |
/** |
|
6566 |
Finds the object in the array which matches the specified object using a binary |
|
6567 |
search technique and an ordering algorithm. |
|
6568 |
||
6569 |
Where there is more than one matching element, it finds the first, the last or |
|
6570 |
any matching element as specified by the value of aMode. |
|
6571 |
||
6572 |
The function assumes that existing objects within the array are in object |
|
6573 |
order as determined by an algorithm supplied by the caller and packaged as |
|
6574 |
a TLinearOrder<T> type. |
|
6575 |
||
6576 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6577 |
||
6578 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6579 |
@param anOrder A package encapsulating the function which determines the order |
|
6580 |
of two class T objects. |
|
6581 |
@param aMode Specifies whether to find the first match, the last match or any match, |
|
6582 |
as defined by one of the TArrayFindMode enum values. |
|
6583 |
||
6584 |
@return The array index of a matching element - what the index refers to |
|
6585 |
depends on the value of aMode: |
|
6586 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6587 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6588 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6589 |
the last matching element - if the last matching element is also the last element |
|
6590 |
of the array, then the index value is the same as the total number of elements in the array. |
|
6591 |
||
6592 |
@leave KErrNotFound if no matching entry exists. |
|
6593 |
||
6594 |
@see TArrayFindMode |
|
6595 |
*/ |
|
6596 |
template <class T> |
|
6597 |
inline TInt RArray<T>::SpecificFindInOrderL(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const |
|
6598 |
{ return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));} |
|
6599 |
||
6600 |
||
6601 |
/** |
|
6602 |
Finds the object in the array which matches the specified object using a binary |
|
6603 |
search technique. |
|
6604 |
||
6605 |
The element ordering is determined by a signed 32-bit word |
|
6606 |
(the key) embedded in each array element. In the case that there is more than |
|
6607 |
one matching element, finds the first, last or any match as specified. |
|
6608 |
||
6609 |
The function assumes that existing objects within the array are in signed |
|
6610 |
key order. |
|
6611 |
||
6612 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6613 |
||
6614 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6615 |
@param anIndex A TInt type supplied by the caller. On return, it contains an |
|
6616 |
index value depending on whether a match is found and on the |
|
6617 |
value of aMode. If there is no matching element in the array, |
|
6618 |
then this is the index of the first element in the array that |
|
6619 |
is bigger than the element being searched for - if no elements |
|
6620 |
in the array are bigger, then the index value is the same as |
|
6621 |
the total number of elements in the array. |
|
6622 |
If there is a matching element, then what the index refers to |
|
6623 |
depends on the value of aMode: |
|
6624 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6625 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6626 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6627 |
the last matching element - if the last matching element is also the last element |
|
6628 |
of the array, then the index value is the same as the total number of elements |
|
6629 |
in the array. |
|
6630 |
@param aMode Specifies whether to find the first match, the last match or any match, |
|
6631 |
as defined by one of the TArrayFindMode enum values. |
|
6632 |
||
6633 |
@leave KErrNotFound if no matching entry exists. |
|
6634 |
||
6635 |
@see TArrayFindMode |
|
6636 |
*/ |
|
6637 |
template <class T> |
|
6638 |
inline void RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const |
|
6639 |
{ User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, anIndex, aMode));} |
|
6640 |
||
6641 |
||
6642 |
/** |
|
6643 |
Finds the object in the array which matches the specified object using a binary |
|
6644 |
search technique. |
|
6645 |
||
6646 |
The element ordering is determined by an unsigned 32-bit word |
|
6647 |
(the key) embedded in each array element. In the case that there is more than |
|
6648 |
one matching element, finds the first, last or any match as specified. |
|
6649 |
||
6650 |
The function assumes that existing objects within the array are in unsigned |
|
6651 |
key order. |
|
6652 |
||
6653 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6654 |
||
6655 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6656 |
@param anIndex A TInt type supplied by the caller. On return, it contains an |
|
6657 |
index value depending on whether a match is found and on the |
|
6658 |
value of aMode. If there is no matching element in the array, |
|
6659 |
then this is the index of the first element in the array that |
|
6660 |
is bigger than the element being searched for - if no elements |
|
6661 |
in the array are bigger, then the index value is the same as |
|
6662 |
the total number of elements in the array. If there is a matching |
|
6663 |
element, then what the index refers to depends on the value of aMode: |
|
6664 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6665 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6666 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6667 |
the last matching element - if the last matching element is also the last element |
|
6668 |
of the array, then the index value is the same as the total number of elements in the array. |
|
6669 |
@param aMode Specifies whether to find the first match, the last match or any match, |
|
6670 |
as defined by one of the TArrayFindMode enum values. |
|
6671 |
||
6672 |
@leave KErrNotFound if no matching entry exists. |
|
6673 |
||
6674 |
@see TArrayFindMode |
|
6675 |
*/ |
|
6676 |
template <class T> |
|
6677 |
inline void RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const |
|
6678 |
{ User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, anIndex, aMode));} |
|
6679 |
||
6680 |
||
6681 |
/** |
|
6682 |
Finds the object in the array which matches the specified object using a binary |
|
6683 |
search technique and a specified ordering algorithm. |
|
6684 |
||
6685 |
Where there is more than one matching element, it finds the first, the last or |
|
6686 |
any matching element as specified by the value of aMode. |
|
6687 |
||
6688 |
The function assumes that existing objects within the array are in object |
|
6689 |
order as determined by an algorithm supplied by the caller and packaged as |
|
6690 |
a TLinearOrder<T> type. |
|
6691 |
||
6692 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6693 |
||
6694 |
@param anEntry A reference to an object of type class T to be used for matching. |
|
6695 |
@param anIndex A TInt type supplied by the caller. On return, it contains an |
|
6696 |
index value depending on whether a match is found and on the value |
|
6697 |
of aMode. If there is no matching element in the array, then this is |
|
6698 |
the index of the first element in the array that is bigger than the |
|
6699 |
element being searched for - if no elements in the array are bigger, |
|
6700 |
then the index value is the same as the total number of elements |
|
6701 |
in the array. If there is a matching element, then what the index |
|
6702 |
refers to depends on the value of aMode: |
|
6703 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
6704 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
6705 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
6706 |
the last matching element - if the last matching element is also the last element |
|
6707 |
of the array, then the index value is the same as the total number of elements in the array. |
|
6708 |
||
6709 |
@param anOrder A package encapsulating the function which determines the order |
|
6710 |
of two class T objects. |
|
6711 |
@param aMode Specifies whether to find the first match, the last match or any match, |
|
6712 |
as defined by one of the TArrayFindMode enum values. |
|
6713 |
||
6714 |
@leave KErrNotFound if no matching entry exists. |
|
6715 |
||
6716 |
@see TArrayFindMode |
|
6717 |
*/ |
|
6718 |
template <class T> |
|
6719 |
inline void RArray<T>::SpecificFindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const |
|
6720 |
{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode));} |
|
6721 |
||
6722 |
||
6723 |
/** |
|
6724 |
Inserts an object into the array in ascending signed key order. |
|
6725 |
||
6726 |
The order of two class T type objects is based on comparing a TInt value |
|
6727 |
located at the key offset position within the class T object. |
|
6728 |
||
6729 |
No duplicate entries are permitted. |
|
6730 |
||
6731 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6732 |
||
6733 |
Note that the array remains unchanged following an attempt to insert a duplicate entry. |
|
6734 |
||
6735 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6736 |
||
6737 |
@param anEntry A reference to the object of type class T to be inserted. |
|
6738 |
*/ |
|
6739 |
template <class T> |
|
6740 |
inline void RArray<T>::InsertInSignedKeyOrderL(const T& anEntry) |
|
6741 |
{ User::LeaveIfError(InsertInSignedKeyOrder(anEntry));} |
|
6742 |
||
6743 |
||
6744 |
/** |
|
6745 |
Inserts an object into the array in ascending unsigned key order, not allowing |
|
6746 |
duplicate entries. |
|
6747 |
||
6748 |
The order of two class T type objects is based on comparing a TUint value |
|
6749 |
located at the key offset position within the class T object. |
|
6750 |
||
6751 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6752 |
||
6753 |
Note that the array remains unchanged following an attempt to insert a duplicate entry. |
|
6754 |
||
6755 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6756 |
||
6757 |
@param anEntry A reference to the object of type class T to be inserted. |
|
6758 |
*/ |
|
6759 |
template <class T> |
|
6760 |
inline void RArray<T>::InsertInUnsignedKeyOrderL(const T& anEntry) |
|
6761 |
{ User::LeaveIfError(InsertInUnsignedKeyOrder(anEntry));} |
|
6762 |
||
6763 |
||
6764 |
/** |
|
6765 |
Inserts an object of into the array in object order. |
|
6766 |
||
6767 |
The algorithm for determining the order of two class T type objects is provided |
|
6768 |
by a function supplied by the caller. |
|
6769 |
||
6770 |
No duplicate entries are permitted. |
|
6771 |
||
6772 |
The function assumes that existing objects within the array are in object |
|
6773 |
order. |
|
6774 |
||
6775 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6776 |
||
6777 |
Note that the array remains unchanged following an attempt to insert a duplicate entry. |
|
6778 |
||
6779 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6780 |
||
6781 |
@param anEntry A reference to the object of type class T to be inserted. |
|
6782 |
@param anOrder A package encapsulating the function which determines the order |
|
6783 |
of two class T objects. |
|
6784 |
*/ |
|
6785 |
template <class T> |
|
6786 |
inline void RArray<T>::InsertInOrderL(const T& anEntry, TLinearOrder<T> anOrder) |
|
6787 |
{ User::LeaveIfError(InsertInOrder(anEntry, anOrder));} |
|
6788 |
||
6789 |
||
6790 |
/** |
|
6791 |
Inserts an object into the array in ascending signed key order, |
|
6792 |
allowing duplicates. |
|
6793 |
||
6794 |
The order of two class T type objects is based on comparing a TInt value |
|
6795 |
located at the key offset position within the class T object. |
|
6796 |
||
6797 |
If anEntry is a duplicate of an existing object in the array, then the new |
|
6798 |
object is inserted after the existing object. If more than one duplicate object |
|
6799 |
already exists in the array, then any new duplicate object is inserted after |
|
6800 |
the last one. |
|
6801 |
||
6802 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6803 |
||
6804 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6805 |
||
6806 |
@param anEntry A reference to the object of type class T to be inserted. |
|
6807 |
*/ |
|
6808 |
template <class T> |
|
6809 |
inline void RArray<T>::InsertInSignedKeyOrderAllowRepeatsL(const T& anEntry) |
|
6810 |
{ User::LeaveIfError(InsertInSignedKeyOrderAllowRepeats(anEntry));} |
|
6811 |
||
6812 |
||
6813 |
/** |
|
6814 |
Inserts an object into the array in ascending unsigned key order, allowing |
|
6815 |
duplicates. |
|
6816 |
||
6817 |
The order of two class T type objects is based on comparing a TUint value |
|
6818 |
located at the key offset position within the class T object. |
|
6819 |
||
6820 |
If anEntry is a duplicate of an existing object in the array, then the new |
|
6821 |
object is inserted after the existing object. If more than one duplicate object |
|
6822 |
already exists in the array, then any new duplicate object is inserted after |
|
6823 |
the last one. |
|
6824 |
||
6825 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6826 |
||
6827 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6828 |
||
6829 |
@param anEntry A reference to the object of type class T to be inserted. |
|
6830 |
*/ |
|
6831 |
template <class T> |
|
6832 |
inline void RArray<T>::InsertInUnsignedKeyOrderAllowRepeatsL(const T& anEntry) |
|
6833 |
{ User::LeaveIfError(InsertInUnsignedKeyOrderAllowRepeats(anEntry));} |
|
6834 |
||
6835 |
||
6836 |
/** |
|
6837 |
Inserts an object into the array in object order, allowing duplicates. |
|
6838 |
||
6839 |
The algorithm for determining the order of two class T type objects is provided |
|
6840 |
by a function supplied by the caller. |
|
6841 |
||
6842 |
If anEntry is a duplicate of an existing object in the array, then the new |
|
6843 |
object is inserted after the existing object. If more than one duplicate object |
|
6844 |
already exists in the array, then anEntry is inserted after the last one. |
|
6845 |
||
6846 |
The function assumes that existing objects within the array are in object |
|
6847 |
order. |
|
6848 |
||
6849 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6850 |
||
6851 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6852 |
||
6853 |
@param anEntry A reference to the object of type class T to be inserted. |
|
6854 |
@param anOrder A package encapsulating the function which determines the order |
|
6855 |
of two class T objects. |
|
6856 |
*/ |
|
6857 |
template <class T> |
|
6858 |
inline void RArray<T>::InsertInOrderAllowRepeatsL(const T& anEntry, TLinearOrder<T> anOrder) |
|
6859 |
{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder));} |
|
6860 |
||
6861 |
||
6862 |
||
6863 |
/** |
|
6864 |
Reserves space for the specified number of elements. |
|
6865 |
||
6866 |
After a call to this function, the memory allocated to the array is sufficient |
|
6867 |
to hold the number of objects specified. Adding new objects to the array |
|
6868 |
does not result in a re-allocation of memory until the the total number of |
|
6869 |
objects exceeds the specified count. |
|
6870 |
||
6871 |
@param aCount The number of objects for which space should be reserved |
|
6872 |
@leave KErrNoMemory If the requested amount of memory could not be allocated |
|
6873 |
*/ |
|
6874 |
template <class T> |
|
6875 |
inline void RArray<T>::ReserveL(TInt aCount) |
|
6876 |
{ User::LeaveIfError(RArrayBase::DoReserve(aCount)); } |
|
6877 |
||
6878 |
||
6879 |
||
6880 |
||
6881 |
/** |
|
6882 |
Appends a signed integer onto the array. |
|
6883 |
||
6884 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6885 |
||
6886 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6887 |
||
6888 |
@param anEntry The signed integer to be appended. |
|
6889 |
*/ |
|
6890 |
inline void RArray<TInt>::AppendL(TInt anEntry) |
|
6891 |
{ User::LeaveIfError(Append(anEntry));} |
|
6892 |
||
6893 |
||
6894 |
/** |
|
6895 |
Inserts a signed integer into the array at the specified position. |
|
6896 |
||
6897 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
6898 |
||
6899 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6900 |
||
6901 |
@param anEntry The signed integer to be inserted. |
|
6902 |
@param aPos The position within the array where the signed integer is to be |
|
6903 |
inserted. The position is relative to zero, i.e. zero implies |
|
6904 |
that an entry is inserted at the beginning of the array. |
|
6905 |
||
6906 |
@panic USER 131, if aPos is negative, or is greater than the number of entries |
|
6907 |
currently in the array. |
|
6908 |
*/ |
|
6909 |
inline void RArray<TInt>::InsertL(TInt anEntry, TInt aPos) |
|
6910 |
{ User::LeaveIfError(Insert(anEntry, aPos));} |
|
6911 |
||
6912 |
||
6913 |
/** |
|
6914 |
Finds the first signed integer in the array which matches the specified signed |
|
6915 |
integer using a sequential search. |
|
6916 |
||
6917 |
The find operation always starts at the low index end of the array. There |
|
6918 |
is no assumption about the order of entries in the array. |
|
6919 |
||
6920 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6921 |
||
6922 |
@param anEntry The signed integer to be found. |
|
6923 |
||
6924 |
@return The index of the first matching signed integer within the array. |
|
6925 |
@leave KErrNotFound, if no matching entry can be found. |
|
6926 |
*/ |
|
6927 |
inline TInt RArray<TInt>::FindL(TInt anEntry) const |
|
6928 |
{ return User::LeaveIfError(Find(anEntry));} |
|
6929 |
||
6930 |
||
6931 |
/** |
|
6932 |
Finds the last signed integer in the array which matches the specified signed |
|
6933 |
integer using a sequential search. |
|
6934 |
||
6935 |
The find operation always starts at the high index end of the array. There |
|
6936 |
is no assumption about the order of entries in the array. |
|
6937 |
||
6938 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6939 |
||
6940 |
@param anEntry The signed integer to be found. |
|
6941 |
||
6942 |
@return The index of the last matching signed integer within the array. |
|
6943 |
@leave KErrNotFound, if no matching entry can be found. |
|
6944 |
*/ |
|
6945 |
inline TInt RArray<TInt>::FindReverseL(TInt anEntry) const |
|
6946 |
{ return User::LeaveIfError(FindReverse(anEntry));} |
|
6947 |
||
6948 |
||
6949 |
/** |
|
6950 |
Finds the signed integer in the array that matches the specified signed integer |
|
6951 |
using a binary search technique. |
|
6952 |
||
6953 |
The function assumes that the array is in signed integer order. |
|
6954 |
||
6955 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6956 |
||
6957 |
@param anEntry The signed integer to be found. |
|
6958 |
||
6959 |
@return The index of the matching signed integer within the array. |
|
6960 |
@leave KErrNotFound, if no match can be found. |
|
6961 |
*/ |
|
6962 |
inline TInt RArray<TInt>::FindInOrderL(TInt anEntry) const |
|
6963 |
{ return User::LeaveIfError(FindInOrder(anEntry));} |
|
6964 |
||
6965 |
||
6966 |
/** |
|
6967 |
Finds the signed integer in the array that matches the specified signed integer |
|
6968 |
using a binary search technique. |
|
6969 |
||
6970 |
The function assumes that the array is in signed integer order. |
|
6971 |
||
6972 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
6973 |
||
6974 |
@param anEntry The signed integer to be found. |
|
6975 |
@param anIndex A reference to a signed integer into which the |
|
6976 |
function puts an index value: If the function returns , |
|
6977 |
this is the index of the matching signed integer within the |
|
6978 |
array. If the function leaves with KErrNotFound, this is the |
|
6979 |
index of the first signed integer within the array that is |
|
6980 |
bigger than the signed integer being searched for - if no |
|
6981 |
signed integers within the array are bigger, then the index |
|
6982 |
value is the same as the total number of signed integers |
|
6983 |
within the array. |
|
6984 |
@leave KErrNotFound if no match can be found. |
|
6985 |
*/ |
|
6986 |
inline void RArray<TInt>::FindInOrderL(TInt anEntry, TInt& anIndex) const |
|
6987 |
{ User::LeaveIfError(FindInOrder(anEntry, anIndex));} |
|
6988 |
||
6989 |
||
6990 |
/** |
|
6991 |
Finds the signed integer in the array that matches the specified signed integer |
|
6992 |
using a binary search technique. |
|
6993 |
||
6994 |
Where there is more than one matching element, it finds the first, last or any |
|
6995 |
matching element as specified by the value of aMode. |
|
6996 |
||
6997 |
The function assumes that the array is in signed integer order. |
|
6998 |
||
6999 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7000 |
||
7001 |
@param anEntry The signed integer to be found. |
|
7002 |
@param aMode Specifies whether to find the first match, the last match or |
|
7003 |
any match, as defined by one of the TArrayFindMode enum values. |
|
7004 |
||
7005 |
@return The array index of a matching element - what the index refers to |
|
7006 |
depends on the value of aMode: |
|
7007 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
7008 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
7009 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
7010 |
the last matching element - if the last matching element is also the last element |
|
7011 |
of the array, then the index value is the same as the total number of elements in the array. |
|
7012 |
||
7013 |
@leave KErrNotFound if no matching entry exists. |
|
7014 |
||
7015 |
@see TArrayFindMode |
|
7016 |
*/ |
|
7017 |
inline TInt RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt aMode) const |
|
7018 |
{ return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));} |
|
7019 |
||
7020 |
||
7021 |
/** |
|
7022 |
Finds the signed integer in the array that matches the specified signed integer |
|
7023 |
using a binary search technique. |
|
7024 |
||
7025 |
Where there is more than one matching element, it finds the first, last or any |
|
7026 |
matching element as specified by the value of aMode. |
|
7027 |
||
7028 |
The function assumes that the array is in signed integer order. |
|
7029 |
||
7030 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7031 |
||
7032 |
@param anEntry The signed integer to be found. |
|
7033 |
@param anIndex A TInt type supplied by the caller. On return, it contains an |
|
7034 |
index value depending on whether a match is found and on the value of aMode. |
|
7035 |
If there is no matching element in the array, then this is |
|
7036 |
the index of the first element in the array that is bigger |
|
7037 |
than the element being searched for - if no elements in the |
|
7038 |
array are bigger, then the index value is the same as the total |
|
7039 |
number of elements in the array. If there is a matching element, |
|
7040 |
then what the index refers to depends on the value of aMode: |
|
7041 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
7042 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
7043 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
7044 |
the last matching element - if the last matching element is also the last element |
|
7045 |
of the array, then the index value is the same as the total number of elements in the array. |
|
7046 |
||
7047 |
@param aMode Specifies whether to find the first match, the last match or any match, as defined |
|
7048 |
by one of the TArrayFindMode enum values. |
|
7049 |
||
7050 |
@leave KErrNotFound if no matching entry exists. |
|
7051 |
||
7052 |
@see TArrayFindMode |
|
7053 |
*/ |
|
7054 |
inline void RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt& anIndex, TInt aMode) const |
|
7055 |
{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));} |
|
7056 |
||
7057 |
||
7058 |
/** |
|
7059 |
Inserts a signed integer into the array in signed integer order. |
|
7060 |
||
7061 |
No duplicate entries are permitted. |
|
7062 |
||
7063 |
The function assumes that existing entries within the array are in signed |
|
7064 |
integer order. |
|
7065 |
||
7066 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
7067 |
||
7068 |
Note that the array remains unchanged following an attempt to insert a duplicate entry. |
|
7069 |
||
7070 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7071 |
||
7072 |
@param anEntry The signed integer to be inserted. |
|
7073 |
*/ |
|
7074 |
inline void RArray<TInt>::InsertInOrderL(TInt anEntry) |
|
7075 |
{ User::LeaveIfError(InsertInOrder(anEntry));} |
|
7076 |
||
7077 |
||
7078 |
/** |
|
7079 |
Inserts a signed integer into the array in signed integer order, |
|
7080 |
allowing duplicates. |
|
7081 |
||
7082 |
If anEntry is a duplicate of an existing entry in the array, then the new |
|
7083 |
signed integer is inserted after the existing one. If more than one duplicate |
|
7084 |
entry already exists in the array, then any new duplicate signed integer is |
|
7085 |
inserted after the last one. |
|
7086 |
||
7087 |
The function assumes that existing entries within the array are in signed |
|
7088 |
integer order. |
|
7089 |
||
7090 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
7091 |
||
7092 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7093 |
||
7094 |
@param anEntry The signed integer to be inserted. |
|
7095 |
*/ |
|
7096 |
inline void RArray<TInt>::InsertInOrderAllowRepeatsL(TInt anEntry) |
|
7097 |
{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));} |
|
7098 |
||
7099 |
||
7100 |
||
7101 |
/** |
|
7102 |
Reserves space for the specified number of elements. |
|
7103 |
||
7104 |
After a call to this function, the memory allocated to the array is sufficient |
|
7105 |
to hold the number of integers specified. Adding new integers to the array |
|
7106 |
does not result in a re-allocation of memory until the the total number of |
|
7107 |
integers exceeds the specified count. |
|
7108 |
||
7109 |
@param aCount The number of integers for which space should be reserved |
|
7110 |
@leave KErrNoMemory If the requested amount of memory could not be allocated |
|
7111 |
*/ |
|
7112 |
inline void RArray<TInt>::ReserveL(TInt aCount) |
|
7113 |
{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); } |
|
7114 |
||
7115 |
||
7116 |
||
7117 |
||
7118 |
/** |
|
7119 |
Appends an unsigned integer onto the array. |
|
7120 |
||
7121 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
7122 |
||
7123 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7124 |
||
7125 |
@param anEntry The unsigned integer to be appended. |
|
7126 |
*/ |
|
7127 |
inline void RArray<TUint>::AppendL(TUint anEntry) |
|
7128 |
{ User::LeaveIfError(Append(anEntry));} |
|
7129 |
||
7130 |
||
7131 |
/** |
|
7132 |
Inserts an unsigned integer into the array at the specified position. |
|
7133 |
||
7134 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
7135 |
||
7136 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7137 |
||
7138 |
@param anEntry The unsigned integer to be inserted. |
|
7139 |
@param aPos The position within the array where the unsigned integer is to |
|
7140 |
be inserted. The position is relative to zero, i.e. zero |
|
7141 |
implies that an entry is inserted at the beginning of |
|
7142 |
the array. |
|
7143 |
||
7144 |
@panic USER 131, if aPos is negative, or is greater than the number of entries |
|
7145 |
currently in the array. |
|
7146 |
*/ |
|
7147 |
inline void RArray<TUint>::InsertL(TUint anEntry, TInt aPos) |
|
7148 |
{ User::LeaveIfError(Insert(anEntry, aPos));} |
|
7149 |
||
7150 |
||
7151 |
/** |
|
7152 |
Finds the first unsigned integer in the array which matches the specified |
|
7153 |
value, using a sequential search. |
|
7154 |
||
7155 |
The find operation always starts at the low index end of the array. There |
|
7156 |
is no assumption about the order of entries in the array. |
|
7157 |
||
7158 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7159 |
||
7160 |
@param anEntry The unsigned integer to be found. |
|
7161 |
@return The index of the first matching unsigned integer within the array. |
|
7162 |
@leave KErrNotFound, if no matching entry can be found. |
|
7163 |
*/ |
|
7164 |
inline TInt RArray<TUint>::FindL(TUint anEntry) const |
|
7165 |
{ return User::LeaveIfError(Find(anEntry));} |
|
7166 |
||
7167 |
||
7168 |
/** |
|
7169 |
Finds the last unsigned integer in the array which matches the specified |
|
7170 |
value, using a sequential search. |
|
7171 |
||
7172 |
The find operation always starts at the high index end of the array. There |
|
7173 |
is no assumption about the order of entries in the array. |
|
7174 |
||
7175 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7176 |
||
7177 |
@param anEntry The unsigned integer to be found. |
|
7178 |
@return The index of the last matching unsigned integer within the array. |
|
7179 |
@leave KErrNotFound, if no matching entry can be found. |
|
7180 |
*/ |
|
7181 |
inline TInt RArray<TUint>::FindReverseL(TUint anEntry) const |
|
7182 |
{ return User::LeaveIfError(FindReverse(anEntry));} |
|
7183 |
||
7184 |
||
7185 |
/** |
|
7186 |
Finds the unsigned integer in the array which matches the specified value, |
|
7187 |
using a binary search technique. |
|
7188 |
||
7189 |
The functions assume that existing entries within the array are in unsigned |
|
7190 |
integer order. |
|
7191 |
||
7192 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7193 |
||
7194 |
@param anEntry The unsigned integer to be found. |
|
7195 |
||
7196 |
@return The index of the matching unsigned integer within the array; |
|
7197 |
@leave KErrNotFound, if no matching entry can be found. |
|
7198 |
*/ |
|
7199 |
inline TInt RArray<TUint>::FindInOrderL(TUint anEntry) const |
|
7200 |
{ return User::LeaveIfError(FindInOrder(anEntry));} |
|
7201 |
||
7202 |
||
7203 |
/** |
|
7204 |
Finds the unsigned integer in the array which matches the specified value, |
|
7205 |
using a binary search technique. |
|
7206 |
||
7207 |
If the index cannot be found, the function returns the index of the last |
|
7208 |
unsigned integer within the array which logically precedes anEntry. |
|
7209 |
The functions assume that existing entries within the array are in unsigned |
|
7210 |
integer order. |
|
7211 |
||
7212 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7213 |
||
7214 |
@param anEntry The unsigned integer to be found. |
|
7215 |
@param anIndex A TInt supplied by the caller. On return, contains an index |
|
7216 |
value of the matching unsigned integer within the array. |
|
7217 |
If the function leaves with KErrNotFound, this is the index of the |
|
7218 |
first unsigned integer within the array that is bigger than the |
|
7219 |
unsigned integer being searched for - if no unsigned integers within |
|
7220 |
the array are bigger, then the index value is the same as the |
|
7221 |
total number of unsigned integers within the array. |
|
7222 |
||
7223 |
@leave KErrNotFound, if no matching entry can be found. |
|
7224 |
*/ |
|
7225 |
inline void RArray<TUint>::FindInOrderL(TUint anEntry, TInt& anIndex) const |
|
7226 |
{ User::LeaveIfError(FindInOrder(anEntry, anIndex));} |
|
7227 |
||
7228 |
||
7229 |
/** |
|
7230 |
Finds the unsigned integer in the array that matches the specified unsigned integer |
|
7231 |
using a binary search technique. |
|
7232 |
||
7233 |
In the case that there is more than one matching element, finds the first, last or any |
|
7234 |
match as specified. |
|
7235 |
||
7236 |
The function assumes that the array is in unsigned integer order. |
|
7237 |
||
7238 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7239 |
||
7240 |
@param anEntry The unsigned integer to be found. |
|
7241 |
@param aMode Specifies whether to find the first match, the last match or |
|
7242 |
any match, as defined by one of the TArrayFindMode enum values. |
|
7243 |
||
7244 |
@return The array index of a matching element - what the index refers to depends |
|
7245 |
on the value of aMode: |
|
7246 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
7247 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
7248 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
7249 |
the last matching element - if the last matching element is also the last element |
|
7250 |
of the array, then the index value is the same as the total number of elements in the array. |
|
7251 |
||
7252 |
@leave KErrNotFound if no matching entry exists. |
|
7253 |
||
7254 |
@see TArrayFindMode |
|
7255 |
*/ |
|
7256 |
inline TInt RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt aMode) const |
|
7257 |
{ return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));} |
|
7258 |
||
7259 |
||
7260 |
/** |
|
7261 |
Finds the unsigned integer in the array that matches the specified unsigned integer |
|
7262 |
using a binary search technique. |
|
7263 |
||
7264 |
Where there is more than one matching element, it finds the first, last or |
|
7265 |
any matching element as specified by the value of aMode. |
|
7266 |
||
7267 |
The function assumes that the array is in unsigned integer order. |
|
7268 |
||
7269 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7270 |
||
7271 |
@param anEntry The unsigned integer to be found. |
|
7272 |
@param anIndex A TInt type supplied by the caller. On return, it contains an index |
|
7273 |
value depending on whether a match is found and on the value of aMode. |
|
7274 |
If there is no matching element in the array, then this is the |
|
7275 |
index of the first element in the array that is bigger than the element |
|
7276 |
being searched for - if no elements in the array are bigger, then |
|
7277 |
the index value is the same as the total number of elements in the array. |
|
7278 |
If there is a matching element, then what the index refers to depends on |
|
7279 |
the value of aMode: |
|
7280 |
if this is EArrayFindMode_First, then the index refers to the first matching element; |
|
7281 |
if this is EArrayFindMode_Any, then the index can refer to any of the matching elements; |
|
7282 |
if this is EArrayFindMode_Last, then the index refers to first element that follows |
|
7283 |
the last matching element - if the last matching element is also the last element of the array, |
|
7284 |
then the index value is the same as the total number of elements in the array. |
|
7285 |
||
7286 |
@param aMode Specifies whether to find the first match, the last match or any match, as defined by |
|
7287 |
one of the TArrayFindMode enum values. |
|
7288 |
@leave KErrNotFound if no matching entry exists. |
|
7289 |
||
7290 |
@see TArrayFindMode |
|
7291 |
*/ |
|
7292 |
inline void RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt& anIndex, TInt aMode) const |
|
7293 |
{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));} |
|
7294 |
||
7295 |
||
7296 |
/** |
|
7297 |
Inserts an unsigned integer into the array in unsigned integer order. |
|
7298 |
||
7299 |
No duplicate entries are permitted. |
|
7300 |
||
7301 |
The function assumes that existing entries within the array are in unsigned |
|
7302 |
integer order. |
|
7303 |
||
7304 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
7305 |
||
7306 |
Note that the array remains unchanged following an attempt to insert a duplicate entry. |
|
7307 |
||
7308 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7309 |
||
7310 |
@param anEntry The unsigned integer to be inserted. |
|
7311 |
*/ |
|
7312 |
inline void RArray<TUint>::InsertInOrderL(TUint anEntry) |
|
7313 |
{ User::LeaveIfError(InsertInOrder(anEntry));} |
|
7314 |
||
7315 |
||
7316 |
/** |
|
7317 |
Inserts an unsigned integer into the array in unsigned integer order, allowing |
|
7318 |
duplicates. |
|
7319 |
||
7320 |
If the new integer is a duplicate of an existing entry in the array, then |
|
7321 |
the new unsigned integer is inserted after the existing one. If more than |
|
7322 |
one duplicate entry already exists in the array, then any new duplicate |
|
7323 |
unsigned integer is inserted after the last one. |
|
7324 |
||
7325 |
The function assumes that existing entries within the array are in unsigned |
|
7326 |
integer order. |
|
7327 |
||
7328 |
The function leaves with one of the system wide error codes, if the operation fails. |
|
7329 |
||
7330 |
NOTE: This function is NOT AVAILABLE to code running on the kernel side. |
|
7331 |
||
7332 |
@param anEntry The unsigned integer to be inserted. |
|
7333 |
*/ |
|
7334 |
inline void RArray<TUint>::InsertInOrderAllowRepeatsL(TUint anEntry) |
|
7335 |
{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));} |
|
7336 |
||
7337 |
||
7338 |
||
7339 |
/** |
|
7340 |
Reserves space for the specified number of elements. |
|
7341 |
||
7342 |
After a call to this function, the memory allocated to the array is sufficient |
|
7343 |
to hold the number of integers specified. Adding new integers to the array |
|
7344 |
does not result in a re-allocation of memory until the the total number of |
|
7345 |
integers exceeds the specified count. |
|
7346 |
||
7347 |
@param aCount The number of integers for which space should be reserved |
|
7348 |
@leave KErrNoMemory If the requested amount of memory could not be allocated |
|
7349 |
*/ |
|
7350 |
inline void RArray<TUint>::ReserveL(TInt aCount) |
|
7351 |
{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); } |
|
7352 |
||
7353 |
||
7354 |
||
7355 |
// class TChunkHeapCreateInfo |
|
7356 |
/** |
|
7357 |
Sets single thread property of the chunk heap. |
|
7358 |
||
7359 |
This overrides any previous call to TChunkHeapCreateInfo::SetSingleThread() |
|
7360 |
for this TChunkHeapCreateInfo object. |
|
7361 |
||
7362 |
@param aSingleThread ETrue when the chunk heap is to be single threaded, |
|
7363 |
EFalse otherwise. |
|
7364 |
*/ |
|
7365 |
inline void TChunkHeapCreateInfo::SetSingleThread(const TBool aSingleThread) |
|
7366 |
{ |
|
7367 |
iSingleThread = aSingleThread; |
|
7368 |
} |
|
7369 |
||
7370 |
||
7371 |
/** |
|
7372 |
Sets alignment of the cells of the chunk heap to be created. |
|
7373 |
||
7374 |
This overrides any previous call to TChunkHeapCreateInfo::SetAlignment() |
|
7375 |
for this TChunkHeapCreateInfo object. |
|
7376 |
||
7377 |
@param aAlignment The alignment of the heap cells. |
|
7378 |
*/ |
|
7379 |
inline void TChunkHeapCreateInfo::SetAlignment(TInt aAlign) |
|
7380 |
{ |
|
7381 |
iAlign = aAlign; |
|
7382 |
} |
|
7383 |
||
7384 |
||
7385 |
/** |
|
7386 |
Sets the increments to the size of the host chunk. If the supplied value is |
|
7387 |
less than KMinHeapGrowBy, it is discarded and the value KMinHeapGrowBy is |
|
7388 |
used instead. |
|
7389 |
||
7390 |
This overrides any previous call to TChunkHeapCreateInfo::SetGrowBy() |
|
7391 |
for this TChunkHeapCreateInfo object. |
|
7392 |
||
7393 |
@param aGrowBy The increment to the size of the host chunk. |
|
7394 |
*/ |
|
7395 |
inline void TChunkHeapCreateInfo::SetGrowBy(TInt aGrowBy) |
|
7396 |
{ |
|
7397 |
iGrowBy = aGrowBy; |
|
7398 |
} |
|
7399 |
||
7400 |
||
7401 |
/** |
|
7402 |
Sets the offset from the base of the host chunk to the start of the heap. |
|
7403 |
||
7404 |
This overrides any previous call to TChunkHeapCreateInfo::SetOffset() |
|
7405 |
for this TChunkHeapCreateInfo object. |
|
7406 |
||
7407 |
@param aOffset The offset in bytes. |
|
7408 |
*/ |
|
7409 |
inline void TChunkHeapCreateInfo::SetOffset(TInt aOffset) |
|
7410 |
{ |
|
7411 |
iOffset = aOffset; |
|
7412 |
} |
|
7413 |
||
7414 |
||
7415 |
/** |
|
7416 |
Sets the mode flags of the chunk heap. |
|
7417 |
||
7418 |
This overrides any previous call to TChunkHeapCreateInfo::SetMode() |
|
7419 |
for this TChunkHeapCreateInfo object. |
|
7420 |
||
7421 |
@param aMode The mode flags for the chunk heap to be created, this should be |
|
7422 |
one or more of the values from TChunkHeapCreateMode. |
|
7423 |
*/ |
|
7424 |
inline void TChunkHeapCreateInfo::SetMode(TUint aMode) |
|
7425 |
{ |
|
7426 |
iMode = aMode; |
|
7427 |
} |
|
7428 |
||
7429 |
||
7430 |
/** |
|
7431 |
Sets the paging attribute of the chunk heap to be created. |
|
7432 |
||
7433 |
This overrides any previous call to TChunkHeapCreateInfo::SetPaging() |
|
7434 |
for this TChunkHeapCreateInfo object. |
|
7435 |
||
7436 |
@param aPaging The paging attribute for the chunk heap to be created. |
|
7437 |
*/ |
|
7438 |
inline void TChunkHeapCreateInfo::SetPaging(const TChunkHeapPagingAtt aPaging) |
|
7439 |
{ |
|
7440 |
iPaging = aPaging; |
|
7441 |
} |
|
7442 |
||
7443 |
||
7444 |
/** |
|
7445 |
Sets the priority of the client's process. |
|
7446 |
||
7447 |
@param aPriority The priority value. |
|
7448 |
*/ |
|
7449 |
inline void RMessagePtr2::SetProcessPriorityL(TProcessPriority aPriority) const |
|
7450 |
{ User::LeaveIfError(SetProcessPriority(aPriority));} |
|
7451 |
||
7452 |
||
7453 |
/** |
|
7454 |
Opens a handle on the client thread. |
|
7455 |
||
7456 |
@param aClient On successful return, the handle to the client thread. |
|
7457 |
@param aOwnerType An enumeration whose enumerators define the ownership of |
|
7458 |
the handle. If not explicitly specified, |
|
7459 |
EOwnerProcess is taken as default. |
|
7460 |
*/ |
|
7461 |
inline void RMessagePtr2::ClientL(RThread& aClient, TOwnerType aOwnerType) const |
|
7462 |
{ User::LeaveIfError(Client(aClient, aOwnerType));} |
|
7463 |
||
7464 |
||
7465 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
7466 |
||
7467 |
inline TBool RMessagePtr2::HasCapability(TCapability aCapability, const char* aDiagnostic) const |
|
7468 |
{ |
|
7469 |
return DoHasCapability(aCapability, aDiagnostic); |
|
7470 |
} |
|
7471 |
||
7472 |
inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, const char* aDiagnosticMessage) const |
|
7473 |
{ |
|
7474 |
if (!HasCapability(aCapability, aDiagnosticMessage)) |
|
7475 |
{ |
|
7476 |
User::Leave(KErrPermissionDenied); |
|
7477 |
} |
|
7478 |
} |
|
7479 |
||
7480 |
inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const |
|
7481 |
{ |
|
7482 |
return DoHasCapability(aCapability1, aCapability2, aDiagnostic); |
|
7483 |
} |
|
7484 |
||
7485 |
inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, const char* aDiagnosticMessage) const |
|
7486 |
{ |
|
7487 |
if (!HasCapability(aCapability1, aCapability2, aDiagnosticMessage)) |
|
7488 |
{ |
|
7489 |
User::Leave(KErrPermissionDenied); |
|
7490 |
} |
|
7491 |
} |
|
7492 |
||
7493 |
#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
7494 |
||
7495 |
// Only available to NULL arguments |
|
7496 |
inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const |
|
7497 |
{ |
|
7498 |
return DoHasCapability(aCapability); |
|
7499 |
} |
|
7500 |
||
7501 |
inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnosticMessage*/) const |
|
7502 |
{ |
|
7503 |
if (!DoHasCapability(aCapability)) |
|
7504 |
{ |
|
7505 |
User::Leave(KErrPermissionDenied); |
|
7506 |
} |
|
7507 |
} |
|
7508 |
||
7509 |
inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const |
|
7510 |
{ |
|
7511 |
return DoHasCapability(aCapability1, aCapability2); |
|
7512 |
} |
|
7513 |
||
7514 |
inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnosticMessage*/) const |
|
7515 |
{ |
|
7516 |
if (!DoHasCapability(aCapability1, aCapability2)) |
|
7517 |
{ |
|
7518 |
User::Leave(KErrPermissionDenied); |
|
7519 |
} |
|
7520 |
} |
|
7521 |
||
7522 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__ |
|
7523 |
// For things using KSuppressPlatSecDiagnostic |
|
7524 |
inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
7525 |
{ |
|
7526 |
return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue); |
|
7527 |
} |
|
7528 |
||
7529 |
inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
7530 |
{ |
|
7531 |
if (!DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue)) |
|
7532 |
{ |
|
7533 |
User::Leave(KErrPermissionDenied); |
|
7534 |
} |
|
7535 |
} |
|
7536 |
||
7537 |
inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
7538 |
{ |
|
7539 |
return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue); |
|
7540 |
} |
|
7541 |
||
7542 |
inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const |
|
7543 |
{ |
|
7544 |
if (!DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue)) |
|
7545 |
{ |
|
7546 |
User::Leave(KErrPermissionDenied); |
|
7547 |
} |
|
7548 |
} |
|
7549 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__ |
|
7550 |
||
7551 |
#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__ |
|
7552 |
||
7553 |
inline TInt RThread::RenameMe(const TDesC& aName) |
|
7554 |
{ return User::RenameThread(aName); } |
|
7555 |
inline TInt RProcess::RenameMe(const TDesC& aName) |
|
7556 |
{ return User::RenameProcess(aName); } |
|
7557 |
||
7558 |
||
7559 |
#endif // !__KERNEL_MODE__ |
|
7560 |
||
7561 |
#ifdef __SUPPORT_CPP_EXCEPTIONS__ |
|
7562 |
// The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively. |
|
7563 |
// The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers |
|
7564 |
// when we move to supporting Standard C++. |
|
7565 |
||
7566 |
// The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target. |
|
7567 |
// In this case, we wish to avoid defining uncaught_exception below since it clashes with the StdC++ specification |
|
7568 |
#if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__) && !defined(__SYMBIAN_STDCPP_SUPPORT__) |
|
7569 |
||
7570 |
#if defined(__VC32__) && !defined(_CRTIMP_PURE) |
|
7571 |
||
7572 |
// Declare MS EH runtime functions |
|
7573 |
bool __uncaught_exception(void); |
|
7574 |
||
7575 |
#if _MSC_VER >= 1200 |
|
7576 |
__declspec(noreturn) void terminate(void); |
|
7577 |
__declspec(noreturn) void unexpected(void); |
|
7578 |
#else |
|
7579 |
void terminate(void); |
|
7580 |
void unexpected(void); |
|
7581 |
#endif |
|
7582 |
||
7583 |
typedef void (*terminate_handler)(); |
|
7584 |
terminate_handler set_terminate(terminate_handler h) throw(); |
|
7585 |
typedef void (*unexpected_handler)(); |
|
7586 |
unexpected_handler set_unexpected(unexpected_handler h) throw(); |
|
7587 |
||
7588 |
namespace std { |
|
7589 |
#ifdef __MSVCDOTNET__ |
|
7590 |
inline bool uncaught_exception(void) { return ::__uncaught_exception(); } |
|
7591 |
#else // !__MSVCDOTNET__ |
|
7592 |
// MS KB242192: BUG: uncaught_exception() Always Returns False |
|
7593 |
inline bool uncaught_exception(void) { return false; } |
|
7594 |
#endif //__MSVCDOTNET__ |
|
7595 |
inline void terminate(void) { ::terminate(); } |
|
7596 |
inline void unexpected(void) { ::unexpected(); } |
|
7597 |
inline terminate_handler set_terminate(terminate_handler h) throw() { return ::set_terminate(h); } |
|
7598 |
inline unexpected_handler set_unexpected(unexpected_handler h) throw() { return ::set_unexpected(h); } |
|
7599 |
} |
|
7600 |
||
7601 |
#endif // extract from MSVC headers |
|
7602 |
||
7603 |
#ifdef __CW32__ |
|
7604 |
||
7605 |
extern "C" bool __uncaught_exception(void); |
|
7606 |
||
7607 |
namespace std { |
|
7608 |
#if __MWERKS__ > 0x3200 |
|
7609 |
inline bool uncaught_exception(void) { return ::__uncaught_exception(); } |
|
7610 |
#else |
|
7611 |
// no uncaught_exception() implementation on CW 2.4.7 |
|
7612 |
inline bool uncaught_exception(void) { return false; } |
|
7613 |
#endif |
|
7614 |
} |
|
7615 |
||
7616 |
#endif // extract from CW headers |
|
7617 |
||
7618 |
#endif // <exception> header guard |
|
7619 |
||
7620 |
#endif //__SUPPORT_CPP_EXCEPTIONS__ |