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