symport/e32/include/e32std.inl
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     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 "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-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 #ifndef __TOOLS2__
       
   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 #endif // __TOOLS2__
       
   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::CountryCode() const
       
  2397 /**
       
  2398 Gets the code which is used to select country-specific locale data.
       
  2399 
       
  2400 The country code is the code used as the international dialling prefix.
       
  2401 This code is also used to identify a country by the dialling software.
       
  2402 	
       
  2403 @return The country code.
       
  2404 */
       
  2405 	{return(iCountryCode);}
       
  2406 
       
  2407 
       
  2408 
       
  2409 
       
  2410 inline void TLocale::SetCountryCode(TInt aCode)
       
  2411 /**
       
  2412 Sets the value which is used to select country-specific locale data.
       
  2413 
       
  2414 This value can be retrieved by using TLocale::CountryCode(). The country code
       
  2415 is the code used as the international dialling prefix. This code is also used
       
  2416 to identify a country by the dialling software.
       
  2417 	
       
  2418 @param aCode The country code.
       
  2419 
       
  2420 @see TLocale::CountryCode
       
  2421 */
       
  2422 	{iCountryCode=aCode;}
       
  2423 
       
  2424 
       
  2425 
       
  2426 
       
  2427 inline TTimeIntervalSeconds TLocale::UniversalTimeOffset() const
       
  2428 /**
       
  2429 Gets the locale's universal time offset.
       
  2430 	
       
  2431 @return Offset in seconds from universal time. Time zones east of universal 
       
  2432 	    time have positive offsets. Time zones west of universal time have negative 
       
  2433 	    offsets.
       
  2434 
       
  2435 @deprecated Use User::UTCOffset to get the current offset inclusive of daylight
       
  2436 			savings time. This function returns the same value, for compatibility.
       
  2437 */
       
  2438 	{return(iUniversalTimeOffset);}
       
  2439 
       
  2440 
       
  2441 
       
  2442 
       
  2443 inline TDateFormat TLocale::DateFormat() const
       
  2444 /**
       
  2445 Gets the date format.
       
  2446 	
       
  2447 @return The date format.
       
  2448 */
       
  2449 	{return(iDateFormat);}
       
  2450 
       
  2451 
       
  2452 
       
  2453 
       
  2454 inline void TLocale::SetDateFormat(TDateFormat aFormat)
       
  2455 /**
       
  2456 Sets the date format.
       
  2457 	
       
  2458 @param aFormat The date format to be used.
       
  2459 */
       
  2460 	{iDateFormat=aFormat;}
       
  2461 
       
  2462 
       
  2463 
       
  2464 
       
  2465 inline TTimeFormat TLocale::TimeFormat() const
       
  2466 /**
       
  2467 Gets the time format (12 or 24 hour).
       
  2468 	
       
  2469 @return The time format.
       
  2470 */
       
  2471 	{return(iTimeFormat);}
       
  2472 
       
  2473 
       
  2474 
       
  2475 
       
  2476 inline void TLocale::SetTimeFormat(TTimeFormat aFormat)
       
  2477 /**
       
  2478 Sets the time format (12 or 24 hour).
       
  2479 	
       
  2480 @param aFormat The time format.
       
  2481 */
       
  2482 	{iTimeFormat=aFormat;}
       
  2483 
       
  2484 
       
  2485 
       
  2486 
       
  2487 inline TLocalePos TLocale::CurrencySymbolPosition() const
       
  2488 /**
       
  2489 Gets the currency symbol position.
       
  2490 	
       
  2491 For negative currency values, this position may be
       
  2492 reversed using SetNegativeCurrencySymbolOpposite().
       
  2493 	
       
  2494 @return The currency symbol position.
       
  2495 
       
  2496 @see TLocale::SetNegativeCurrencySymbolOpposite
       
  2497 */
       
  2498 	{return(iCurrencySymbolPosition);}
       
  2499 
       
  2500 
       
  2501 
       
  2502 
       
  2503 inline void TLocale::SetCurrencySymbolPosition(TLocalePos aPos)
       
  2504 /**
       
  2505 Sets the currency symbol position.
       
  2506 	
       
  2507 @param aPos The currency symbol position.
       
  2508 */
       
  2509 	{iCurrencySymbolPosition=aPos;}
       
  2510 
       
  2511 
       
  2512 
       
  2513 
       
  2514 inline TBool TLocale::CurrencySpaceBetween() const
       
  2515 /**
       
  2516 Gets whether or not a space is inserted between the currency symbol and the 
       
  2517 currency value.
       
  2518 	
       
  2519 For negative currency values, the space can be removed using SetNegativeLoseSpace().
       
  2520 	
       
  2521 @return True if a space is inserted; false if not.
       
  2522 
       
  2523 @see TLocale::SetNegativeLoseSpace
       
  2524 */
       
  2525 	{return(iCurrencySpaceBetween);}
       
  2526 
       
  2527 
       
  2528 
       
  2529 
       
  2530 inline void TLocale::SetCurrencySpaceBetween(TBool aSpace)
       
  2531 /**
       
  2532 Sets whether a space is inserted between the currency symbol and the currency 
       
  2533 amount.
       
  2534 	
       
  2535 @param aSpace ETrue if a space is inserted; EFalse if not.
       
  2536 */
       
  2537 	{iCurrencySpaceBetween=aSpace;}
       
  2538 
       
  2539 
       
  2540 
       
  2541 
       
  2542 inline TInt TLocale::CurrencyDecimalPlaces() const
       
  2543 /**
       
  2544 Gets the number of decimal places to which currency values are set.
       
  2545 	
       
  2546 @return The number of decimal places.
       
  2547 */
       
  2548 	{return(iCurrencyDecimalPlaces);}
       
  2549 
       
  2550 
       
  2551 
       
  2552 
       
  2553 inline void TLocale::SetCurrencyDecimalPlaces(TInt aPlaces)
       
  2554 /**
       
  2555 Sets the number of decimal places to which currency values should be set.
       
  2556 	
       
  2557 @param aPlaces The number of decimal places.
       
  2558 */
       
  2559 	{iCurrencyDecimalPlaces=aPlaces;}
       
  2560 
       
  2561 
       
  2562 
       
  2563 
       
  2564 inline TBool TLocale::CurrencyNegativeInBrackets() const
       
  2565 /**
       
  2566 @deprecated
       
  2567 
       
  2568 Gets whether negative currency values are enclosed in brackets rather than 
       
  2569 being preceded by a minus sign. 
       
  2570 	
       
  2571 This is deprecated, use NegativeCurrencyFormat() instead.
       
  2572 	
       
  2573 @return True if negative currency is enclosed in brackets and has no minus 
       
  2574         sign; false if negative currency has a minus sign and is not enclosed
       
  2575 		in brackets.
       
  2576 
       
  2577 @see TLocale::NegativeCurrencyFormat
       
  2578 */
       
  2579 	{return((TBool)iNegativeCurrencyFormat);}			
       
  2580 
       
  2581 
       
  2582 
       
  2583 
       
  2584 inline void TLocale::SetCurrencyNegativeInBrackets(TBool aBool)
       
  2585 /** 
       
  2586 @deprecated
       
  2587 
       
  2588 Sets whether negative currency values are enclosed in brackets rather than
       
  2589 being preceded by a minus sign.
       
  2590 	
       
  2591 This is deprecated, use SetNegativeCurrencyFormat() instead.
       
  2592 	
       
  2593 @param aBool ETrue, if a negative currency value must be enclosed in brackets 
       
  2594 	         without a minus sign; EFalse, if a negative currency value is
       
  2595 			 preceded by a minus sign without any enclosing brackets.
       
  2596 
       
  2597 @see TLocale::SetNegativeCurrencyFormat
       
  2598 */
       
  2599 	{iNegativeCurrencyFormat=(aBool)?EInBrackets:ELeadingMinusSign;}
       
  2600 
       
  2601 
       
  2602 
       
  2603 
       
  2604 inline TBool TLocale::CurrencyTriadsAllowed() const
       
  2605 /**
       
  2606 Gets whether triads are allowed in currency values. Triads are groups of 
       
  2607 three digits separated by the thousands separator.
       
  2608 	
       
  2609 @return True if triads are allowed; false if not.
       
  2610 */
       
  2611 	{return(iCurrencyTriadsAllowed);}
       
  2612 
       
  2613 
       
  2614 
       
  2615 
       
  2616 inline void TLocale::SetCurrencyTriadsAllowed(TBool aBool)
       
  2617 /**
       
  2618 Sets whether triads are allowed in currency values.
       
  2619 	
       
  2620 @param aBool ETrue if triads are allowed; EFalse if triads not allowed.
       
  2621 */
       
  2622 	{iCurrencyTriadsAllowed=aBool;}
       
  2623 
       
  2624 
       
  2625 
       
  2626 
       
  2627 inline TChar TLocale::ThousandsSeparator() const
       
  2628 /**
       
  2629 Gets the character used to separate groups of three digits to the left of 
       
  2630 the decimal separator.
       
  2631 	
       
  2632 A thousands separator character is only displayed in currency values if currency 
       
  2633 triads are allowed.
       
  2634 	
       
  2635 @return The character used as the thousands separator.
       
  2636 */
       
  2637 	{return(iThousandsSeparator);}
       
  2638 
       
  2639 
       
  2640 
       
  2641 
       
  2642 inline void TLocale::SetThousandsSeparator(const TChar& aChar)
       
  2643 /**
       
  2644 Sets the character to be used to separate groups of three digits to the left 
       
  2645 of the decimal separator.
       
  2646 	
       
  2647 A thousands separator character is only displayed in currency values if currency 
       
  2648 triads are allowed.
       
  2649 	
       
  2650 @param aChar The character to be used as the thousands separator.
       
  2651 */
       
  2652 	{iThousandsSeparator=aChar;}
       
  2653 
       
  2654 
       
  2655 
       
  2656 
       
  2657 inline TChar TLocale::DecimalSeparator() const
       
  2658 /**
       
  2659 Gets the character used to separate a whole number from its fractional part.
       
  2660 	
       
  2661 @return The character used as the decimal separator.
       
  2662 */
       
  2663 	{return(iDecimalSeparator);}
       
  2664 
       
  2665 
       
  2666 
       
  2667 
       
  2668 inline void TLocale::SetDecimalSeparator(const TChar& aChar)
       
  2669 /**
       
  2670 Sets the character to be used to separate a whole number from its fractional 
       
  2671 part.
       
  2672 	
       
  2673 @param aChar The character to be used as the decimal separator.
       
  2674 */
       
  2675 	{iDecimalSeparator=aChar;}
       
  2676 
       
  2677 
       
  2678 
       
  2679 
       
  2680 inline TChar TLocale::DateSeparator(TInt aIndex) const
       
  2681 /**
       
  2682 Gets one of the four characters used to separate the day, month and year 
       
  2683 components of the date.
       
  2684 	
       
  2685 If the four separators are represented by S0, S1, S2 and S3 and the three 
       
  2686 date components are represented by XX, YY and ZZ, then the separators are 
       
  2687 located: S0 XX S1 YY S2 ZZ S3.
       
  2688 	
       
  2689 @param aIndex An index indicating which of the four separators is being accessed. 
       
  2690               This must be a value between zero and three inclusive.
       
  2691 
       
  2692 @return A date separator character as determined by the value of aIndex.
       
  2693 */
       
  2694 	{return(iDateSeparator[aIndex]);}
       
  2695 
       
  2696 
       
  2697 
       
  2698 
       
  2699 inline void TLocale::SetDateSeparator(const TChar& aChar,TInt aIndex)
       
  2700 /**
       
  2701 Sets one of the four characters used to separate the day, month and year
       
  2702 components of the date.
       
  2703 	
       
  2704 If the four separators are represented by S0, S1, S2 and S3 and the three 
       
  2705 date components are represented by XX, YY and ZZ, then the separators are 
       
  2706 located: S0 XX S1 YY S2 ZZ S3.
       
  2707 	
       
  2708 @param aChar  A date separator character to be used.
       
  2709 @param aIndex An index indicating which of the four separators is being accessed. 
       
  2710 	          This must be a value between zero and three inclusive.
       
  2711 */
       
  2712 	{__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxDateSeparators,User::Invariant());
       
  2713 	iDateSeparator[aIndex]=aChar;}
       
  2714 
       
  2715 
       
  2716 
       
  2717 
       
  2718 inline TChar TLocale::TimeSeparator(TInt aIndex) const
       
  2719 /**
       
  2720 Gets one of the four characters used to separate the hour, second and minute 
       
  2721 components of the time.
       
  2722 	
       
  2723 If the four separators are represented by S0, S1, S2 and S3 and the three 
       
  2724 time components are represented by XX, YY and ZZ, then the separators are 
       
  2725 located: S0 XX S1 YY S2 ZZ S3.
       
  2726 	
       
  2727 @param aIndex An index indicating which of the four separators is being
       
  2728               accessed. This must be a value between zero and three inclusive.
       
  2729 
       
  2730 @return A time separator character as determined by the value of aIndex.
       
  2731 */
       
  2732 
       
  2733 	{return(iTimeSeparator[aIndex]);}
       
  2734 
       
  2735 
       
  2736 
       
  2737 
       
  2738 inline void TLocale::SetTimeSeparator(const TChar& aChar,TInt aIndex)
       
  2739 /**
       
  2740 Sets one of the four characters used to separate the hour, minute and second 
       
  2741 components of the date.
       
  2742 	
       
  2743 If the four separators are represented by S0, S1, S2 and S3 and the three 
       
  2744 time components are represented by XX, YY and ZZ, then the separators are 
       
  2745 located: S0 XX S1 YY S2 ZZ S3.
       
  2746 	
       
  2747 @param aChar  A time separator character to be used.
       
  2748 @param aIndex An index indicating which of the four separators is being accessed. 
       
  2749 	          This must be a value between zero and three inclusive.
       
  2750 */
       
  2751 	{__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxTimeSeparators,User::Invariant());
       
  2752 	iTimeSeparator[aIndex]=aChar;}
       
  2753 
       
  2754 
       
  2755 
       
  2756 
       
  2757 inline TLocalePos TLocale::AmPmSymbolPosition() const
       
  2758 /**
       
  2759 Gets the am/pm text position (before or after the time value).
       
  2760 
       
  2761 @return The am/pm text position (0 before, 1 after).
       
  2762 */
       
  2763 	{return(iAmPmSymbolPosition);}
       
  2764 
       
  2765 
       
  2766 
       
  2767 
       
  2768 inline void TLocale::SetAmPmSymbolPosition(TLocalePos aPos)
       
  2769 /**
       
  2770 Sets the am/pm text position (before or after the time value).
       
  2771 	
       
  2772 @param aSpace The am/pm text position (0 before, 1 after).
       
  2773 */
       
  2774 	{iAmPmSymbolPosition=aPos;}
       
  2775 
       
  2776 
       
  2777 
       
  2778 
       
  2779 inline TBool TLocale::AmPmSpaceBetween() const
       
  2780 /**
       
  2781 Tests whether or not a space is inserted between the time and the preceding 
       
  2782 or trailing am/pm text.
       
  2783 	
       
  2784 @return True if a space is inserted between the time and am/pm text; false 
       
  2785         if not.
       
  2786 */
       
  2787 	{return(iAmPmSpaceBetween);}
       
  2788 
       
  2789 
       
  2790 
       
  2791 
       
  2792 inline void TLocale::SetAmPmSpaceBetween(TBool aSpace)
       
  2793 /**
       
  2794 Sets whether a space is inserted between the time and the preceding or trailing 
       
  2795 am/pm text.
       
  2796 	
       
  2797 @param aPos ETrue if a space is inserted between the time and am/pm text; 
       
  2798             EFalse otherwise.
       
  2799 */
       
  2800 	{iAmPmSpaceBetween=aSpace;}
       
  2801 
       
  2802 
       
  2803 
       
  2804 
       
  2805 inline TUint TLocale::DaylightSaving() const
       
  2806 /**
       
  2807 Gets the zones in which daylight saving is in effect.
       
  2808 	
       
  2809 If daylight saving is in effect, one hour is added to the time.
       
  2810 	
       
  2811 Use TLocale::QueryHomeHasDaylightSavingOn() to find out whether daylight saving 
       
  2812 is in effect for the home city. This is because the daylight saving setting 
       
  2813 for the home city may differ from that of the zone in which home is located.
       
  2814 	
       
  2815 @return A bit mask in which the three least significant bits are defined, 
       
  2816         indicating which of the three daylight saving zones are adjusted for
       
  2817 		daylight saving. These bits represent:
       
  2818 		Northern (non-European countries in the northern hemisphere),
       
  2819 		Southern (southern hemisphere),
       
  2820 		and European.
       
  2821 
       
  2822 @see TLocale::QueryHomeHasDaylightSavingOn
       
  2823 @see TDaylightSavingZone
       
  2824 
       
  2825 @deprecated Use the timezone server to retrieve information on timezones and DST.
       
  2826 			This method will always indicate that DST is inactive, in order to
       
  2827 			preserve compatibility.
       
  2828 */
       
  2829 	{return(iDaylightSaving);} 
       
  2830 
       
  2831 
       
  2832 
       
  2833 
       
  2834 inline TBool TLocale::QueryHomeHasDaylightSavingOn() const
       
  2835 /**
       
  2836 Tests whether or not daylight saving is set for the home city.
       
  2837 	
       
  2838 @return True if home daylight saving is set; false if not.
       
  2839 
       
  2840 @deprecated Use the timezone server to retrieve information on timezones and DST.
       
  2841 			This method will always indicate that DST is inactive, in order to
       
  2842 			preserve compatibility.
       
  2843 */
       
  2844 	{return((iHomeDaylightSavingZone|EDstHome) & iDaylightSaving);}
       
  2845 
       
  2846 
       
  2847 
       
  2848 
       
  2849 inline TDaylightSavingZone TLocale::HomeDaylightSavingZone() const
       
  2850 /**
       
  2851 Gets the daylight saving zone in which the home city is located.
       
  2852 	
       
  2853 @return The daylight saving zone in which the home city is located.
       
  2854 
       
  2855 @deprecated Use the timezone server to retrieve information on timezones and DST.
       
  2856 */
       
  2857 	{return(iHomeDaylightSavingZone);}
       
  2858 
       
  2859 
       
  2860 
       
  2861 
       
  2862 inline TUint TLocale::WorkDays() const
       
  2863 /**
       
  2864 Gets a bit mask representing the days of the week which are considered as 
       
  2865 working days.
       
  2866 	
       
  2867 @return A bit mask of seven bits indicating (by being set) which days are 
       
  2868         workdays. The least significant bit corresponds to Monday, the next bit to 
       
  2869 	    Tuesday and so on.
       
  2870 */
       
  2871 	{return(iWorkDays);}
       
  2872 
       
  2873 
       
  2874 
       
  2875 
       
  2876 inline void TLocale::SetWorkDays(TUint aMask)
       
  2877 /**
       
  2878 Sets the days of the week which are considered as working days.
       
  2879 	
       
  2880 @param aMask A bit mask of seven bits indicating (by being set) which days 
       
  2881              are workdays. The least significant bit corresponds to Monday, the
       
  2882 			 next bit is Tuesday and so on.
       
  2883 */
       
  2884 	{iWorkDays=aMask;}
       
  2885 
       
  2886 
       
  2887 
       
  2888 
       
  2889 inline TDay TLocale::StartOfWeek() const
       
  2890 /**
       
  2891 Gets the day which is considered the first day of the week.
       
  2892 	
       
  2893 @return The first day of the week.
       
  2894 */
       
  2895 	{return(iStartOfWeek);}
       
  2896 
       
  2897 
       
  2898 
       
  2899 
       
  2900 inline void TLocale::SetStartOfWeek(TDay aDay)
       
  2901 /**
       
  2902 Sets the day which is considered to be the first day of the week.
       
  2903 	
       
  2904 @param aDay The first day of the week.
       
  2905 */
       
  2906 	{iStartOfWeek=aDay;}
       
  2907 
       
  2908 
       
  2909 
       
  2910 
       
  2911 inline TClockFormat TLocale::ClockFormat() const
       
  2912 /**
       
  2913 Gets the clock display format.
       
  2914 	
       
  2915 @return The clock display format.
       
  2916 */
       
  2917 	{return(iClockFormat);}
       
  2918 
       
  2919 
       
  2920 
       
  2921 
       
  2922 inline void TLocale::SetClockFormat(TClockFormat aFormat)
       
  2923 /**
       
  2924 Sets the clock display format.
       
  2925 	
       
  2926 @param aFormat The clock display format.
       
  2927 */
       
  2928 	{iClockFormat=aFormat;}
       
  2929 
       
  2930 
       
  2931 
       
  2932 
       
  2933 inline TUnitsFormat TLocale::UnitsGeneral() const
       
  2934 /**
       
  2935 Gets the general units of measurement.
       
  2936 
       
  2937 This function should be used when both short and long distances use the
       
  2938 same units of measurement.
       
  2939 	
       
  2940 @return General units of measurement.
       
  2941 */
       
  2942 	{return(iUnitsGeneral);}
       
  2943 
       
  2944 
       
  2945 
       
  2946 
       
  2947 inline void TLocale::SetUnitsGeneral(TUnitsFormat aFormat)
       
  2948 /**
       
  2949 Sets the general units of measurement.
       
  2950 This function should be used when both short and long distances use the
       
  2951 same units of measurement.
       
  2952 	
       
  2953 @param aFormat General units of measurement.
       
  2954 */
       
  2955 	{iUnitsGeneral=aFormat;}
       
  2956 
       
  2957 
       
  2958 
       
  2959 
       
  2960 inline TUnitsFormat TLocale::UnitsDistanceShort() const
       
  2961 /**
       
  2962 Gets the units of measurement for short distances.
       
  2963 
       
  2964 Short distances are those which would normally be represented by either
       
  2965 metres and centimetres or feet and inches.
       
  2966 	
       
  2967 @return Units of measurement for short distances.
       
  2968 */
       
  2969 	{return(iUnitsDistanceShort);}
       
  2970 
       
  2971 
       
  2972 
       
  2973 
       
  2974 inline void TLocale::SetUnitsDistanceShort(TUnitsFormat aFormat)
       
  2975 /**
       
  2976 Sets the units of measurement for short distances.
       
  2977 
       
  2978 Short distances are those which would normally be represented by either
       
  2979 metres and centimetres or feet and inches.
       
  2980 	
       
  2981 @param aFormat Units of measurement for short distances.
       
  2982 */
       
  2983 	{iUnitsDistanceShort=aFormat;}
       
  2984 
       
  2985 
       
  2986 
       
  2987 
       
  2988 inline TUnitsFormat TLocale::UnitsDistanceLong() const
       
  2989 /**
       
  2990 Gets the units of measurement for long distances.
       
  2991 
       
  2992 Long distances are those which would normally be represented by either
       
  2993 miles or kilometres.
       
  2994 	
       
  2995 @return Units of measurement for long distances.
       
  2996 */
       
  2997 	{return(iUnitsDistanceLong);}
       
  2998 
       
  2999 
       
  3000 
       
  3001 
       
  3002 inline void TLocale::SetUnitsDistanceLong(TUnitsFormat aFormat)
       
  3003 /**
       
  3004 Sets the units of measurement for long distances.
       
  3005 
       
  3006 Long distances are those which would normally be represented by either
       
  3007 miles or kilometres.
       
  3008 	
       
  3009 @param aFormat Units of measurement for long distances.
       
  3010 */
       
  3011 	{iUnitsDistanceLong=aFormat;}
       
  3012 
       
  3013 
       
  3014 
       
  3015 
       
  3016 inline void TLocale::SetNegativeCurrencyFormat(TLocale::TNegativeCurrencyFormat aNegativeCurrencyFormat)
       
  3017 /**
       
  3018 Sets the negative currency format.
       
  3019 	
       
  3020 @param aNegativeCurrencyFormat How negative currency values are formatted.
       
  3021 */
       
  3022 	{iNegativeCurrencyFormat = aNegativeCurrencyFormat;}
       
  3023 
       
  3024 
       
  3025 
       
  3026 
       
  3027 inline TLocale::TNegativeCurrencyFormat TLocale::NegativeCurrencyFormat() const
       
  3028 /**
       
  3029 Gets the negative currency format.
       
  3030 	
       
  3031 @return How negative currency values are formatted.
       
  3032 */
       
  3033 	{return(iNegativeCurrencyFormat);}
       
  3034 
       
  3035 
       
  3036 
       
  3037 
       
  3038 inline TBool TLocale::NegativeLoseSpace() const
       
  3039 /**
       
  3040 Gets whether negative currency values lose the space between the currency 
       
  3041 symbol and the value.
       
  3042 	
       
  3043 @return True, if negative currency values lose the space between the value 
       
  3044 	    and the symbol; false, if not.
       
  3045 */
       
  3046 	{ 
       
  3047 	if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeLoseSpace)==iExtraNegativeCurrencyFormatFlags)
       
  3048 		return ETrue;
       
  3049 	else
       
  3050 		return EFalse;
       
  3051 	}
       
  3052 
       
  3053 
       
  3054 
       
  3055 
       
  3056 inline void TLocale::SetNegativeLoseSpace(TBool aBool)
       
  3057 /**
       
  3058 Sets whether negative currency values lose the space between the currency symbol 
       
  3059 and the value.
       
  3060 	
       
  3061 @param aBool ETrue to set a flag which indicates that negative currency values 
       
  3062 	         should lose the space between the value and the symbol. EFalse to unset it.
       
  3063 */
       
  3064 	{
       
  3065 	if(aBool)
       
  3066 		iExtraNegativeCurrencyFormatFlags |= EFlagNegativeLoseSpace;
       
  3067 	else
       
  3068 		iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeLoseSpace;
       
  3069 	}
       
  3070 
       
  3071 
       
  3072 
       
  3073 
       
  3074 inline TBool TLocale::NegativeCurrencySymbolOpposite() const
       
  3075 /**
       
  3076 Gets whether in negative currency values, the position of the currency symbol 
       
  3077 is set to be the opposite of the position used for non-negative values (before 
       
  3078 or after the value, as set by SetCurrencySymbolPosition()).
       
  3079 	
       
  3080 @return True, if the currency symbol position for negative currency values 
       
  3081 	    is the opposite of the position set by SetCurrencySymbolPosition();
       
  3082 		false, otherwise.
       
  3083 
       
  3084 @see TLocale::SetCurrencySymbolPosition
       
  3085 */
       
  3086 	{
       
  3087 	if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeCurrencySymbolOpposite)==iExtraNegativeCurrencyFormatFlags)
       
  3088 		return ETrue;
       
  3089 	else
       
  3090 		return EFalse;
       
  3091 	}
       
  3092 
       
  3093 
       
  3094 
       
  3095 
       
  3096 inline void TLocale::SetNegativeCurrencySymbolOpposite(TBool aBool)
       
  3097 /**
       
  3098 Sets whether the position of the currency symbol for negative currency values 
       
  3099 should be the opposite of the position used for non-negative values (before 
       
  3100 or after the value, as set by SetCurrencySymbolPosition()).
       
  3101 	
       
  3102 @param aBool ETrue to set the position of the currency symbol in negative 
       
  3103              currency values to be the opposite of the position as set
       
  3104 			 using SetCurrencySymbolPosition(). EFalse to leave the
       
  3105 			 position unchanged.
       
  3106 
       
  3107 @see TLocale::SetCurrencySymbolPosition
       
  3108 */
       
  3109 	{
       
  3110 	if (aBool)
       
  3111 		iExtraNegativeCurrencyFormatFlags |= EFlagNegativeCurrencySymbolOpposite;
       
  3112 	else
       
  3113 		iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeCurrencySymbolOpposite;
       
  3114 	}
       
  3115 
       
  3116 
       
  3117 
       
  3118 
       
  3119 inline TLanguage TLocale::LanguageDowngrade(TInt aIndex) const
       
  3120 /**
       
  3121 Gets the language that is stored at the specified index into the customisable 
       
  3122 part of the language downgrade path.
       
  3123 	
       
  3124 The second, third and fourth languages in the language downgrade path can 
       
  3125 be customised. These can be enquired using this function. The first language 
       
  3126 in the path is always the language of the current locale, as returned by User::Language(). 
       
  3127 	
       
  3128 The languages in the downgrade path are used in turn by the BaflUtils::NearestLanguageFile() 
       
  3129 function to find the best matching language-specific version of a language-neutral 
       
  3130 filename.
       
  3131 	
       
  3132 The full language downgrade path can be retrieved using BaflUtils::GetDowngradePath().
       
  3133 	
       
  3134 @param aIndex An index into the customisable part of the language downgrade 
       
  3135               path. Between zero and two inclusive.
       
  3136 
       
  3137 @return The language at the specified index.
       
  3138 
       
  3139 @see BaflUtils::NearestLanguageFile
       
  3140 @see BaflUtils::GetDowngradePath
       
  3141 */
       
  3142 	{
       
  3143 	__ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
       
  3144 	return static_cast<TLanguage>(iLanguageDowngrade[aIndex]);
       
  3145 	}
       
  3146 
       
  3147 
       
  3148 
       
  3149 
       
  3150 inline void TLocale::SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage)
       
  3151 /**
       
  3152 Sets a language in the customisable part of the language downgrade path.
       
  3153 	
       
  3154 @param aIndex    An index into the customisable part of the path at which to 
       
  3155 	             add the language, a value between zero and two.
       
  3156 @param aLanguage The language to add. ELangNone is considered to be the last 
       
  3157 	             language in the path, no more will be searched, so can be used
       
  3158 				 to specify that no language downgrade is required.
       
  3159 
       
  3160 @see BaflUtils::NearestLanguageFile
       
  3161 @see BaflUtils::GetDowngradePath
       
  3162 */
       
  3163 	{
       
  3164 	__ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
       
  3165 	iLanguageDowngrade[aIndex] = static_cast<TUint16>(aLanguage);
       
  3166 	}
       
  3167 
       
  3168 
       
  3169 
       
  3170 
       
  3171 /**
       
  3172 Gets the number mode stored in the locale.
       
  3173 
       
  3174 @return The number mode for the locale.
       
  3175 */
       
  3176 inline TDigitType TLocale::DigitType() const
       
  3177 	{ return iDigitType; }
       
  3178 
       
  3179 
       
  3180 
       
  3181 
       
  3182 /**
       
  3183 Sets the number mode for the locale. 
       
  3184 
       
  3185 @param aDigitType The number mode to be set.
       
  3186 */
       
  3187 inline void TLocale::SetDigitType(TDigitType aDigitType)
       
  3188 	{ iDigitType=aDigitType; }
       
  3189 
       
  3190 
       
  3191 
       
  3192 
       
  3193 /**
       
  3194 Sets the device time state.
       
  3195 
       
  3196 @param aState The device time state. 
       
  3197 
       
  3198 @deprecated Use the timezone server to coordinate automatic time adjustment.
       
  3199 */
       
  3200 inline void TLocale::SetDeviceTime(TDeviceTimeState aState)
       
  3201    	{
       
  3202    	iDeviceTimeState=aState;
       
  3203    	}
       
  3204 
       
  3205 
       
  3206 /**
       
  3207 Gets the device time state.
       
  3208 
       
  3209 @return The device time state.
       
  3210 
       
  3211 @deprecated Use the timezone server to coordinate automatic time adjustment.
       
  3212 */
       
  3213 inline TLocale::TDeviceTimeState TLocale::DeviceTime() const
       
  3214    	{
       
  3215    	return iDeviceTimeState;
       
  3216    	}
       
  3217 
       
  3218 
       
  3219 /**
       
  3220 Get the pointer to the TLocale object contained in this extended locale.
       
  3221 
       
  3222 @return Pointer to the TLocale object. 
       
  3223 */
       
  3224 inline TLocale*	TExtendedLocale::GetLocale()
       
  3225 	{ return &iLocale; }
       
  3226 
       
  3227 inline const LCharSet* TExtendedLocale::GetDefaultCharSet() 
       
  3228 	{ return iDefaultCharSet; }
       
  3229 
       
  3230 inline const LCharSet* TExtendedLocale::GetPreferredCharSet() 
       
  3231 	{ return iPreferredCharSet; }
       
  3232 
       
  3233 inline SLocaleLanguage* TExtendedLocale::GetLanguageSettings() 
       
  3234 	{return &iLanguageSettings;}
       
  3235 
       
  3236 inline SLocaleLocaleSettings* TExtendedLocale::GetLocaleExtraSettings() 
       
  3237 	{ return &iLocaleExtraSettings; };
       
  3238 
       
  3239 inline SLocaleTimeDateFormat* TExtendedLocale::GetLocaleTimeDateFormat() 
       
  3240 	{ return &iLocaleTimeDateFormat; }
       
  3241 
       
  3242 
       
  3243 // Class TFindSemaphore
       
  3244 inline TFindSemaphore::TFindSemaphore()
       
  3245     : TFindHandleBase()
       
  3246 /**
       
  3247 Constructs the object with a default match pattern.
       
  3248 
       
  3249 The default match pattern, as implemented by the base class, is the single 
       
  3250 character "*".
       
  3251 
       
  3252 A new match pattern can be set after construction by calling the Find() member 
       
  3253 function of the TFindHandleBase base class.
       
  3254 
       
  3255 @see TFindHandleBase::Find
       
  3256 */
       
  3257     {}
       
  3258 
       
  3259 
       
  3260 
       
  3261 
       
  3262 inline TFindSemaphore::TFindSemaphore(const TDesC &aMatch)
       
  3263     : TFindHandleBase(aMatch)
       
  3264 /**
       
  3265 Constructs this object with the specified match pattern.
       
  3266 
       
  3267 A new match pattern can be set after construction by
       
  3268 calling TFindHandleBase::Find().
       
  3269 
       
  3270 Note that after construction, the object contains a copy of the supplied
       
  3271 match pattern; the source descriptor can, therefore, be safely discarded.
       
  3272 
       
  3273 @param aMatch A reference to the descriptor containing the match pattern. 
       
  3274 
       
  3275 @see TFindHandleBase::Find
       
  3276 */
       
  3277     {}
       
  3278 
       
  3279 
       
  3280 
       
  3281 
       
  3282 // Class TFindMutex
       
  3283 inline TFindMutex::TFindMutex()
       
  3284     : TFindHandleBase()
       
  3285 /**
       
  3286 Constructs this object with a default match pattern.
       
  3287 
       
  3288 The default match pattern, as implemented by the base class, is the single 
       
  3289 character "*".
       
  3290 
       
  3291 A new match pattern can be set after construction by calling the Find() member 
       
  3292 function of the TFindHandleBase base class.
       
  3293 
       
  3294 @see TFindHandleBase::Find
       
  3295 */
       
  3296     {}
       
  3297 
       
  3298 
       
  3299 
       
  3300 
       
  3301 inline TFindMutex::TFindMutex(const TDesC &aMatch)
       
  3302     : TFindHandleBase(aMatch)
       
  3303 /**
       
  3304 Constructs this object with the specified match pattern.
       
  3305 
       
  3306 A new match pattern can be set after construction by calling the Find() member 
       
  3307 function of the TFindHandleBase base class.
       
  3308 
       
  3309 After construction, the object contains a copy of the supplied match pattern; 
       
  3310 the source descriptor can, therefore, be safely discarded.
       
  3311 
       
  3312 @param aMatch The match pattern.
       
  3313 
       
  3314 @see TFindHandleBase::Find
       
  3315 */
       
  3316     {}
       
  3317 
       
  3318 
       
  3319 
       
  3320 
       
  3321 // Class TFindChunk
       
  3322 inline TFindChunk::TFindChunk()
       
  3323     : TFindHandleBase()
       
  3324 /**
       
  3325 Constructs this object with a default match pattern.
       
  3326 
       
  3327 The default match pattern, as implemented by the base class, is
       
  3328 the single character "*".
       
  3329 
       
  3330 A new match pattern can be set after construction by
       
  3331 calling TFindHandleBase::Find().
       
  3332 
       
  3333 @see TFindHandleBase
       
  3334 */
       
  3335     {}
       
  3336 
       
  3337 
       
  3338 
       
  3339 
       
  3340 inline TFindChunk::TFindChunk(const TDesC &aMatch)
       
  3341     : TFindHandleBase(aMatch)
       
  3342 /**
       
  3343 Constructs the object with the specified match pattern.
       
  3344 
       
  3345 A new match pattern can be set after construction by
       
  3346 calling TFindHandleBase::Find().
       
  3347 
       
  3348 @param aMatch The match pattern.
       
  3349 
       
  3350 @see TFindHandleBase
       
  3351 */
       
  3352     {}
       
  3353 
       
  3354 
       
  3355 
       
  3356 
       
  3357 // Class TFindThread
       
  3358 inline TFindThread::TFindThread()
       
  3359     : TFindHandleBase()
       
  3360 /**
       
  3361 Constructs this object with a default match pattern.
       
  3362 
       
  3363 The default match pattern, as implemented by the base class,
       
  3364 is the single character *.
       
  3365 
       
  3366 A new match pattern can be set after construction
       
  3367 by calling TFindHandleBase::Find().
       
  3368 
       
  3369 @see TFindHandleBase::Find
       
  3370 */
       
  3371     {}
       
  3372 
       
  3373 
       
  3374 
       
  3375 
       
  3376 inline TFindThread::TFindThread(const TDesC &aMatch)
       
  3377     : TFindHandleBase(aMatch)
       
  3378 /**
       
  3379 Constructs this object with the specified match pattern.
       
  3380 
       
  3381 A new match pattern can be set after construction
       
  3382 by calling the TFindHandleBase::Find().
       
  3383 
       
  3384 @see TFindHandleBase::Find
       
  3385 */
       
  3386     {}
       
  3387 
       
  3388 
       
  3389 
       
  3390 
       
  3391 // Class TFindProcess
       
  3392 inline TFindProcess::TFindProcess()
       
  3393     : TFindHandleBase()
       
  3394 /**
       
  3395 Constructs this object with a default match pattern.
       
  3396 
       
  3397 The default match pattern, as implemented by the base class,
       
  3398 is the single character *.
       
  3399 
       
  3400 A new match pattern can be set after construction
       
  3401 by calling TFindHandleBase::Find().
       
  3402 
       
  3403 @see TFindHandleBase::Find
       
  3404 */
       
  3405     {}
       
  3406 
       
  3407 
       
  3408 
       
  3409 
       
  3410 inline TFindProcess::TFindProcess(const TDesC &aMatch)
       
  3411     : TFindHandleBase(aMatch)
       
  3412 /**
       
  3413 Constructs this object with the specified match pattern.
       
  3414 
       
  3415 A new match pattern can be set after construction
       
  3416 by calling the TFindHandleBase::Find().
       
  3417 
       
  3418 @see TFindHandleBase::Find
       
  3419 */
       
  3420     {}
       
  3421 
       
  3422 
       
  3423 
       
  3424 
       
  3425 // Class TFindLogicalDevice
       
  3426 /**
       
  3427 Constructs the LDD factory object with a default match pattern.
       
  3428 
       
  3429 The default match pattern, as implemented by the base class, is the single 
       
  3430 character "*".
       
  3431 
       
  3432 A new match pattern can be set after construction by calling the Find() member 
       
  3433 function of the TFindHandleBase base class.
       
  3434 
       
  3435 @see TFindHandleBase::Find
       
  3436 */
       
  3437 inline TFindLogicalDevice::TFindLogicalDevice()
       
  3438     : TFindHandleBase()
       
  3439     {}
       
  3440 
       
  3441 /**
       
  3442 Constructs the LDD factory object with a specified match pattern.
       
  3443 
       
  3444 A new match pattern can be set after construction by calling
       
  3445 TFindHandleBase::Find().
       
  3446 
       
  3447 @param aMatch The match pattern.
       
  3448 
       
  3449 @see TFindHandleBase::Find
       
  3450 */
       
  3451 inline TFindLogicalDevice::TFindLogicalDevice(const TDesC &aMatch)
       
  3452     : TFindHandleBase(aMatch)
       
  3453     {}
       
  3454 
       
  3455 // Class TFindPhysicalDevice
       
  3456 /**
       
  3457 Constructs the PDD factory object with a default match pattern.
       
  3458 
       
  3459 The default match pattern, as implemented by the base class, is the single 
       
  3460 character "*".
       
  3461 
       
  3462 A new match pattern can be set after construction by calling the Find() member 
       
  3463 function of the TFindHandleBase base class.
       
  3464 
       
  3465 @see TFindHandleBase::Find
       
  3466 */
       
  3467 inline TFindPhysicalDevice::TFindPhysicalDevice()
       
  3468     : TFindHandleBase()
       
  3469     {}
       
  3470 
       
  3471 /**
       
  3472 Constructs the PDD factory object with a specified match pattern.
       
  3473 
       
  3474 A new match pattern can be set after construction by calling
       
  3475 TFindHandleBase::Find().
       
  3476 
       
  3477 @param aMatch The match pattern.
       
  3478 
       
  3479 @see TFindHandleBase::Find
       
  3480 */
       
  3481 inline TFindPhysicalDevice::TFindPhysicalDevice(const TDesC &aMatch)
       
  3482     : TFindHandleBase(aMatch)
       
  3483     {}
       
  3484 
       
  3485 
       
  3486 
       
  3487 
       
  3488 
       
  3489 // Class TFindServer
       
  3490 inline TFindServer::TFindServer()
       
  3491     : TFindHandleBase()
       
  3492 /**
       
  3493 Constructs the object with a default match pattern.
       
  3494 
       
  3495 The default match pattern, as implemented by the base class, is the single 
       
  3496 character "*".
       
  3497 
       
  3498 A new match pattern can be set after construction by calling the Find() member 
       
  3499 function of the TFindHandleBase base class.
       
  3500 
       
  3501 @see TFindHandleBase::Find
       
  3502 */
       
  3503     {}
       
  3504 
       
  3505 
       
  3506 
       
  3507 
       
  3508 inline TFindServer::TFindServer(const TDesC &aMatch)
       
  3509     : TFindHandleBase(aMatch)
       
  3510 /**
       
  3511 Constructs the object with a specified match pattern.
       
  3512 
       
  3513 A new match pattern can be set after construction by calling
       
  3514 TFindHandleBase::Find().
       
  3515 
       
  3516 @param aMatch The match pattern.
       
  3517 
       
  3518 @see TFindHandleBase::Find
       
  3519 */
       
  3520     {}
       
  3521 
       
  3522 
       
  3523 
       
  3524 
       
  3525 // Class TFindLibrary
       
  3526 inline TFindLibrary::TFindLibrary()
       
  3527     : TFindHandleBase()
       
  3528 /**
       
  3529 Constructs this object with a default match pattern.
       
  3530 
       
  3531 The default match pattern is the single character ‘*’ and is implemented by
       
  3532 the base class TFindHandleBase.
       
  3533 */
       
  3534     {}
       
  3535 
       
  3536 
       
  3537 
       
  3538 
       
  3539 inline TFindLibrary::TFindLibrary(const TDesC &aMatch)
       
  3540     : TFindHandleBase(aMatch)
       
  3541 /**
       
  3542 Constructs this object with the specified match pattern.
       
  3543 
       
  3544 @param aMatch The descriptor containing the match pattern. 
       
  3545 */
       
  3546     {}
       
  3547 
       
  3548 
       
  3549 
       
  3550 
       
  3551 // Class RDevice
       
  3552 /**
       
  3553 Opens a handle to an LDD factory object found using a TFindLogicalDevice object.
       
  3554 
       
  3555 A TFindLogicalDevice object is used to find all LDD factory objects whose full names match 
       
  3556 a specified pattern.
       
  3557 
       
  3558 @param aFind A reference to the object which is used to find the LDD factory object.
       
  3559 @param aType An enumeration whose enumerators define the ownership of this 
       
  3560              LDD factory object handle. If not explicitly specified, EOwnerProcess is
       
  3561 			 taken as default.
       
  3562 
       
  3563 @return KErrNone if successful, otherwise one of the other system wide error 
       
  3564         codes.
       
  3565 */
       
  3566 inline TInt RDevice::Open(const TFindLogicalDevice& aFind,TOwnerType aType)
       
  3567 	{return(RHandleBase::Open(aFind,aType));}
       
  3568 
       
  3569 
       
  3570 
       
  3571 
       
  3572 // Class RCriticalSection
       
  3573 inline TBool RCriticalSection::IsBlocked() const
       
  3574 /**
       
  3575 Tests whether the critical section is occupied by another thread.
       
  3576 
       
  3577 @return True, if the critical section is occupied by another thread. False, 
       
  3578         otherwise.
       
  3579 */
       
  3580 	{return(iBlocked!=1);}
       
  3581 
       
  3582 
       
  3583 
       
  3584 
       
  3585 // Class RMutex
       
  3586 inline TInt RMutex::Open(const TFindMutex& aFind,TOwnerType aType)
       
  3587 /**
       
  3588 Opens a handle to the global mutex found using a TFindMutex object.
       
  3589 
       
  3590 A TFindMutex object is used to find all global mutexes whose full names match 
       
  3591 a specified pattern.
       
  3592 
       
  3593 By default, any thread in the process can use this instance of RMutex to access 
       
  3594 the mutex. However, specifying EOwnerThread as the second parameter to this 
       
  3595 function, means that only the opening thread can use this instance of RMutex 
       
  3596 to access the mutex; any other thread in this process that wants to access 
       
  3597 the mutex must either duplicate the handle or use OpenGlobal() again.
       
  3598 
       
  3599 @param aFind A reference to the object which is used to find the mutex.
       
  3600 @param aType An enumeration whose enumerators define the ownership of this 
       
  3601              mutex handle. If not explicitly specified, EOwnerProcess is
       
  3602 			 taken as default. 
       
  3603 
       
  3604 @return KErrNone if successful, otherwise one of the other system wide error 
       
  3605         codes.
       
  3606 */
       
  3607 	{return(RHandleBase::Open(aFind,aType));}
       
  3608 
       
  3609 
       
  3610 
       
  3611 
       
  3612 // Class RChunk
       
  3613 inline TInt RChunk::Open(const TFindChunk& aFind,TOwnerType aType)
       
  3614 /**
       
  3615 Opens a handle to the global chunk found using a TFindChunk object.
       
  3616 
       
  3617 A TFindChunk object is used to find all chunks whose full names match
       
  3618 a specified pattern. 
       
  3619 
       
  3620 By default, ownership of this chunk handle is vested in the current process, 
       
  3621 but can be vested in the current thread by passing EOwnerThread as the second 
       
  3622 parameter to this function.
       
  3623 
       
  3624 @param aFind A reference to the TFindChunk object used to find the chunk.
       
  3625 @param aType An enumeration whose enumerators define the ownership of this 
       
  3626              chunk handle. If not explicitly specified, EOwnerProcess is
       
  3627 			 taken as default.
       
  3628 
       
  3629 @return KErrNone if successful, otherwise another of the system error codes.
       
  3630 */
       
  3631 	{return(RHandleBase::Open(aFind,aType));}
       
  3632 
       
  3633 
       
  3634 
       
  3635 
       
  3636 inline TBool RChunk::IsReadable() const
       
  3637 /**
       
  3638 Tests whether the chunk is mapped into its process address space.
       
  3639 
       
  3640 @return True, if the chunk is readable; false, otherwise.
       
  3641 */
       
  3642 	{return (Attributes()&RHandleBase::EDirectReadAccess); }
       
  3643 
       
  3644 
       
  3645 
       
  3646 
       
  3647 inline TBool RChunk::IsWritable() const
       
  3648 /**
       
  3649 Tests whether the chunk mapped into its process address space and is writable.
       
  3650 
       
  3651 @return True, if the chunk is writable; false, otherwise.
       
  3652 */
       
  3653 	{return (Attributes()&RHandleBase::EDirectWriteAccess); }
       
  3654 
       
  3655 
       
  3656 
       
  3657 
       
  3658 // Class TObjectId
       
  3659 inline TObjectId::TObjectId()
       
  3660 /**
       
  3661 Default constructor.
       
  3662 */
       
  3663 	{}
       
  3664 
       
  3665 
       
  3666 
       
  3667 
       
  3668 inline TObjectId::TObjectId(TUint64 aId)
       
  3669 	: iId(aId)
       
  3670 /**
       
  3671 Constructor taking an unsigned integer value.
       
  3672 
       
  3673 @param aId The value of the object id.
       
  3674 */
       
  3675 	{}
       
  3676 
       
  3677 
       
  3678 
       
  3679 
       
  3680 inline TUint64 TObjectId::Id() const
       
  3681 /**
       
  3682 Return the ID as a 64 bit integer
       
  3683 */
       
  3684 	{ return iId; }
       
  3685 
       
  3686 
       
  3687 
       
  3688 
       
  3689 inline TObjectId::operator TUint() const
       
  3690 /**
       
  3691 Conversion operator invoked by the compiler when a TObjectId type is passed
       
  3692 to a function that is prototyped to take a TUint type.
       
  3693 
       
  3694 @see TUint
       
  3695 */
       
  3696 	{ return TUint(iId); }
       
  3697 
       
  3698 
       
  3699 
       
  3700 
       
  3701 inline TBool TObjectId::operator==(TObjectId aId) const
       
  3702 /**
       
  3703 Tests whether this thread Id is equal to the specified Id.
       
  3704 
       
  3705 @param aId The thread Id to be compared with this thread Id.
       
  3706 
       
  3707 @return True, if the thread Ids are equal; false otherwise.
       
  3708 */
       
  3709 	{return iId==aId.iId;}
       
  3710 
       
  3711 
       
  3712 
       
  3713 
       
  3714 inline TBool TObjectId::operator!=(TObjectId aId) const
       
  3715 /**
       
  3716 Tests whether this thread Id is unequal to the specified thread Id.
       
  3717 
       
  3718 @param aId The thread Id to be compared with this thread Id.
       
  3719 
       
  3720 @return True, if the thread Ids are unequal; false otherwise.
       
  3721 */
       
  3722 	{return iId!=aId.iId;}
       
  3723 
       
  3724 
       
  3725 
       
  3726 
       
  3727 // Class TThreadId
       
  3728 inline TThreadId::TThreadId()
       
  3729 	: TObjectId()
       
  3730 /**
       
  3731 Default constructor.
       
  3732 */
       
  3733 	{}
       
  3734 
       
  3735 
       
  3736 
       
  3737 
       
  3738 inline TThreadId::TThreadId(TUint64 aId)
       
  3739 	: TObjectId(aId)
       
  3740 /**
       
  3741 Constructor taking an unsigned integer value.
       
  3742 
       
  3743 @param aId The value of the thread id.
       
  3744 */
       
  3745 	{}
       
  3746 
       
  3747 
       
  3748 
       
  3749 
       
  3750 // Class RThread
       
  3751 inline RThread::RThread()
       
  3752 	: RHandleBase(KCurrentThreadHandle)
       
  3753 /**
       
  3754 Default constructor.
       
  3755 
       
  3756 The constructor exists to initialise private data within this handle; it does 
       
  3757 not create the thread object.
       
  3758 
       
  3759 Specifically, it sets the handle-number to the value KCurrentThreadHandle.
       
  3760 In effect, the constructor creates a default thread handle.
       
  3761 */
       
  3762 	{}
       
  3763 
       
  3764 
       
  3765 
       
  3766 
       
  3767 inline TInt RThread::Open(const TFindThread& aFind,TOwnerType aType)
       
  3768 /**
       
  3769 Opens a handle to the thread found by pattern matching a name.
       
  3770 
       
  3771 A TFindThread object is used to find all threads whose full names match a 
       
  3772 specified pattern. 
       
  3773 
       
  3774 By default, ownership of this thread handle is vested in the current process, 
       
  3775 but can be vested in the current thread by passing EOwnerThread as the second 
       
  3776 parameter to this function.
       
  3777 
       
  3778 @param aFind A reference to the TFindThread object used to find the thread.
       
  3779 @param aType An enumeration whose enumerators define the ownership of this 
       
  3780              thread handle. If not explicitly specified, EOwnerProcess is
       
  3781 			 taken as default.
       
  3782 
       
  3783 @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
  3784 */
       
  3785 	{return(RHandleBase::Open(aFind,aType));}
       
  3786 
       
  3787 
       
  3788 
       
  3789 
       
  3790 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  3791 
       
  3792 inline TBool RThread::HasCapability(TCapability aCapability, const char* aDiagnostic) const
       
  3793 	{
       
  3794 	return DoHasCapability(aCapability, aDiagnostic);
       
  3795 	}
       
  3796 
       
  3797 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
       
  3798 	{
       
  3799 	return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
       
  3800 	}
       
  3801 
       
  3802 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  3803 
       
  3804 // Only available to NULL arguments
       
  3805 inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
       
  3806 	{
       
  3807 	return DoHasCapability(aCapability);
       
  3808 	}
       
  3809 
       
  3810 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
       
  3811 	{
       
  3812 	return DoHasCapability(aCapability1, aCapability2);
       
  3813 	}
       
  3814 
       
  3815 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
       
  3816 // For things using KSuppressPlatSecDiagnostic
       
  3817 inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  3818 	{
       
  3819 	return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
       
  3820 	}
       
  3821 
       
  3822 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  3823 	{
       
  3824 	return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
       
  3825 	}
       
  3826 
       
  3827 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
       
  3828 
       
  3829 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  3830 
       
  3831 // Class TProcessId
       
  3832 inline TProcessId::TProcessId()
       
  3833 	: TObjectId()
       
  3834 /**
       
  3835 Default constructor.
       
  3836 */
       
  3837 	{}
       
  3838 
       
  3839 
       
  3840 
       
  3841 
       
  3842 inline TProcessId::TProcessId(TUint64 aId)
       
  3843 	: TObjectId(aId)
       
  3844 /**
       
  3845 Constructor taking an unsigned integer value.
       
  3846 
       
  3847 @param aId The value of the process id.
       
  3848 */
       
  3849 	{}
       
  3850 
       
  3851 
       
  3852 
       
  3853 
       
  3854 // Class RProcess
       
  3855 inline RProcess::RProcess()
       
  3856 	: RHandleBase(KCurrentProcessHandle)
       
  3857 /** 
       
  3858 Default constructor.
       
  3859 
       
  3860 The constructor exists to initialise private data within this handle; it does 
       
  3861 not create the process object.
       
  3862 
       
  3863 Specifically, it sets the handle-number to the value KCurrentProcessHandle.
       
  3864 In effect, the constructor creates a default process handle.
       
  3865 */
       
  3866 	{}
       
  3867 
       
  3868 
       
  3869 
       
  3870 
       
  3871 inline RProcess::RProcess(TInt aHandle)
       
  3872 	: RHandleBase(aHandle)
       
  3873 /**
       
  3874 Constructor taking a handle number.
       
  3875 
       
  3876 @param aHandle The handle number to be used to construct this RProcess handle.
       
  3877 */
       
  3878 	{}
       
  3879 
       
  3880 
       
  3881 
       
  3882 
       
  3883 inline TInt RProcess::Open(const TFindProcess& aFind,TOwnerType aType)
       
  3884 /**
       
  3885 Opens a handle to the process found by pattern matching a name.
       
  3886 
       
  3887 A TFindProcess object is used to find all processes whose full names match 
       
  3888 a specified pattern. 
       
  3889 
       
  3890 By default, ownership of this process handle is vested in the current process, 
       
  3891 but can be vested in the current thread by passing EOwnerThread as the second 
       
  3892 parameter to this function.
       
  3893 
       
  3894 @param aFind A reference to the TFindProcess object used to find the process.
       
  3895 @param aType An enumeration whose enumerators define the ownership of this 
       
  3896              process handle. If not explicitly specified, EOwnerProcess is taken
       
  3897 			 as default.
       
  3898 
       
  3899 @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
  3900 */
       
  3901 	{return(RHandleBase::Open(aFind,aType));}
       
  3902 
       
  3903 
       
  3904 
       
  3905 
       
  3906 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  3907 
       
  3908 inline TBool RProcess::HasCapability(TCapability aCapability, const char* aDiagnostic) const
       
  3909 	{
       
  3910 	return DoHasCapability(aCapability, aDiagnostic);
       
  3911 	}
       
  3912 
       
  3913 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
       
  3914 	{
       
  3915 	return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
       
  3916 	}
       
  3917 
       
  3918 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  3919 
       
  3920 // Only available to NULL arguments
       
  3921 inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
       
  3922 	{
       
  3923 	return DoHasCapability(aCapability);
       
  3924 	}
       
  3925 
       
  3926 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
       
  3927 	{
       
  3928 	return DoHasCapability(aCapability1, aCapability2);
       
  3929 	}
       
  3930 
       
  3931 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
       
  3932 // For things using KSuppressPlatSecDiagnostic
       
  3933 inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  3934 	{
       
  3935 	return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
       
  3936 	}
       
  3937 
       
  3938 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  3939 	{
       
  3940 	return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
       
  3941 	}
       
  3942 
       
  3943 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
       
  3944 
       
  3945 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  3946 
       
  3947 
       
  3948 
       
  3949 
       
  3950 
       
  3951 // Class RSessionBase
       
  3952 
       
  3953 
       
  3954 /**
       
  3955 Creates a session with a server, specifying no message slots.
       
  3956 
       
  3957 It should be called as part of session initialisation in the derived class.
       
  3958 
       
  3959 Message slots are not pre-allocated for the session but are taken from
       
  3960 a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
       
  3961 This raises a risk of failure due to lack of memory and, therefore, this mode
       
  3962 of operation is not viable for sessions that make guarantees about the failure
       
  3963 modes of asynchonous services.
       
  3964 
       
  3965 @param aServer  The name of the server with which a session is to
       
  3966                 be established.
       
  3967 @param aVersion The lowest version of the server with which this client
       
  3968                 is compatible
       
  3969 
       
  3970 @return KErrNone if successful, otherwise one of the other system-wide error
       
  3971         codes.
       
  3972 */
       
  3973 inline TInt RSessionBase::CreateSession(const TDesC& aServer,const TVersion& aVersion)
       
  3974 	{return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
       
  3975 
       
  3976 
       
  3977 
       
  3978 
       
  3979 /**
       
  3980 Creates a session with a server, specifying no message slots.
       
  3981 
       
  3982 It should be called as part of session initialisation in the derived class.
       
  3983 
       
  3984 Message slots are not pre-allocated for the session but are taken from
       
  3985 a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
       
  3986 This raises a risk of failure due to lack of memory and, therefore, this mode
       
  3987 of operation is not viable for sessions that make guarantees about the failure
       
  3988 modes of asynchonous services.
       
  3989 
       
  3990 @param aServer  A handle to a server with which a session is to be established.
       
  3991 @param aVersion The lowest version of the server with which this client
       
  3992                 is compatible
       
  3993 
       
  3994 @return KErrNone if successful, otherwise one of the other system-wide error
       
  3995         codes.
       
  3996 */
       
  3997 inline TInt RSessionBase::CreateSession(RServer2 aServer,const TVersion& aVersion)
       
  3998 	{return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
       
  3999 
       
  4000 
       
  4001 
       
  4002 
       
  4003 /**
       
  4004 Issues a blind request to the server with the specified function number,
       
  4005 and arguments.
       
  4006 
       
  4007 A blind request is one where the server does not issue a response
       
  4008 to the client.
       
  4009 
       
  4010 @param aFunction The function number identifying the request.
       
  4011 @param aArgs     A set of up to 4 arguments and their types to be passed
       
  4012                  to the server.
       
  4013 
       
  4014 @return KErrNone, if the send operation is successful;
       
  4015         KErrServerTerminated, if the server no longer present;
       
  4016         KErrServerBusy, if there are no message slots available;
       
  4017         KErrNoMemory, if there is insufficient memory available.
       
  4018 
       
  4019 @panic  USER 72 if the function number is negative.
       
  4020 */
       
  4021 inline TInt RSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
       
  4022 	{return DoSend(aFunction,&aArgs);}
       
  4023 
       
  4024 
       
  4025 
       
  4026 
       
  4027 /**
       
  4028 Issues an asynchronous request to the server with the specified function
       
  4029 number and arguments. 
       
  4030 
       
  4031 The completion status of the request is returned via the request
       
  4032 status object, aStatus. 
       
  4033 
       
  4034 @param aFunction The function number identifying the request.
       
  4035 @param aArgs     A set of up to 4 arguments and their types to be passed
       
  4036                  to the server.
       
  4037 @param aStatus   The request status object used to contain the completion status
       
  4038                  of the request.
       
  4039                  
       
  4040 @panic  USER 72  if the function number is negative.                 
       
  4041 */
       
  4042 inline void RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
       
  4043 	{DoSendReceive(aFunction,&aArgs,aStatus);}
       
  4044 
       
  4045 
       
  4046 
       
  4047 
       
  4048 /**
       
  4049 Issues a synchronous request to the server with the specified function number
       
  4050 and arguments.
       
  4051 
       
  4052 @param aFunction The function number identifying the request.
       
  4053 @param aArgs     A set of up to 4 arguments and their types to be passed
       
  4054                  to the server.
       
  4055 
       
  4056 @return KErrNone, if the send operation is successful;
       
  4057         KErrServerTerminated, if the server no longer present;
       
  4058         KErrServerBusy, if there are no message slots available;
       
  4059         KErrNoMemory, if there is insufficient memory available.
       
  4060 
       
  4061 @panic  USER 72  if the function number is negative.
       
  4062 */
       
  4063 inline TInt RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
       
  4064 	{return DoSendReceive(aFunction,&aArgs);}
       
  4065 
       
  4066 
       
  4067 
       
  4068 
       
  4069 /**
       
  4070 Issues a blind request to the server with the specified function number,
       
  4071 but with no arguments.
       
  4072 
       
  4073 A blind request is one where the server does not issue a response
       
  4074 to the client.
       
  4075 
       
  4076 @param aFunction The function number identifying the request.
       
  4077 
       
  4078 @return KErrNone, if the send operation is successful;
       
  4079         KErrServerTerminated, if the server no longer present;
       
  4080         KErrServerBusy, if there are no message slots available;
       
  4081         KErrNoMemory, if there is insufficient memory available.
       
  4082 
       
  4083 @panic  USER 72 if the function number is negative.
       
  4084 */
       
  4085 inline TInt RSessionBase::Send(TInt aFunction) const
       
  4086 	{return DoSend(aFunction,NULL);}
       
  4087 
       
  4088 
       
  4089 
       
  4090 
       
  4091 /**
       
  4092 Issues an asynchronous request to the server with the specified function
       
  4093 number, but with no arguments.
       
  4094 
       
  4095 The completion status of the request is returned via the request
       
  4096 status object, aStatus. 
       
  4097 
       
  4098 @param aFunction The function number identifying the request.
       
  4099 @param aStatus   The request status object used to contain the completion
       
  4100                  status of the request.
       
  4101                  
       
  4102 @panic  USER 72  if the function number is negative.                 
       
  4103 */
       
  4104 inline void RSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
       
  4105 	{ DoSendReceive(aFunction,NULL,aStatus);}
       
  4106 
       
  4107 
       
  4108 
       
  4109 
       
  4110 /**
       
  4111 Sets the handle-number of this handle to the specified 
       
  4112 value.
       
  4113 
       
  4114 The function can take a (zero or positive) handle-number,
       
  4115 or a (negative) error number.
       
  4116 
       
  4117 If aHandleOrError represents a handle-number, then the handle-number of this handle
       
  4118 is set to that value.
       
  4119 If aHandleOrError represents an error number, then the handle-number of this handle is set to zero
       
  4120 and the negative value is returned.
       
  4121 
       
  4122 @param aHandleOrError A handle-number, if zero or positive; an error value, if negative.
       
  4123 
       
  4124 @return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.
       
  4125 */
       
  4126 inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError)
       
  4127 	{ return RHandleBase::SetReturnedHandle(aHandleOrError);}
       
  4128 
       
  4129 
       
  4130 
       
  4131 
       
  4132 inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle)
       
  4133 	{ return RHandleBase::SetReturnedHandle(aHandleOrError,aHandle);}
       
  4134 /**
       
  4135 Issues a synchronous request to the server with the specified function number,
       
  4136 but with no arguments.
       
  4137 
       
  4138 @param aFunction The function number identifying the request.
       
  4139 
       
  4140 @return KErrNone, if the send operation is successful;
       
  4141         KErrServerTerminated, if the server no longer present;
       
  4142         KErrServerBusy, if there are no message slots available;
       
  4143         KErrNoMemory, if there is insufficient memory available.
       
  4144 
       
  4145 @panic  USER 72  if the function number is negative.
       
  4146 */
       
  4147 inline TInt RSessionBase::SendReceive(TInt aFunction) const
       
  4148 	{return DoSendReceive(aFunction,NULL);}
       
  4149 
       
  4150 
       
  4151 
       
  4152 
       
  4153 // Class RSubSessionBase
       
  4154 inline RSubSessionBase::RSubSessionBase()
       
  4155 	: iSubSessionHandle(0)
       
  4156 /**
       
  4157 Default constructor
       
  4158 */
       
  4159 	{}
       
  4160 
       
  4161 
       
  4162 
       
  4163 
       
  4164 inline TInt RSubSessionBase::SubSessionHandle() const
       
  4165 /**
       
  4166 Gets the sub-session handle number.
       
  4167 
       
  4168 This number is automatically passed to the server when making requests and is
       
  4169 used to identify the appropriate server-side sub-session.
       
  4170 
       
  4171 @return The sub-session handle number.
       
  4172 */
       
  4173 	{return iSubSessionHandle;}
       
  4174 
       
  4175 
       
  4176 
       
  4177 
       
  4178 /**
       
  4179 Creates a new sub-session within an existing session.
       
  4180 
       
  4181 @param aSession    The session to which this sub-session will belong.
       
  4182 @param aFunction   The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
       
  4183 @param aArgs       The message arguments.   
       
  4184 
       
  4185 @return            KErrNone if successful, otherwise one of the system-wide error codes.
       
  4186 */
       
  4187 inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs)
       
  4188 	{ return DoCreateSubSession(aSession,aFunction,&aArgs); }
       
  4189 
       
  4190 
       
  4191 
       
  4192 	
       
  4193 /**
       
  4194 Creates a new sub-session within an existing session.
       
  4195 
       
  4196 This variant sends no message arguments to the server.
       
  4197 
       
  4198 @param aSession    The session to which this sub-session will belong.
       
  4199 @param aFunction   The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
       
  4200 
       
  4201 @return            KErrNone if successful, otherwise one of the system-wide error codes.
       
  4202 */
       
  4203 inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction)
       
  4204 	{ return DoCreateSubSession(aSession,aFunction,NULL); }
       
  4205 
       
  4206 
       
  4207 
       
  4208 	
       
  4209 /**
       
  4210 Sends a blind message to the server - no reply is expected.
       
  4211 
       
  4212 A set of message arguments is passed that can be used to specify client
       
  4213 addresses, which the server can use to read from and write to the client
       
  4214 address space.
       
  4215 
       
  4216 Note that this function can fail if there are no available message-slots, either
       
  4217 in the system wide pool (if this is being used), or in the session reserved pool
       
  4218 (if this is being used). If the client request is synchronous, then always use
       
  4219 the synchronous variant of SendReceive(); this is guaranteed to reach the server.
       
  4220 
       
  4221 @param aFunction	The opcode specifying the requested service.
       
  4222 @param aArgs		The message arguments.
       
  4223                     
       
  4224 @return				KErrNone if successful, otherwise one of the system-wide error codes.                    
       
  4225 */
       
  4226 inline TInt RSubSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
       
  4227 	{return DoSend(aFunction,&aArgs);}
       
  4228 
       
  4229 
       
  4230 
       
  4231 	
       
  4232 /**
       
  4233 Sends a message to the server and waits asynchronously for the reply.
       
  4234 
       
  4235 An opcode specifies the service required.
       
  4236 A set of message arguments is passed that can be used to specify client addresses,
       
  4237 which the server can use to read from and write to the client address space.
       
  4238 
       
  4239 Note that this function can fail if there are no available message-slots, 
       
  4240 either in the system wide pool (if this is being used), or in the session
       
  4241 reserved pool (if this is being used). If the client request is synchronous,
       
  4242 then always use the synchronous variant of SendReceive();
       
  4243 this is guaranteed to reach the server.
       
  4244 
       
  4245 @param aFunction	The opcode specifying the requested service.
       
  4246 @param aArgs		The message arguments.
       
  4247 @param aStatus	    A request status which indicates the completion status of the asynchronous request.
       
  4248 */
       
  4249 inline void RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
       
  4250 	{DoSendReceive(aFunction,&aArgs,aStatus);}
       
  4251 
       
  4252 
       
  4253 
       
  4254 	
       
  4255 /**
       
  4256 Sends a message to the server and waits synchronously for a reply.
       
  4257 
       
  4258 An opcode specifies the service required.
       
  4259 A set of message arguments is passed that can be used to specify client addresses,
       
  4260 which the server can use to read from and write to the client address space.
       
  4261 
       
  4262 Note that this function will only fail if the server itself fails or environmental
       
  4263 errors occur in the server. All requests made using this function are guaranteed to
       
  4264 reach the server. This means that all synchronous client requests (typically those
       
  4265 that return void) should be routed through this synchronous variant of SendReceive().
       
  4266 
       
  4267 @param aFunction	The opcode specifying the requested service.
       
  4268 @param aArgs		The message arguments.
       
  4269 
       
  4270 @return				KErrNone if successful, otherwise one of the system-wide error codes. 
       
  4271 */
       
  4272 inline TInt RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
       
  4273 	{return DoSendReceive(aFunction,&aArgs);}
       
  4274 	
       
  4275 
       
  4276 
       
  4277 	
       
  4278 /**
       
  4279 Sends a blind message to the server - no reply is expected.
       
  4280 
       
  4281 This variant sends no message arguments to the server.
       
  4282 
       
  4283 @param aFunction	The opcode specifying the requested service.
       
  4284                     
       
  4285 @return				KErrNone if successful, otherwise one of the system-wide error codes. 
       
  4286 */
       
  4287 inline TInt RSubSessionBase::Send(TInt aFunction) const
       
  4288 	{return DoSend(aFunction,NULL);}
       
  4289 
       
  4290 
       
  4291 
       
  4292 	
       
  4293 /**
       
  4294 Sends a message to the server and waits asynchronously for the reply.
       
  4295 
       
  4296 An opcode specifies the service required.
       
  4297 This variant sends no message arguments to the server.
       
  4298 
       
  4299 @param aFunction	The opcode specifying the requested service.
       
  4300 @param aStatus	    A request status which indicates the completion status of the asynchronous request.
       
  4301 */
       
  4302 inline void RSubSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
       
  4303 	{ DoSendReceive(aFunction,NULL,aStatus);}
       
  4304 
       
  4305 
       
  4306 
       
  4307 	
       
  4308 /**
       
  4309 Sends a message to the server and waits synchronously for a reply.
       
  4310 
       
  4311 An opcode specifies the service required.
       
  4312 This variant sends no message arguments to the server.
       
  4313 
       
  4314 @param aFunction	The opcode specifying the requested service.
       
  4315 
       
  4316 @return				KErrNone if successful, otherwise one of the system-wide error codes. 
       
  4317 */
       
  4318 inline TInt RSubSessionBase::SendReceive(TInt aFunction) const
       
  4319 	{return DoSendReceive(aFunction,NULL);}
       
  4320 
       
  4321 
       
  4322 
       
  4323 
       
  4324 // Class RRefBase
       
  4325 
       
  4326 /**
       
  4327 Default constructor.
       
  4328 */
       
  4329 inline RRefBase::RRefBase()
       
  4330 	: iPtr(NULL)
       
  4331 	{}
       
  4332 
       
  4333 
       
  4334 
       
  4335 /**
       
  4336 Copy constructor.
       
  4337 
       
  4338 @param aRef A reference to the object to be copied.
       
  4339 */
       
  4340 inline RRefBase::RRefBase(const RRefBase &aRef)
       
  4341 	{Copy(aRef);}
       
  4342 
       
  4343 
       
  4344 
       
  4345 
       
  4346 // Class RRef
       
  4347 
       
  4348 
       
  4349 /**
       
  4350 Default constructor.
       
  4351 */
       
  4352 template <class T>
       
  4353 inline RRef<T>::RRef()
       
  4354 	{}
       
  4355 
       
  4356 
       
  4357 
       
  4358 /**
       
  4359 Copy constructor.
       
  4360 
       
  4361 The constructor frees any existing contained object, and takes ownership of
       
  4362 the object owned by anObject. 
       
  4363 
       
  4364 @param anObject A reference to another 'reference' object.
       
  4365                 On return from this constructor, anObject may be safely
       
  4366                 orphaned if it lives on the program stack.
       
  4367 */
       
  4368 template <class T>
       
  4369 inline RRef<T>::RRef(const RRef<T> &anObject)
       
  4370 	{Copy(anObject);}
       
  4371 
       
  4372 
       
  4373 
       
  4374 
       
  4375 /**
       
  4376 Assignment operator.
       
  4377 
       
  4378 The constructor frees any existing contained object, and takes ownership of
       
  4379 the object owned by anObject. 
       
  4380 
       
  4381 @param anObject A reference to another 'reference' object.
       
  4382                 On return from this constructor, anObject may be safely
       
  4383                 orphaned if it lives on the program stack.
       
  4384 */
       
  4385 template <class T>
       
  4386 inline void RRef<T>::operator=(const RRef<T> &anObject)
       
  4387 	{Copy(anObject);}
       
  4388 
       
  4389 
       
  4390 
       
  4391 
       
  4392 /**
       
  4393 Gets a pointer to the contained object.
       
  4394 
       
  4395 @return A pointer to the contained object
       
  4396 */
       
  4397 template <class T>
       
  4398 inline T *RRef<T>::operator->()
       
  4399 	{return((T *)iPtr);}
       
  4400 
       
  4401 
       
  4402 
       
  4403 
       
  4404 /**
       
  4405 Gets a pointer to the contained object.
       
  4406 
       
  4407 @return A pointer to the contained object
       
  4408 */
       
  4409 template <class T>
       
  4410 inline RRef<T>::operator T*()
       
  4411 	{return((T *)iPtr);}
       
  4412 
       
  4413 
       
  4414 
       
  4415 
       
  4416 /**
       
  4417 Creates a copy of the specified object, which is to be contained by
       
  4418 this reference object.
       
  4419 
       
  4420 The amount of memory set aside to contain the object is defined by the size
       
  4421 of the object
       
  4422 
       
  4423 @param anObject The object to be packaged up by this reference object.
       
  4424 */
       
  4425 template <class T>
       
  4426 void RRef<T>::Alloc(const T &anObject)
       
  4427 	{DoAlloc(&anObject,sizeof(T));}
       
  4428 
       
  4429 
       
  4430 
       
  4431 
       
  4432 /**
       
  4433 Creates a copy of the specified object, which is to be contained by
       
  4434 this reference object.
       
  4435 
       
  4436 The amount of memory set aside to contain the object is defined by aSize.
       
  4437 
       
  4438 @param anObject The object to be packaged up by this reference object.
       
  4439 @param aSize    The amount of memory to be set aside to contain the object.
       
  4440                 You must make sure that this is big enough.
       
  4441 */
       
  4442 template <class T>
       
  4443 void RRef<T>::Alloc(const T &anObject,TInt aSize)
       
  4444 	{DoAlloc(&anObject,aSize);}
       
  4445 
       
  4446 
       
  4447 
       
  4448 
       
  4449 /**
       
  4450 Creates a copy of the specified object, which is to be contained by
       
  4451 this reference object, and leaves on failure.
       
  4452 
       
  4453 The amount of memory set aside to contain the object is defined by the size
       
  4454 of the object
       
  4455 
       
  4456 @param anObject The object to be packaged up by this reference object.
       
  4457 */
       
  4458 template <class T>
       
  4459 void RRef<T>::AllocL(const T &anObject)
       
  4460 	{DoAllocL(&anObject,sizeof(T));}
       
  4461 
       
  4462 
       
  4463 
       
  4464 
       
  4465 /**
       
  4466 Creates a copy of the specified object, which is to be contained by
       
  4467 this reference object, and leaves on failure.
       
  4468 
       
  4469 The amount of memory set aside to contain the object is defined by aSize.
       
  4470 
       
  4471 @param anObject The object to be packaged up by this reference object.
       
  4472 @param aSize    The amount of memory to be set aside to contain the object.
       
  4473                 You must make sure that this is big enough.
       
  4474 */
       
  4475 template <class T>
       
  4476 void RRef<T>::AllocL(const T &anObject,TInt aSize)
       
  4477 	{DoAllocL(&anObject,aSize);}
       
  4478 
       
  4479 
       
  4480 
       
  4481 
       
  4482 // Class TRegion
       
  4483 inline TBool TRegion::CheckError() const
       
  4484 /** 
       
  4485 Tests whether the region's error flag is set.
       
  4486 
       
  4487 The error flag may be set:
       
  4488 
       
  4489 1. when an attempt to allocate more memory for the region fails
       
  4490 
       
  4491 2. if an attempt is made to expand a fixed size region beyond its allocated
       
  4492    size
       
  4493 
       
  4494 3. if ForceError() has been called.
       
  4495 
       
  4496 Use Clear() to unset the error flag, clear the region and free all allocated 
       
  4497 memory.
       
  4498 
       
  4499 @return True, if the error flag is set; false, otherwise. 
       
  4500 
       
  4501 @see TRegion::ForceError
       
  4502 @see TRegion::Clear
       
  4503 */
       
  4504 	{return(iError);}
       
  4505 
       
  4506 
       
  4507 
       
  4508 
       
  4509 inline TInt TRegion::Count() const
       
  4510 /**
       
  4511 Gets the number of rectangles in this region.
       
  4512 
       
  4513 @return The number of rectangles.
       
  4514 */
       
  4515 	{return(iCount);}
       
  4516 
       
  4517 
       
  4518 
       
  4519 
       
  4520 inline const TRect *TRegion::RectangleList() const
       
  4521 /**
       
  4522 Gets a pointer to the array of rectangles defining this region.
       
  4523 
       
  4524 @return Pointer to the array of rectangles. Note that array is a standard 
       
  4525         C++ array, i.e. a concatenated set of TRect objects. Use Count() to
       
  4526 		get the number of rectangles.
       
  4527 
       
  4528 @see TRegion::Count
       
  4529 */
       
  4530 	{return(((TRegion *)this)->RectangleListW());}
       
  4531 
       
  4532 
       
  4533 
       
  4534 
       
  4535 inline TRegion::TRegion()
       
  4536 	{}
       
  4537 
       
  4538 
       
  4539 
       
  4540 
       
  4541 // Class RRegion
       
  4542 inline TInt RRegion::CheckSpare() const
       
  4543 /**
       
  4544 Gets the number of free memory slots in the region.
       
  4545 
       
  4546 This is the number of slots which have been allocated, minus the number in 
       
  4547 use.
       
  4548 
       
  4549 @return The number of free memory slots in the region.
       
  4550 */
       
  4551 	{return(iAllocedRects-iCount);}
       
  4552 
       
  4553 
       
  4554 
       
  4555 
       
  4556 // Class TRegionFix
       
  4557 template <TInt S>
       
  4558 inline TRegionFix<S>::TRegionFix() : TRegion(-S)
       
  4559 /**
       
  4560 Constructs a default fixed size region.
       
  4561 */
       
  4562 	{}
       
  4563 
       
  4564 
       
  4565 
       
  4566 
       
  4567 template <TInt S>
       
  4568 inline TRegionFix<S>::TRegionFix(const TRect &aRect) : TRegion(-S)
       
  4569 /**
       
  4570 Constructs a fixed size region with a TRect.
       
  4571 
       
  4572 @param aRect Rectangle to be added to the newly constructed region.
       
  4573 */
       
  4574 	{AddRect(aRect);}
       
  4575 
       
  4576 
       
  4577 
       
  4578 
       
  4579 template <TInt S>
       
  4580 inline TRegionFix<S>::TRegionFix(const TRegionFix<S> &aRegion)
       
  4581 /**
       
  4582 Copy constructor.
       
  4583 
       
  4584 @param aRegion The TRegionFix object to be copied.
       
  4585 */
       
  4586 	{*this=aRegion;}
       
  4587 
       
  4588 
       
  4589 
       
  4590 
       
  4591 template <TInt S>
       
  4592 inline RRegionBuf<S>::RRegionBuf() : RRegion(-S&(~ERRegionBuf),S)
       
  4593 /**
       
  4594 Constructs a default object.
       
  4595 
       
  4596 The granularity is the value of the template parameter.
       
  4597 */
       
  4598 	{}
       
  4599 
       
  4600 
       
  4601 
       
  4602 template <TInt S>
       
  4603 inline RRegionBuf<S>::RRegionBuf(const RRegion &aRegion) 
       
  4604 /**
       
  4605 Constructs this object from the specified RRegion.
       
  4606 
       
  4607 @param aRegion The region to assign to this RRegionBuf.
       
  4608 */
       
  4609 	{*this=aRegion;}
       
  4610 
       
  4611 
       
  4612 
       
  4613 
       
  4614 template <TInt S>
       
  4615 inline RRegionBuf<S>::RRegionBuf(const TRect &aRect) : RRegion(-S&(~ERRegionBuf),S)
       
  4616 /**
       
  4617 Constructs an RRegionBuf with a TRect.
       
  4618 
       
  4619 Its granularity is initialised to the value contained in the template argument.
       
  4620 The resulting region consists of the specified single rectangle.
       
  4621 
       
  4622 @param aRect The single rectangle with which to initialise the region.
       
  4623 */
       
  4624 	{AddRect(aRect);}
       
  4625 
       
  4626 
       
  4627 
       
  4628 
       
  4629 template <TInt S>
       
  4630 inline RRegionBuf<S>::RRegionBuf(const RRegionBuf<S> &aRegion)
       
  4631 /**
       
  4632 Copy constructs from an existing RRegionBuf object.
       
  4633 
       
  4634 @param aRegion The RRegionBuf to be copied.
       
  4635 */
       
  4636     {*this=aRegion;}
       
  4637 
       
  4638 
       
  4639 
       
  4640 
       
  4641 // enum TTimerLockSpec
       
  4642 inline TTimerLockSpec &operator++(TTimerLockSpec &aLock)
       
  4643 	{
       
  4644 	return aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
       
  4645 	}
       
  4646 inline TTimerLockSpec operator++(TTimerLockSpec &aLock, TInt)
       
  4647 	{
       
  4648 	TTimerLockSpec l=aLock;
       
  4649 	aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
       
  4650 	return l;
       
  4651 	}
       
  4652 
       
  4653 
       
  4654 
       
  4655 
       
  4656 // Class TCheckedUid
       
  4657 inline const TUidType& TCheckedUid::UidType() const
       
  4658 /**
       
  4659 Gets the Uid type contained in this object.
       
  4660 
       
  4661 @return The Uid type.
       
  4662 */
       
  4663     {return(iType);}
       
  4664 
       
  4665 
       
  4666 
       
  4667 
       
  4668 // Array deletion support, uses CBase deletion (virtual d'tor) for all C-classes
       
  4669 template <class T>
       
  4670 /**	@internalComponent
       
  4671 */
       
  4672 void _DeleteArray(T** aBegin,T** aEnd)
       
  4673 	{for (;;) if (aBegin<aEnd) delete *aBegin++; else return;}
       
  4674 
       
  4675 template <class T>
       
  4676 /**	@internalComponent
       
  4677 */
       
  4678 struct _ArrayUtil
       
  4679 	{
       
  4680 	static inline void Delete(T* aBegin,T* aEnd,CBase*)
       
  4681 		{::_DeleteArray((CBase**)aBegin,(CBase**)aEnd);}
       
  4682 	static inline void Delete(T* aBegin,T* aEnd,TAny*)
       
  4683 		{::_DeleteArray(aBegin,aEnd);}
       
  4684 	static inline void Delete(T* aArray,TInt aCount)
       
  4685 		{Delete(aArray,aArray+aCount,*aArray);}
       
  4686 	};
       
  4687 
       
  4688 
       
  4689 
       
  4690 
       
  4691 #ifndef __TOOLS__
       
  4692 // Template class TFixedArray
       
  4693 IMPORT_C void PanicTFixedArray();
       
  4694 
       
  4695 
       
  4696 
       
  4697 
       
  4698 template <class T,TInt S>
       
  4699 inline TFixedArray<T,S>::TFixedArray()
       
  4700 /**
       
  4701 Default constructor.
       
  4702 
       
  4703 Constructs an uninitialised C++ array.
       
  4704 */
       
  4705 	{}
       
  4706 
       
  4707 
       
  4708 
       
  4709 
       
  4710 template <class T,TInt S>
       
  4711 inline void TFixedArray<T,S>::Copy(const T* aList,TInt aLength)
       
  4712 /**
       
  4713 Copies the specified set of contiguous objects into the C++ array.
       
  4714 
       
  4715 The copy operation starts at the beginning of the array, replacing
       
  4716 any existing data.
       
  4717 
       
  4718 @param aList   A pointer to a set of contiguous objects. 
       
  4719 @param aLength The number of contiguous objects to be copied. This value must
       
  4720                not be negative and must not be greater than the size of the
       
  4721 			   array as defined by the integer template parameter.
       
  4722 
       
  4723 @panic USER 133, in a debug build only, if aLength is negative or is greater
       
  4724        than the size of the array as defined by the integer template parameter.
       
  4725 */
       
  4726 	{__ASSERT_DEBUG(TUint(aLength)<=TUint(S),PanicTFixedArray());Mem::Copy(iRep,aList,aLength*sizeof(T));}
       
  4727 
       
  4728 
       
  4729 
       
  4730 
       
  4731 template <class T,TInt S>
       
  4732 inline TFixedArray<T,S>::TFixedArray(const T* aList,TInt aLength)
       
  4733 /**
       
  4734 Constructs a C++ array initialised with the specified objects.
       
  4735 
       
  4736 @param aList   A pointer to a set of contiguous objects. 
       
  4737 @param aLength The number of contiguous objects to be copied. This value must
       
  4738                not be negative and must not be greater than the size of the
       
  4739 			   array as defined by the integer template parameter.
       
  4740 
       
  4741 @panic USER 133, in a debug build only, if aLength is negative or is greater
       
  4742        than the size of the array as defined by the integer template parameter.
       
  4743 */
       
  4744 	{Copy(aList,aLength);}
       
  4745 
       
  4746 
       
  4747 
       
  4748 
       
  4749 template <class T,TInt S>
       
  4750 inline void TFixedArray<T,S>::Reset()
       
  4751 /**
       
  4752 Fills every element of the array with binary zeroes.
       
  4753 */
       
  4754 	{Mem::FillZ(iRep,sizeof(iRep));}
       
  4755 
       
  4756 
       
  4757 
       
  4758 
       
  4759 template <class T,TInt S>
       
  4760 inline TInt TFixedArray<T,S>::Count() const
       
  4761 /**
       
  4762 Gets the size of the array.
       
  4763 
       
  4764 For any instance of this class, the array size 
       
  4765 is fixed and has the same value as the integer template parameter.
       
  4766 
       
  4767 @return The size of the array.
       
  4768 */
       
  4769 	{return S;}
       
  4770 
       
  4771 
       
  4772 
       
  4773 
       
  4774 template <class T,TInt S>
       
  4775 inline TInt TFixedArray<T,S>::Length() const
       
  4776 /**
       
  4777 Gets the size of an array element, in bytes.
       
  4778 
       
  4779 @return The size of an array element, in bytes.
       
  4780 */
       
  4781 	{return sizeof(T);}
       
  4782 
       
  4783 
       
  4784 
       
  4785 
       
  4786 template <class T,TInt S>
       
  4787 inline TBool TFixedArray<T,S>::InRange(TInt aIndex)
       
  4788 	{return TUint(aIndex)<S;}
       
  4789 
       
  4790 
       
  4791 
       
  4792 
       
  4793 template <class T,TInt S>
       
  4794 inline T& TFixedArray<T,S>::operator[](TInt aIndex)
       
  4795 /**
       
  4796 Gets a reference to the specified element within the C++ array.
       
  4797 
       
  4798 @param aIndex The position of the element within the array. This is an offset value; 
       
  4799               a zero value refers to the first element in the array. This value must be 
       
  4800               greater than or equal to zero and less than the size of the array.
       
  4801 
       
  4802 @return A reference to an element of the array.
       
  4803 
       
  4804 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
       
  4805        of the array as defined by the integer template parameter.
       
  4806 */
       
  4807 	{__ASSERT_DEBUG(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
       
  4808 
       
  4809 
       
  4810 
       
  4811 
       
  4812 template <class T,TInt S>
       
  4813 inline const T& TFixedArray<T,S>::operator[](TInt aIndex) const
       
  4814 /**
       
  4815 Gets a const reference to the specified element within the C++ array.
       
  4816 
       
  4817 @param aIndex The position of the element within the array. This is an offset value; 
       
  4818               a zero value refers to the first element in the array. This value must be 
       
  4819               greater than or equal to zero and less than the size of the array.
       
  4820 
       
  4821 @return A const reference to an element of the array; the element cannot be 
       
  4822         changed through this reference.
       
  4823 
       
  4824 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
       
  4825        of the array as defined by the integer template parameter.
       
  4826 */
       
  4827 	{return CONST_CAST(ThisClass&,*this)[aIndex];}
       
  4828 
       
  4829 
       
  4830 
       
  4831 
       
  4832 template <class T,TInt S>
       
  4833 inline T& TFixedArray<T,S>::At(TInt aIndex)
       
  4834 /**
       
  4835 Gets a reference to the specified element within the C++ array.
       
  4836 
       
  4837 @param aIndex The position of the element within the array. This is an offset value; 
       
  4838               a zero value refers to the first element in the array. This value must be 
       
  4839               greater than or equal to zero and less than the size of the array.
       
  4840 
       
  4841 @return A reference to an element of the array.
       
  4842 
       
  4843 @panic USER 133, if aIndex is negative or greater than or equal to the size
       
  4844        of the array as defined by the integer template parameter.
       
  4845 */
       
  4846 	{__ASSERT_ALWAYS(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
       
  4847 
       
  4848 
       
  4849 
       
  4850 
       
  4851 template <class T,TInt S>
       
  4852 inline const T& TFixedArray<T,S>::At(TInt aIndex) const
       
  4853 /**
       
  4854 Gets a const reference to the specified element within the C++ array.
       
  4855 
       
  4856 @param aIndex The position of the element within the array. This is an offset value; 
       
  4857               a zero value refers to the first element in the array. This value must be 
       
  4858               greater than or equal to zero and less than the size of the array.
       
  4859 
       
  4860 @return A const reference to an element of the array; the element cannot be 
       
  4861         changed through this reference.
       
  4862 
       
  4863 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
       
  4864        of the array as defined by the integer template parameter.
       
  4865 */
       
  4866 	{return CONST_CAST(ThisClass&,*this).At(aIndex);}
       
  4867 
       
  4868 
       
  4869 
       
  4870 
       
  4871 template <class T,TInt S>
       
  4872 inline T* TFixedArray<T,S>::Begin()
       
  4873 /**
       
  4874 Gets a pointer to the first element of the array.
       
  4875 
       
  4876 @return A pointer to the first element of the array.
       
  4877 */
       
  4878 	{return &iRep[0];}
       
  4879 
       
  4880 
       
  4881 
       
  4882 
       
  4883 template <class T,TInt S>
       
  4884 inline T* TFixedArray<T,S>::End()
       
  4885 /**
       
  4886 Gets a pointer to the first byte following the end of the array.
       
  4887 
       
  4888 @return A pointer to the first byte following the end of the array.
       
  4889 */
       
  4890 	{return &iRep[S];}
       
  4891 
       
  4892 
       
  4893 
       
  4894 
       
  4895 template <class T,TInt S>
       
  4896 inline const T* TFixedArray<T,S>::Begin() const
       
  4897 /**
       
  4898 Gets a pointer to the first element of the array.
       
  4899 
       
  4900 @return A pointer to a const element of the array. 
       
  4901 */
       
  4902 	{return &iRep[0];}
       
  4903 
       
  4904 
       
  4905 
       
  4906 
       
  4907 template <class T,TInt S>
       
  4908 inline const T* TFixedArray<T,S>::End() const
       
  4909 /**
       
  4910 Gets a pointer to the first byte following the end of the array.
       
  4911 
       
  4912 @return A pointer to the const first byte following the end of the array.
       
  4913 */
       
  4914 	{return &iRep[S];}
       
  4915 
       
  4916 
       
  4917 
       
  4918 
       
  4919 template <class T,TInt S>
       
  4920 inline TInt TFixedArray<T,S>::CountFunctionR(const CBase*)
       
  4921 	{return S;}
       
  4922 
       
  4923 
       
  4924 
       
  4925 
       
  4926 template <class T,TInt S>
       
  4927 inline const TAny* TFixedArray<T,S>::AtFunctionR(const CBase* aThis,TInt aIndex)
       
  4928 	{return &REINTERPRET_CAST(const ThisClass&,*aThis)[aIndex];}
       
  4929 
       
  4930 
       
  4931 
       
  4932 
       
  4933 template <class T,TInt S>
       
  4934 inline TArray<T> TFixedArray<T,S>::Array() const
       
  4935 /**
       
  4936 Creates and returns a generic array for this C++ array.
       
  4937 
       
  4938 @return A generic array for this C++ array.
       
  4939 */
       
  4940 	{return TArray<T>(CountFunctionR,AtFunctionR,REINTERPRET_CAST(const CBase*,this));}
       
  4941 
       
  4942 
       
  4943 
       
  4944 
       
  4945 template <class T,TInt S>
       
  4946 inline void TFixedArray<T,S>::DeleteAll()
       
  4947 /**
       
  4948 Invokes the delete operator on every member of the array.
       
  4949 
       
  4950 The function can only be used for arrays of pointers to CBase derived objects.
       
  4951 
       
  4952 If the array is to be used after a call to this function, it is good practice 
       
  4953 to call TFixedArray<class T,TInt S>::Reset() to set all array elements to 
       
  4954 NULL.
       
  4955 */
       
  4956 	{_ArrayUtil<T>::Delete(iRep,S);}
       
  4957 #endif
       
  4958 
       
  4959 
       
  4960 
       
  4961 
       
  4962 // class User
       
  4963 
       
  4964 inline RHeap* User::SwitchHeap(RAllocator* aHeap)
       
  4965 /**
       
  4966 Changes the current thread's heap.
       
  4967 	
       
  4968 @param aHeap A pointer to the new heap handle.
       
  4969 
       
  4970 @return A pointer to the old heap handle.
       
  4971 */
       
  4972 	{ return (RHeap*)SwitchAllocator(aHeap); }
       
  4973 
       
  4974 
       
  4975 
       
  4976 
       
  4977 inline RHeap& User::Heap()
       
  4978 /**
       
  4979 Gets a reference to the handle to the current thread's heap.
       
  4980 	
       
  4981 @return A reference to the handle to the current thread's heap.
       
  4982 */
       
  4983 	{ return (RHeap&)Allocator(); }
       
  4984 
       
  4985 
       
  4986 
       
  4987 
       
  4988 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  4989 
       
  4990 inline TBool User::CreatorHasCapability(TCapability aCapability, const char* aDiagnostic)
       
  4991 	{
       
  4992 	return DoCreatorHasCapability(aCapability, aDiagnostic);
       
  4993 	}
       
  4994 
       
  4995 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic)
       
  4996 	{
       
  4997 	return DoCreatorHasCapability(aCapability1, aCapability2, aDiagnostic);
       
  4998 	}
       
  4999 
       
  5000 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  5001 
       
  5002 // Only available to NULL arguments
       
  5003 inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/)
       
  5004 	{
       
  5005 	return DoCreatorHasCapability(aCapability);
       
  5006 	}
       
  5007 
       
  5008 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/)
       
  5009 	{
       
  5010 	return DoCreatorHasCapability(aCapability1, aCapability2);
       
  5011 	}
       
  5012 
       
  5013 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
       
  5014 // For things using KSuppressPlatSecDiagnostic
       
  5015 inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
       
  5016 	{
       
  5017 	return DoCreatorHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
       
  5018 	}
       
  5019 
       
  5020 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
       
  5021 	{
       
  5022 	return DoCreatorHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
       
  5023 	}
       
  5024 
       
  5025 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
       
  5026 
       
  5027 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  5028 
       
  5029 /** Sets this TSecurityInfo to the security attributes of this process. */
       
  5030 inline void TSecurityInfo::SetToCurrentInfo()
       
  5031 	{ new (this) TSecurityInfo(RProcess()); }
       
  5032 
       
  5033 /** Constructs a TSecurityInfo using the security attributes of aProcess */
       
  5034 inline void TSecurityInfo::Set(RProcess aProcess)
       
  5035 	{ new (this) TSecurityInfo(aProcess); }
       
  5036 
       
  5037 /** Constructs a TSecurityInfo using the security attributes of the process
       
  5038 owning aThread 
       
  5039 */
       
  5040 inline void TSecurityInfo::Set(RThread aThread)
       
  5041 	{ new (this) TSecurityInfo(aThread); }
       
  5042 
       
  5043 /** Constructs a TSecurityInfo using the security attributes of the process
       
  5044 which sent the message aMsgPtr */
       
  5045 inline void TSecurityInfo::Set(RMessagePtr2 aMsgPtr)
       
  5046 	{ new (this) TSecurityInfo(aMsgPtr); }
       
  5047 
       
  5048 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  5049 
       
  5050 /** Checks this policy against the platform security attributes of aProcess.
       
  5051 
       
  5052 	When a check fails the action taken is determined by the system wide Platform Security
       
  5053 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5054 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5055 	check failed.
       
  5056 
       
  5057 @param aProcess The RProcess object to check against this TSecurityPolicy.
       
  5058 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5059 							that may be issued if the policy check fails.
       
  5060 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5061 							which enables it to be easily removed from the system.
       
  5062 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5063 platform security attributes of aProcess, EFalse otherwise.
       
  5064 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5065 */
       
  5066 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
       
  5067 	{
       
  5068 	return DoCheckPolicy(aProcess, aDiagnostic);
       
  5069 	}
       
  5070 
       
  5071 /** Checks this policy against the platform security attributes of the process
       
  5072 owning aThread.
       
  5073 
       
  5074 	When a check fails the action taken is determined by the system wide Platform Security
       
  5075 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5076 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5077 	check failed.
       
  5078 
       
  5079 @param aThread The thread whose owning process' platform security attributes
       
  5080 are to be checked against this TSecurityPolicy.
       
  5081 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5082 							that may be issued if the policy check fails.
       
  5083 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5084 							which enables it to be easily removed from the system.
       
  5085 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5086 platform security parameters of the owning process of aThread, EFalse otherwise.
       
  5087 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5088 */
       
  5089 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
       
  5090 	{
       
  5091 	return DoCheckPolicy(aThread, aDiagnostic);
       
  5092 	}
       
  5093 
       
  5094 /** Checks this policy against the platform security attributes of the process which sent
       
  5095 the given message.
       
  5096 
       
  5097 	When a check fails the action taken is determined by the system wide Platform Security
       
  5098 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5099 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5100 	check failed.
       
  5101 
       
  5102 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
       
  5103 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5104 							that may be issued if the policy check fails.
       
  5105 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5106 							which enables it to be easily removed from the system.
       
  5107 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5108 platform security attributes of aMsg, EFalse otherwise.
       
  5109 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5110 */
       
  5111 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
       
  5112 	{
       
  5113 	return DoCheckPolicy(aMsgPtr, aDiagnostic);
       
  5114 	}
       
  5115 
       
  5116 /** Checks this policy against the platform security attributes of the process which sent
       
  5117 the given message.
       
  5118 
       
  5119 	When a check fails the action taken is determined by the system wide Platform Security
       
  5120 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5121 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5122 	check failed.
       
  5123 
       
  5124 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
       
  5125 @param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
       
  5126 				it finds to be missing. 
       
  5127 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5128 							that may be issued if the policy check fails.
       
  5129 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5130 							which enables it to be easily removed from the system.
       
  5131 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5132 platform security attributes of aMsg, EFalse otherwise.
       
  5133 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5134 
       
  5135 @internalComponent
       
  5136 */
       
  5137 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
       
  5138 	{
       
  5139 	return DoCheckPolicy(aMsgPtr, aMissing, aDiagnostic);
       
  5140 	}
       
  5141 
       
  5142 /** Checks this policy against the platform security attributes of this process' creator.
       
  5143 
       
  5144 	When a check fails the action taken is determined by the system wide Platform Security
       
  5145 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5146 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5147 	check failed.
       
  5148 
       
  5149 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5150 							that may be issued if the policy check fails.
       
  5151 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5152 							which enables it to be easily removed from the system.
       
  5153 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5154 platform security attributes of this process' creator, EFalse otherwise.
       
  5155 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5156 */
       
  5157 inline TBool TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
       
  5158 	{
       
  5159 	return DoCheckPolicyCreator(aDiagnostic);
       
  5160 	}
       
  5161 
       
  5162 /**
       
  5163 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
       
  5164 */
       
  5165 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
       
  5166 	{
       
  5167 	return (&(*this))->CheckPolicy(aProcess, aDiagnostic);
       
  5168 	}
       
  5169 
       
  5170 /**
       
  5171 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
       
  5172 */
       
  5173 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
       
  5174 	{
       
  5175 	return (&(*this))->CheckPolicy(aThread, aDiagnostic);
       
  5176 	}
       
  5177 
       
  5178 /**
       
  5179 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
       
  5180 */
       
  5181 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
       
  5182 	{
       
  5183 	return (&(*this))->CheckPolicy(aMsgPtr, aDiagnostic);
       
  5184 	}
       
  5185 
       
  5186 /**
       
  5187 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
       
  5188 @internalComponent
       
  5189 */
       
  5190 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
       
  5191 	{
       
  5192 	return (&(*this))->CheckPolicy(aMsgPtr, aMissing, aDiagnostic);
       
  5193 	}
       
  5194 
       
  5195 /**
       
  5196 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
       
  5197 */
       
  5198 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
       
  5199 	{
       
  5200 	return (&(*this))->CheckPolicyCreator(aDiagnostic);
       
  5201 	}
       
  5202 
       
  5203 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  5204 
       
  5205 /** Checks this policy against the platform security attributes of aProcess.
       
  5206 
       
  5207 	When a check fails the action taken is determined by the system wide Platform Security
       
  5208 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5209 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5210 	check failed.
       
  5211 
       
  5212 @param aProcess The RProcess object to check against this TSecurityPolicy.
       
  5213 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5214 							that may be issued if the policy check fails.
       
  5215 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5216 							which enables it to be easily removed from the system.
       
  5217 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5218 platform security attributes of aProcess, EFalse otherwise.
       
  5219 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5220 */
       
  5221 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5222 	{
       
  5223 	return DoCheckPolicy(aProcess);
       
  5224 	}
       
  5225 
       
  5226 /** Checks this policy against the platform security attributes of the process
       
  5227 owning aThread.
       
  5228 
       
  5229 	When a check fails the action taken is determined by the system wide Platform Security
       
  5230 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5231 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5232 	check failed.
       
  5233 
       
  5234 @param aThread The thread whose owning process' platform security attributes
       
  5235 are to be checked against this TSecurityPolicy.
       
  5236 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5237 							that may be issued if the policy check fails.
       
  5238 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5239 							which enables it to be easily removed from the system.
       
  5240 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5241 platform security parameters of the owning process of aThread, EFalse otherwise.
       
  5242 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5243 */
       
  5244 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5245 	{
       
  5246 	return DoCheckPolicy(aThread);
       
  5247 	}
       
  5248 
       
  5249 /** Checks this policy against the platform security attributes of the process which sent
       
  5250 the given message.
       
  5251 
       
  5252 	When a check fails the action taken is determined by the system wide Platform Security
       
  5253 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5254 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5255 	check failed.
       
  5256 
       
  5257 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
       
  5258 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5259 							that may be issued if the policy check fails.
       
  5260 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5261 							which enables it to be easily removed from the system.
       
  5262 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5263 platform security attributes of aMsg, EFalse otherwise.
       
  5264 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5265 */
       
  5266 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5267 	{
       
  5268 	return DoCheckPolicy(aMsgPtr);
       
  5269 	}
       
  5270 
       
  5271 /** Checks this policy against the platform security attributes of the process which sent
       
  5272 the given message.
       
  5273 
       
  5274 	When a check fails the action taken is determined by the system wide Platform Security
       
  5275 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5276 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5277 	check failed.
       
  5278 
       
  5279 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
       
  5280 @param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
       
  5281 				it finds to be missing. 
       
  5282 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5283 							that may be issued if the policy check fails.
       
  5284 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5285 							which enables it to be easily removed from the system.
       
  5286 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5287 platform security attributes of aMsg, EFalse otherwise.
       
  5288 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5289 
       
  5290 @internalComponent
       
  5291 */
       
  5292 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5293 	{
       
  5294 	return DoCheckPolicy(aMsgPtr, aMissing);
       
  5295 	}
       
  5296 
       
  5297 /** Checks this policy against the platform security attributes of this process' creator.
       
  5298 
       
  5299 	When a check fails the action taken is determined by the system wide Platform Security
       
  5300 	configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
       
  5301 	If PlatSecEnforcement is OFF, then this function will return ETrue even though the
       
  5302 	check failed.
       
  5303 
       
  5304 @param aDiagnostic A string that will be emitted along with any diagnostic message
       
  5305 							that may be issued if the policy check fails.
       
  5306 							This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
       
  5307 							which enables it to be easily removed from the system.
       
  5308 @return ETrue if all the requirements of this TSecurityPolicy are met by the
       
  5309 platform security attributes of this process' creator, EFalse otherwise.
       
  5310 @panic USER 190 if 'this' is an invalid SSecurityInfo object
       
  5311 */
       
  5312 inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
       
  5313 	{
       
  5314 	return DoCheckPolicyCreator();
       
  5315 	}
       
  5316 
       
  5317 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
       
  5318 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5319 	{
       
  5320 	return DoCheckPolicy(aProcess, KSuppressPlatSecDiagnosticMagicValue);
       
  5321 	}
       
  5322 
       
  5323 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5324 	{
       
  5325 	return DoCheckPolicy(aThread, KSuppressPlatSecDiagnosticMagicValue);
       
  5326 	}
       
  5327 
       
  5328 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5329 	{
       
  5330 	return DoCheckPolicy(aMsgPtr, KSuppressPlatSecDiagnosticMagicValue);
       
  5331 	}
       
  5332 
       
  5333 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5334 	{
       
  5335 	return DoCheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnosticMagicValue);
       
  5336 	}
       
  5337 
       
  5338 inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5339 	{
       
  5340 	return DoCheckPolicyCreator(KSuppressPlatSecDiagnosticMagicValue);
       
  5341 	}
       
  5342 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
       
  5343 
       
  5344 /**
       
  5345 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
       
  5346 */
       
  5347 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5348 	{
       
  5349 	return (&(*this))->CheckPolicy(aProcess);
       
  5350 	}
       
  5351 
       
  5352 /**
       
  5353 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
       
  5354 */
       
  5355 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5356 	{
       
  5357 	return (&(*this))->CheckPolicy(aThread);
       
  5358 	}
       
  5359 
       
  5360 /**
       
  5361 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
       
  5362 */
       
  5363 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5364 	{
       
  5365 	return (&(*this))->CheckPolicy(aMsgPtr);
       
  5366 	}
       
  5367 
       
  5368 /**
       
  5369 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
       
  5370 @internalComponent
       
  5371 */
       
  5372 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
       
  5373 	{
       
  5374 	return (&(*this))->CheckPolicy(aMsgPtr, aMissing);
       
  5375 	}
       
  5376 
       
  5377 /**
       
  5378 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
       
  5379 */
       
  5380 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
       
  5381 	{
       
  5382 	return (&(*this))->CheckPolicyCreator();
       
  5383 	}
       
  5384 
       
  5385 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
       
  5386 /**
       
  5387 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
       
  5388 */
       
  5389 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5390 	{
       
  5391 	return (&(*this))->CheckPolicy(aProcess, KSuppressPlatSecDiagnostic);
       
  5392 	}
       
  5393 
       
  5394 /**
       
  5395 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
       
  5396 */
       
  5397 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5398 	{
       
  5399 	return (&(*this))->CheckPolicy(aThread, KSuppressPlatSecDiagnostic);
       
  5400 	}
       
  5401 
       
  5402 /**
       
  5403 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
       
  5404 */
       
  5405 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5406 	{
       
  5407 	return (&(*this))->CheckPolicy(aMsgPtr, KSuppressPlatSecDiagnostic);
       
  5408 	}
       
  5409 
       
  5410 /**
       
  5411 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
       
  5412 @internalComponent
       
  5413 */
       
  5414 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5415 	{
       
  5416 	return (&(*this))->CheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnostic);
       
  5417 	}
       
  5418 
       
  5419 /**
       
  5420 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
       
  5421 */
       
  5422 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  5423 	{
       
  5424 	return (&(*this))->CheckPolicyCreator(KSuppressPlatSecDiagnostic);
       
  5425 	}
       
  5426 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
       
  5427 
       
  5428 #endif //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  5429 
       
  5430 
       
  5431 
       
  5432 #ifndef __KERNEL_MODE__
       
  5433 
       
  5434 /**
       
  5435 Appends an object pointer onto the array.
       
  5436 
       
  5437 The function leaves with one of the system wide error codes, if the operation fails.
       
  5438 
       
  5439 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5440 
       
  5441 @param anEntry The object pointer to be appended.
       
  5442 */
       
  5443 template <class T>
       
  5444 inline void RPointerArray<T>::AppendL(const T* anEntry)
       
  5445 	{ User::LeaveIfError(Append(anEntry));}
       
  5446 
       
  5447 
       
  5448 /**
       
  5449 Inserts an object pointer into the array at the specified position.
       
  5450 
       
  5451 The function leaves with one of the system wide error codes, if
       
  5452 the operation fails.
       
  5453 
       
  5454 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5455 
       
  5456 @param anEntry The object pointer to be inserted.
       
  5457 @param aPos    The position within the array where the object pointer is to be 
       
  5458                inserted. The position is relative to zero, i.e. zero implies
       
  5459 			   that a pointer is inserted at the beginning of the array.
       
  5460 
       
  5461 @panic USER 131, if aPos is negative, or is greater than the number of object
       
  5462        pointers currently in the array.
       
  5463 */
       
  5464 template <class T>
       
  5465 inline void RPointerArray<T>::InsertL(const T* anEntry, TInt aPos)
       
  5466 	{ User::LeaveIfError(Insert(anEntry,aPos)); }
       
  5467 
       
  5468 
       
  5469 /**
       
  5470 Finds the first object pointer in the array which matches the specified object 
       
  5471 pointer, using a sequential search.
       
  5472 
       
  5473 Matching is based on the comparison of pointers.
       
  5474 
       
  5475 The find operation always starts at the low index end of the array. There 
       
  5476 is no assumption about the order of objects in the array.
       
  5477 
       
  5478 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5479 
       
  5480 @param anEntry The object pointer to be found.
       
  5481 @return The index of the first matching object pointer within the array.
       
  5482 @leave KErrNotFound, if no matching object pointer can be found.
       
  5483 */
       
  5484 template <class T>
       
  5485 inline TInt RPointerArray<T>::FindL(const T* anEntry) const
       
  5486 	{ return User::LeaveIfError(Find(anEntry));}
       
  5487 
       
  5488 
       
  5489 /**
       
  5490 Finds the first object pointer in the array whose object matches the specified 
       
  5491 object, using a sequential search and a matching algorithm.
       
  5492 
       
  5493 The algorithm for determining whether two class T objects match is provided 
       
  5494 by a function supplied by the caller.
       
  5495 
       
  5496 The find operation always starts at the low index end of the array. There 
       
  5497 is no assumption about the order of objects in the array.
       
  5498 
       
  5499 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5500 
       
  5501 @param anEntry    The object pointer to be found.
       
  5502 @param anIdentity A package encapsulating the function which determines whether 
       
  5503                   two class T objects match.
       
  5504 
       
  5505 @return The index of the first matching object pointer within the array.
       
  5506 @leave  KErrNotFound, if no suitable object pointer can be found.
       
  5507 */
       
  5508 template <class T>
       
  5509 inline TInt RPointerArray<T>::FindL(const T* anEntry, TIdentityRelation<T> anIdentity) const
       
  5510 	{ return User::LeaveIfError(Find(anEntry, anIdentity));}
       
  5511 
       
  5512 
       
  5513 /**
       
  5514 Finds the last object pointer in the array which matches the specified object 
       
  5515 pointer, using a sequential search.
       
  5516 
       
  5517 Matching is based on the comparison of pointers.
       
  5518 
       
  5519 The find operation always starts at the high index end of the array. There 
       
  5520 is no assumption about the order of objects in the array.
       
  5521 
       
  5522 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5523 
       
  5524 @param anEntry The object pointer to be found.
       
  5525 @return The index of the last matching object pointer within the array.
       
  5526 @leave KErrNotFound, if no matching object pointer can be found.
       
  5527 */
       
  5528 template <class T>
       
  5529 inline TInt RPointerArray<T>::FindReverseL(const T* anEntry) const
       
  5530 	{ return User::LeaveIfError(FindReverse(anEntry));}
       
  5531 
       
  5532 
       
  5533 /**
       
  5534 Finds the last object pointer in the array whose object matches the specified 
       
  5535 object, using a sequential search and a matching algorithm.
       
  5536 
       
  5537 The algorithm for determining whether two class T objects match is provided 
       
  5538 by a function supplied by the caller.
       
  5539 
       
  5540 The find operation always starts at the high index end of the array. There 
       
  5541 is no assumption about the order of objects in the array.
       
  5542 
       
  5543 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5544 
       
  5545 @param anEntry    The object pointer to be found.
       
  5546 @param anIdentity A package encapsulating the function which determines whether 
       
  5547                   two class T objects match.
       
  5548 
       
  5549 @return The index of the last matching object pointer within the array.
       
  5550 @leave  KErrNotFound, if no suitable object pointer can be found.
       
  5551 */
       
  5552 template <class T>
       
  5553 inline TInt RPointerArray<T>::FindReverseL(const T* anEntry, TIdentityRelation<T> anIdentity) const
       
  5554 	{ return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
       
  5555 
       
  5556 
       
  5557 /**
       
  5558 Finds the object pointer in the array that matches the specified object
       
  5559 pointer, using a binary search technique.
       
  5560 
       
  5561 The function assumes that object pointers in the array are in address order.
       
  5562 
       
  5563 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5564 
       
  5565 @param anEntry The object pointer to be found.
       
  5566 
       
  5567 @return The index of the matching object pointer within the array
       
  5568 @leave KErrNotFound, if no suitable object pointer can be found.
       
  5569 */
       
  5570 template <class T>
       
  5571 inline TInt RPointerArray<T>::FindInAddressOrderL(const T* anEntry) const
       
  5572 	{ return User::LeaveIfError(FindInAddressOrder(anEntry));}
       
  5573 
       
  5574 
       
  5575 /**
       
  5576 Finds the object pointer in the array whose object matches the specified
       
  5577 object, using a binary search technique and an ordering algorithm.
       
  5578 
       
  5579 The function assumes that existing object pointers in the array are ordered 
       
  5580 so that the objects themselves are in object order as determined by an algorithm 
       
  5581 supplied by the caller and packaged as a TLinearOrder<T>.
       
  5582 
       
  5583 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5584 
       
  5585 @param anEntry The object pointer to be found.
       
  5586 @param anOrder A package encapsulating the function which determines the order 
       
  5587                of two class T objects.
       
  5588 
       
  5589 @return The index of the matching object pointer within the array.
       
  5590 
       
  5591 @leave KErrNotFound, if no suitable object pointer can be found.
       
  5592 */
       
  5593 template <class T>
       
  5594 inline TInt RPointerArray<T>::FindInOrderL(const T* anEntry, TLinearOrder<T> anOrder) const
       
  5595 	{ return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
       
  5596 
       
  5597 
       
  5598 /**
       
  5599 Finds the object pointer in the array that matches the specified object
       
  5600 pointer, using a binary search technique.
       
  5601 
       
  5602 The function assumes that object pointers in the array are in address order.
       
  5603 
       
  5604 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5605 
       
  5606 @param anEntry The object pointer to be found.
       
  5607 @param anIndex A reference to a TInt into which the
       
  5608                function puts an index value: If the function does not leave,
       
  5609                this is the index of the matching object pointer within the
       
  5610                array. If the function leaves with KErrNotFound, this is the
       
  5611                index of the first object pointer within the array which
       
  5612                logically follows after anEntry.
       
  5613 
       
  5614 @leave KErrNotFound, if no suitable object pointer can be found.
       
  5615 */
       
  5616 template <class T>
       
  5617 inline void RPointerArray<T>::FindInAddressOrderL(const T* anEntry, TInt& anIndex) const
       
  5618 	{ User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
       
  5619 
       
  5620 
       
  5621 /**
       
  5622 Finds the object pointer in the array whose object matches the specified
       
  5623 object, using a binary search technique and an ordering algorithm.
       
  5624 
       
  5625 The function assumes that existing object pointers in the array are ordered 
       
  5626 so that the objects themselves are in object order as determined by an
       
  5627 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
       
  5628 
       
  5629 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5630 
       
  5631 @param anEntry The object pointer to be found.
       
  5632 @param anIndex A TInt supplied by the caller. On return, contains an
       
  5633                index value:
       
  5634                If the function does not leave, this is the index of the
       
  5635                matching object pointer within the array. 
       
  5636                If the function leaves with KErrNotFound, this is the index of
       
  5637                the first object pointer in the array whose object is bigger
       
  5638                than the entry being searched for - if no objects pointed to in
       
  5639                the array are bigger, then the index value is the same as the
       
  5640                total number of object pointers in the array.
       
  5641 
       
  5642 @param anOrder A package encapsulating the function which determines the order 
       
  5643                of two class T objects.
       
  5644 
       
  5645 @leave         KErrNotFound, if no suitable object pointer can be found.
       
  5646 */
       
  5647 template <class T>
       
  5648 inline void RPointerArray<T>::FindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
       
  5649 	{ User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder)); }
       
  5650 
       
  5651 
       
  5652 /**
       
  5653 Finds the object pointer in the array that matches the specified object
       
  5654 pointer, using a binary search technique.
       
  5655 
       
  5656 Where there is more than one matching element, it finds the first, the last
       
  5657 or any matching element as specified by the value of aMode.
       
  5658 
       
  5659 The function assumes that object pointers in the array are in address order.
       
  5660 
       
  5661 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5662 
       
  5663 @param	anEntry The object pointer to be found.
       
  5664 @param	aMode   Specifies whether to find the first match, the last match or
       
  5665                 any match, as defined by one of the TArrayFindMode enum values.
       
  5666 
       
  5667 @return If there is a matching element, the array index of a matching element -  what
       
  5668         the index refers to depends on the value of aMode:
       
  5669         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5670         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5671         if this is EArrayFindMode_Last, then the index refers to first element that follows the
       
  5672         last matching element - if the last matching element is also the last element of the array,
       
  5673         then the index value is the same as the total number of elements in the array.
       
  5674         
       
  5675 @leave  KErrNotFound if no matching entry exists.
       
  5676 
       
  5677 @see TArrayFindMode
       
  5678 */
       
  5679 template <class T>
       
  5680 inline TInt RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt aMode) const
       
  5681 	{ return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
       
  5682 
       
  5683 
       
  5684 /**
       
  5685 Finds the object pointer in the array whose object matches the specified
       
  5686 object, using a binary search technique and an ordering algorithm.
       
  5687 
       
  5688 In the case that there is more than one matching element finds the first, last
       
  5689 or any match as specified by the value of aMode.
       
  5690 
       
  5691 The function assumes that existing object pointers in the array are ordered 
       
  5692 so that the objects themselves are in object order as determined by an algorithm 
       
  5693 supplied by the caller and packaged as a TLinearOrder<T> type.
       
  5694 
       
  5695 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5696 
       
  5697 @param anEntry The object pointer to be found.
       
  5698 @param anOrder A package encapsulating the function which determines the order 
       
  5699                of two class T objects.
       
  5700 @param	aMode  Specifies whether to find the first match, the last match or any match,
       
  5701                as defined by one of the TArrayFindMode enum values.
       
  5702 
       
  5703 @return If there is a matching element, the array index of a matching
       
  5704         element -  what the index refers to depends on the value of aMode:
       
  5705         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5706         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5707         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5708         the last matching element - if the last matching element is also the last element of the array, then
       
  5709         the index value is the same as the total number of elements in the array.
       
  5710 
       
  5711 @leave  KErrNotFound if no matching entry exists.
       
  5712 
       
  5713 @see TArrayFindMode
       
  5714 */
       
  5715 template <class T>
       
  5716 inline TInt RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const
       
  5717 	{ return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
       
  5718 
       
  5719 
       
  5720 /**
       
  5721 Finds the object pointer in the array that matches the specified object
       
  5722 pointer, using a binary search technique.
       
  5723 
       
  5724 Where there is more than one matching element, it finds the first, the last or
       
  5725 any matching element as specified by the value of aMode.
       
  5726 
       
  5727 The function assumes that object pointers in the array are in address order.
       
  5728 
       
  5729 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5730 
       
  5731 @param anEntry The object pointer to be found.
       
  5732 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  5733                value depending on whether a match is found and on the value of aMode.
       
  5734                If there is no matching element in the array, then this is the  index
       
  5735                of the first element in the array that is bigger than the element being
       
  5736                searched for - if no elements in the array are bigger, then the index
       
  5737                value is the same as the total number of elements in the array.
       
  5738                If there is a matching element, then what the index refers to depends
       
  5739                on the value of aMode:
       
  5740                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5741                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5742                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5743                the last matching element - if the last matching element is also the last element
       
  5744                of the array, then the index value is the same as the total number of elements in the array.
       
  5745                
       
  5746 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by
       
  5747                one of the TArrayFindMode enum values.
       
  5748 
       
  5749 @leave  KErrNotFound, if no suitable object pointer can be found.
       
  5750 
       
  5751 @see TArrayFindMode
       
  5752 */
       
  5753 template <class T>
       
  5754 inline void RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt& anIndex, TInt aMode) const
       
  5755 	{ User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
       
  5756 
       
  5757 
       
  5758 /**
       
  5759 Finds the object pointer in the array whose object matches the specified
       
  5760 object, using a binary search technique and an ordering algorithm.
       
  5761 
       
  5762 Where there is more than one matching element, it finds the first, the last or any
       
  5763 matching element as specified by the value of aMode.
       
  5764 
       
  5765 The function assumes that existing object pointers in the array are ordered 
       
  5766 so that the objects themselves are in object order as determined by an
       
  5767 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
       
  5768 
       
  5769 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5770 
       
  5771 @param anEntry The object pointer to be found.
       
  5772 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  5773                value depending on whether a match is found and on the value of aMode.
       
  5774                If there is no matching element in the array, then this is
       
  5775                the index of the first element in the array that is bigger than
       
  5776                the element being searched for - if no elements in the array are bigger,
       
  5777                then the index value is the same as the total number of elements in the array.
       
  5778                If there is a matching element, then what the index refers to depends
       
  5779                on the value of aMode:
       
  5780                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  5781                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  5782                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  5783                the last matching element - if the last matching element is also the last element of
       
  5784                the array, then the index value is the same as the total number of elements in the array.
       
  5785 
       
  5786 @param anOrder A package encapsulating the function which determines the order 
       
  5787                of two class T objects.
       
  5788 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by
       
  5789                one of the TArrayFindModeenum values.
       
  5790 
       
  5791 @leave  KErrNotFound, if no suitable object pointer can be found.
       
  5792 
       
  5793 @see TArrayFindMode
       
  5794 */
       
  5795 template <class T>
       
  5796 inline void RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
       
  5797 	{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode)); }
       
  5798 
       
  5799 
       
  5800 /**
       
  5801 Inserts an object pointer into the array in address order.
       
  5802 
       
  5803 No duplicate entries are permitted.
       
  5804 The function assumes that existing object pointers within the array are in 
       
  5805 address order.
       
  5806 
       
  5807 The function leaves with one of the system wide error codes, if the operation fails.
       
  5808 
       
  5809 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5810 
       
  5811 @param anEntry The object pointer to be inserted.
       
  5812 */
       
  5813 template <class T>
       
  5814 inline void RPointerArray<T>::InsertInAddressOrderL(const T* anEntry)
       
  5815 	{ User::LeaveIfError(InsertInAddressOrder(anEntry)); }
       
  5816 
       
  5817 
       
  5818 /**
       
  5819 Inserts an object pointer into the array so that the object itself is in object 
       
  5820 order.
       
  5821 
       
  5822 The algorithm for determining the order of two class T objects is provided 
       
  5823 by a function supplied by the caller.
       
  5824 
       
  5825 No duplicate entries are permitted.
       
  5826 
       
  5827 The function assumes that the array is ordered so that the referenced objects 
       
  5828 are in object order.
       
  5829 
       
  5830 The function leaves with one of the system wide error codes, if the operation fails.
       
  5831 
       
  5832 Note that the array remains unchanged following an attempt to insert a duplicate
       
  5833 entry.
       
  5834 
       
  5835 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5836 
       
  5837 @param anEntry The object pointer to be inserted.
       
  5838 @param anOrder A package encapsulating the function which determines the order 
       
  5839                of two class T objects.
       
  5840 */
       
  5841 template <class T>
       
  5842 inline void RPointerArray<T>::InsertInOrderL(const T* anEntry, TLinearOrder<T> anOrder)
       
  5843 	{ User::LeaveIfError(InsertInOrder(anEntry, anOrder)); }
       
  5844 
       
  5845 
       
  5846 /**
       
  5847 Inserts an object pointer into the array in address order, allowing duplicates.
       
  5848 
       
  5849 If the new object pointer is a duplicate of an existing object pointer in 
       
  5850 the array, then the new pointer is inserted after the existing one. If more 
       
  5851 than one duplicate object pointer already exists in the array, then any new 
       
  5852 duplicate pointer is inserted after the last one.
       
  5853 
       
  5854 The function assumes that existing object pointers within the array are in 
       
  5855 address order.
       
  5856 
       
  5857 The function leaves with one of the system wide error codes, if the operation fails.
       
  5858 
       
  5859 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5860 
       
  5861 @param anEntry The object pointer to be inserted.
       
  5862 */
       
  5863 template <class T>
       
  5864 inline void RPointerArray<T>::InsertInAddressOrderAllowRepeatsL(const T* anEntry)
       
  5865 	{ User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
       
  5866 
       
  5867 
       
  5868 /**
       
  5869 Inserts an object pointer into the array so that the object itself is in object 
       
  5870 order, allowing duplicates
       
  5871 
       
  5872 The algorithm for determining the order of two class T objects is provided 
       
  5873 by a function supplied by the caller.
       
  5874 
       
  5875 If the specified object is a duplicate of an existing object, then the new 
       
  5876 pointer is inserted after the pointer to the existing object. If more than 
       
  5877 one duplicate object already exists, then the new pointer is inserted after 
       
  5878 the pointer to the last one.
       
  5879 
       
  5880 The function leaves with one of the system wide error codes, if the operation fails.
       
  5881 
       
  5882 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5883 
       
  5884 @param anEntry The object pointer to be inserted. 
       
  5885 @param anOrder A package encapsulating the function which determines the order 
       
  5886                of two class T objects.
       
  5887 */
       
  5888 template <class T>
       
  5889 inline void RPointerArray<T>::InsertInOrderAllowRepeatsL(const T* anEntry, TLinearOrder<T> anOrder)
       
  5890 	{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder)); }
       
  5891 
       
  5892 
       
  5893 
       
  5894 /**
       
  5895 Reserves space for the specified number of elements.
       
  5896 
       
  5897 After a call to this function, the memory allocated to the array is sufficient 
       
  5898 to hold the number of object pointers specified. Adding new object pointers to the array 
       
  5899 does not result in a re-allocation of memory until the the total number of 
       
  5900 pointers exceeds the specified count.
       
  5901 
       
  5902 @param	aCount	The number of object pointers for which space should be reserved
       
  5903 @leave KErrNoMemory	If the requested amount of memory could not be allocated
       
  5904 */
       
  5905 template <class T>
       
  5906 inline void RPointerArray<T>::ReserveL(TInt aCount)
       
  5907 	{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
       
  5908 
       
  5909 
       
  5910 
       
  5911 // Specialization for RPointerArray<TAny>
       
  5912 
       
  5913 /**
       
  5914 Appends an pointer onto the array.
       
  5915 
       
  5916 The function leaves with one of the system wide error codes, if the operation fails.
       
  5917 
       
  5918 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5919 
       
  5920 @param anEntry The pointer to be appended.
       
  5921 */
       
  5922 inline void RPointerArray<TAny>::AppendL(const TAny* anEntry)
       
  5923 	{ User::LeaveIfError(Append(anEntry));}
       
  5924 
       
  5925 
       
  5926 /**
       
  5927 Inserts an pointer into the array at the specified position.
       
  5928 
       
  5929 The function leaves with one of the system wide error codes, if
       
  5930 the operation fails.
       
  5931 
       
  5932 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5933 
       
  5934 @param anEntry The pointer to be inserted.
       
  5935 @param aPos    The position within the array where the pointer is to be 
       
  5936                inserted. The position is relative to zero, i.e. zero implies
       
  5937 			   that a pointer is inserted at the beginning of the array.
       
  5938 
       
  5939 @panic USER 131, if aPos is negative, or is greater than the number of object
       
  5940        pointers currently in the array.
       
  5941 */
       
  5942 inline void RPointerArray<TAny>::InsertL(const TAny* anEntry, TInt aPos)
       
  5943 	{ User::LeaveIfError(Insert(anEntry,aPos)); }
       
  5944 
       
  5945 
       
  5946 /**
       
  5947 Finds the first pointer in the array which matches the specified pointer, using
       
  5948 a sequential search.
       
  5949 
       
  5950 Matching is based on the comparison of pointers.
       
  5951 
       
  5952 The find operation always starts at the low index end of the array. There 
       
  5953 is no assumption about the order of objects in the array.
       
  5954 
       
  5955 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5956 
       
  5957 @param anEntry The pointer to be found.
       
  5958 @return The index of the first matching pointer within the array.
       
  5959 @leave KErrNotFound, if no matching pointer can be found.
       
  5960 */
       
  5961 inline TInt RPointerArray<TAny>::FindL(const TAny* anEntry) const
       
  5962 	{ return User::LeaveIfError(Find(anEntry));}
       
  5963 
       
  5964 
       
  5965 /**
       
  5966 Finds the last pointer in the array which matches the specified pointer, using
       
  5967 a sequential search.
       
  5968 
       
  5969 Matching is based on the comparison of pointers.
       
  5970 
       
  5971 The find operation always starts at the high index end of the array. There 
       
  5972 is no assumption about the order of objects in the array.
       
  5973 
       
  5974 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5975 
       
  5976 @param anEntry The pointer to be found.
       
  5977 @return The index of the last matching pointer within the array.
       
  5978 @leave KErrNotFound, if no matching pointer can be found.
       
  5979 */
       
  5980 inline TInt RPointerArray<TAny>::FindReverseL(const TAny* anEntry) const
       
  5981 	{ return User::LeaveIfError(FindReverse(anEntry));}
       
  5982 
       
  5983 
       
  5984 /**
       
  5985 Finds the pointer in the array that matches the specified pointer, using a
       
  5986 binary search technique.
       
  5987 
       
  5988 The function assumes that pointers in the array are in address order.
       
  5989 
       
  5990 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  5991 
       
  5992 @param anEntry The pointer to be found.
       
  5993 
       
  5994 @return The index of the matching pointer within the array
       
  5995 @leave KErrNotFound, if no suitable pointer can be found.
       
  5996 */
       
  5997 inline TInt RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry) const
       
  5998 	{ return User::LeaveIfError(FindInAddressOrder(anEntry));}
       
  5999 
       
  6000 
       
  6001 /**
       
  6002 Finds the pointer in the array that matches the specified pointer, using a
       
  6003 binary search technique.
       
  6004 
       
  6005 The function assumes that pointers in the array are in address order.
       
  6006 
       
  6007 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6008 
       
  6009 @param anEntry The pointer to be found.
       
  6010 @param anIndex A reference to a TInt into which the
       
  6011                function puts an index value: If the function does not leave,
       
  6012 			   this is the index of the matching pointer within the array. If the
       
  6013 			   function leaves with KErrNotFound, this is the index of the last
       
  6014 			   pointer within the array which logically precedes
       
  6015 			   anEntry.
       
  6016 
       
  6017 @leave KErrNotFound, if no suitable pointer can be found.
       
  6018 */
       
  6019 inline void RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry, TInt& anIndex) const
       
  6020 	{ User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
       
  6021 
       
  6022 
       
  6023 /**
       
  6024 Finds the pointer in the array that matches the specified pointer, using a
       
  6025 binary search technique.
       
  6026 
       
  6027 Where there is more than one matching element, it finds the first, the last
       
  6028 or any matching element as specified by the value of aMode.
       
  6029 
       
  6030 The function assumes that pointers in the array are in address order.
       
  6031 
       
  6032 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6033 
       
  6034 @param	anEntry The pointer to be found.
       
  6035 @param	aMode   Specifies whether to find the first match, the last match or
       
  6036                 any match, as defined by one of the TArrayFindMode enum values.
       
  6037 
       
  6038 @return If there is a matching element, the array index of a matching element -  what
       
  6039         the index refers to depends on the value of aMode:
       
  6040         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6041         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6042         if this is EArrayFindMode_Last, then the index refers to first element that follows the
       
  6043         last matching element - if the last matching element is also the last element of the array,
       
  6044         then the index value is the same as the total number of elements in the array.
       
  6045         
       
  6046 @leave  KErrNotFound if no matching entry exists.
       
  6047 
       
  6048 @see TArrayFindMode
       
  6049 */
       
  6050 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt aMode) const
       
  6051 	{ return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
       
  6052 
       
  6053 
       
  6054 /**
       
  6055 Finds the pointer in the array that matches the specified pointer, using a
       
  6056 binary search technique.
       
  6057 
       
  6058 Where there is more than one matching element, it finds the first, the last or
       
  6059 any matching element as specified by the value of aMode.
       
  6060 
       
  6061 The function assumes that pointers in the array are in address order.
       
  6062 
       
  6063 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6064 
       
  6065 @param anEntry The pointer to be found.
       
  6066 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  6067                value depending on whether a match is found and on the value of aMode.
       
  6068                If there is no matching element in the array, then this is the  index
       
  6069                of the first element in the array that is bigger than the element being
       
  6070                searched for - if no elements in the array are bigger, then the index
       
  6071                value is the same as the total number of elements in the array.
       
  6072                If there is a matching element, then what the index refers to depends
       
  6073                on the value of aMode:
       
  6074                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6075                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6076                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6077                the last matching element - if the last matching element is also the last element
       
  6078                of the array, then the index value is the same as the total number of elements in the array.
       
  6079                
       
  6080 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by
       
  6081                one of the TArrayFindMode enum values.
       
  6082 
       
  6083 @leave  KErrNotFound, if no suitable pointer can be found.
       
  6084 
       
  6085 @see TArrayFindMode
       
  6086 */
       
  6087 inline void RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt& anIndex, TInt aMode) const
       
  6088 	{ User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
       
  6089 
       
  6090 
       
  6091 /**
       
  6092 Inserts an pointer into the array in address order.
       
  6093 
       
  6094 No duplicate entries are permitted.  The function assumes that existing pointers
       
  6095 within the array are in address order.
       
  6096 
       
  6097 The function leaves with one of the system wide error codes, if the operation fails.
       
  6098 
       
  6099 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6100 
       
  6101 @param anEntry The pointer to be inserted.
       
  6102 */
       
  6103 inline void RPointerArray<TAny>::InsertInAddressOrderL(const TAny* anEntry)
       
  6104 	{ User::LeaveIfError(InsertInAddressOrder(anEntry)); }
       
  6105 
       
  6106 
       
  6107 /**
       
  6108 Inserts an pointer into the array in address order, allowing duplicates.
       
  6109 
       
  6110 If the new pointer is a duplicate of an existing pointer in the array, then the
       
  6111 new pointer is inserted after the existing one. If more than one duplicate
       
  6112 pointer already exists in the array, then any new duplicate pointer is inserted
       
  6113 after the last one.
       
  6114 
       
  6115 The function assumes that existing pointers within the array are in address
       
  6116 order.
       
  6117 
       
  6118 The function leaves with one of the system wide error codes, if the operation fails.
       
  6119 
       
  6120 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6121 
       
  6122 @param anEntry The pointer to be inserted.
       
  6123 */
       
  6124 inline void RPointerArray<TAny>::InsertInAddressOrderAllowRepeatsL(const TAny* anEntry)
       
  6125 	{ User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
       
  6126 
       
  6127 
       
  6128 /**
       
  6129 Apends an object onto the array.
       
  6130 
       
  6131 The function leaves with one of the system wide error codes, if the operation fails.
       
  6132 
       
  6133 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6134 
       
  6135 @param anEntry    A reference to the object of type class T to be appended.
       
  6136 */
       
  6137 template <class T>
       
  6138 inline void RArray<T>::AppendL(const T& anEntry)
       
  6139 	{ User::LeaveIfError(Append(anEntry));}
       
  6140 
       
  6141 
       
  6142 /**
       
  6143 Inserts an object into the array at a specified position.
       
  6144 
       
  6145 The function leaves with one of the system wide error codes, if the operation fails.
       
  6146 
       
  6147 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6148 
       
  6149 @param anEntry The class T object to be inserted.
       
  6150 @param aPos    The position within the array where the object is to
       
  6151                be inserted. The position is relative to zero, i.e. zero
       
  6152 			   implies that an object is inserted at the beginning of
       
  6153 			   the array.
       
  6154 			   
       
  6155 @panic USER 131, if aPos is negative or is greater than the number of objects
       
  6156        currently in the array.
       
  6157 */
       
  6158 template <class T>
       
  6159 inline void RArray<T>::InsertL(const T& anEntry, TInt aPos)
       
  6160 	{ User::LeaveIfError(Insert(anEntry, aPos));}
       
  6161 
       
  6162 
       
  6163 /**
       
  6164 Finds the first object in the array which matches the specified object using 
       
  6165 a sequential search.
       
  6166 
       
  6167 Matching is based on the comparison of a TInt value at the key offset position 
       
  6168 within the objects.
       
  6169 
       
  6170 For classes which define their own equality operator (==), the alternative method
       
  6171 FindL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
       
  6172 
       
  6173 The find operation always starts at the low index end of the array. There 
       
  6174 is no assumption about the order of objects in the array.
       
  6175 
       
  6176 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6177 
       
  6178 @param anEntry A reference to an object of type class T to be used for matching.
       
  6179 
       
  6180 @return The index of the first matching object within the array. 
       
  6181 @leave  KErrNotFound, if no matching object can be found.
       
  6182 */
       
  6183 template <class T>
       
  6184 inline TInt RArray<T>::FindL(const T& anEntry) const
       
  6185 	{ return User::LeaveIfError(Find(anEntry));}
       
  6186 
       
  6187 
       
  6188 /**
       
  6189 Finds the first object in the array which matches the specified object using 
       
  6190 a sequential search and a matching algorithm.
       
  6191 
       
  6192 The algorithm for determining whether two class T type objects match is provided 
       
  6193 by a function supplied by the caller.
       
  6194 
       
  6195 Such a function need not be supplied if an equality operator (==) is defined for class T. 
       
  6196 In this case, default construction of anIdentity provides matching.
       
  6197 
       
  6198 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
       
  6199 
       
  6200 The find operation always starts at the low index end of the array. There 
       
  6201 is no assumption about the order of objects in the array.
       
  6202 
       
  6203 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6204 
       
  6205 @param anEntry    A reference to an object of type class T to be used
       
  6206                   for matching.
       
  6207 @param anIdentity A package encapsulating the function which determines whether 
       
  6208                   two class T type objects match.
       
  6209 
       
  6210 @return The index of the first matching object within the array.
       
  6211 @leave  KErrNotFound, if no matching object can be found.
       
  6212 */
       
  6213 template <class T>
       
  6214 inline TInt RArray<T>::FindL(const T& anEntry, TIdentityRelation<T> anIdentity) const
       
  6215 	{ return User::LeaveIfError(Find(anEntry, anIdentity));}
       
  6216 
       
  6217 
       
  6218 /**
       
  6219 Finds the last object in the array which matches the specified object using 
       
  6220 a sequential search.
       
  6221 
       
  6222 Matching is based on the comparison of a TInt value at the key offset position 
       
  6223 within the objects.
       
  6224 
       
  6225 For classes which define their own equality operator (==), the alternative method
       
  6226 FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
       
  6227 
       
  6228 The find operation always starts at the high index end of the array. There 
       
  6229 is no assumption about the order of objects in the array.
       
  6230 
       
  6231 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6232 
       
  6233 @param anEntry A reference to an object of type class T to be used for matching.
       
  6234 
       
  6235 @return The index of the last matching object within the array. 
       
  6236 @leave  KErrNotFound, if no matching object can be found.
       
  6237 */
       
  6238 template <class T>
       
  6239 inline TInt RArray<T>::FindReverseL(const T& anEntry) const
       
  6240 	{ return User::LeaveIfError(FindReverse(anEntry));}
       
  6241 
       
  6242 
       
  6243 /**
       
  6244 Finds the last object in the array which matches the specified object using 
       
  6245 a sequential search and a matching algorithm.
       
  6246 
       
  6247 The algorithm for determining whether two class T type objects match is provided 
       
  6248 by a function supplied by the caller.
       
  6249 
       
  6250 Such a function need not be supplied if an equality operator (==) is defined for class T. 
       
  6251 In this case, default construction of anIdentity provides matching.
       
  6252 
       
  6253 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
       
  6254 
       
  6255 The find operation always starts at the high index end of the array. There 
       
  6256 is no assumption about the order of objects in the array.
       
  6257 
       
  6258 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6259 
       
  6260 @param anEntry    A reference to an object of type class T to be used
       
  6261                   for matching.
       
  6262 @param anIdentity A package encapsulating the function which determines whether 
       
  6263                   two class T type objects match.
       
  6264 
       
  6265 @return The index of the last matching object within the array.
       
  6266 @leave  KErrNotFound, if no matching object can be found.
       
  6267 */
       
  6268 template <class T>
       
  6269 inline TInt RArray<T>::FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) const
       
  6270 	{ return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
       
  6271 
       
  6272 
       
  6273 /**
       
  6274 Finds the object in the array which matches the specified object using a binary 
       
  6275 search technique.
       
  6276 
       
  6277 The function assumes that existing objects within the array are in signed 
       
  6278 key order.
       
  6279 
       
  6280 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6281 
       
  6282 @param anEntry A reference to an object of type class T to be used for matching.
       
  6283 
       
  6284 @return The index of the matching object within the array.
       
  6285 @leave  KErrNotFound, if no matching object can be found.
       
  6286 */
       
  6287 template <class T>
       
  6288 inline TInt RArray<T>::FindInSignedKeyOrderL(const T& anEntry) const
       
  6289 	{ return User::LeaveIfError(FindInSignedKeyOrder(anEntry));}
       
  6290 
       
  6291 
       
  6292 /**
       
  6293 Finds the object in the array which matches the specified object using a binary 
       
  6294 search technique.
       
  6295 
       
  6296 The function assumes that existing objects within the array are in unsigned 
       
  6297 key order.
       
  6298 
       
  6299 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6300 
       
  6301 @param anEntry A reference to an object of type class T to be used for matching.
       
  6302 
       
  6303 @return The index of the matching object within the array.
       
  6304 @leave  KErrNotFound, if no matching object can be found.
       
  6305 */
       
  6306 template <class T>
       
  6307 inline TInt RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry) const
       
  6308 	{ return User::LeaveIfError(FindInUnsignedKeyOrder(anEntry));}
       
  6309 
       
  6310 
       
  6311 /**
       
  6312 Finds the object in the array which matches the specified object using a binary 
       
  6313 search technique and an ordering algorithm.
       
  6314 
       
  6315 The function assumes that existing objects within the array are in object 
       
  6316 order as determined by an algorithm supplied by the caller and packaged as 
       
  6317 a TLinearOrder<T>.
       
  6318 
       
  6319 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6320 
       
  6321 @param anEntry A reference to an object of type class T to be used for matching.
       
  6322 @param anOrder A package encapsulating the function which determines the order 
       
  6323                of two class T objects.
       
  6324 
       
  6325 @return The index of the matching object within the array.
       
  6326 @leave  KErrNotFound if no matching object can be found.
       
  6327 */
       
  6328 template <class T>
       
  6329 inline TInt RArray<T>::FindInOrderL(const T& anEntry, TLinearOrder<T> anOrder) const
       
  6330 { return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
       
  6331 
       
  6332 
       
  6333 /**
       
  6334 Finds the object in the array which matches the specified object using a binary 
       
  6335 search technique.
       
  6336 
       
  6337 The function assumes that existing objects within the array are in signed 
       
  6338 key order.
       
  6339 
       
  6340 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6341 
       
  6342 @param anEntry A reference to an object of type class T to be used for matching.
       
  6343 @param anIndex On return contains an index value of the matching object within the array.
       
  6344                If the function leaves with KErrNotFound,this is the index of the
       
  6345                first element in the array whose key is bigger than the key of the
       
  6346                element being sought. If there are no elements in the array with
       
  6347                a bigger key, then the index value is the same as the total 
       
  6348                number of elements in the array.
       
  6349 @leave KErrNotFound, if no matching object can be found.
       
  6350 */
       
  6351 template <class T>
       
  6352 inline void RArray<T>::FindInSignedKeyOrderL(const T& anEntry, TInt& anIndex) const
       
  6353 	{ User::LeaveIfError(FindInSignedKeyOrder(anEntry, anIndex));}
       
  6354 
       
  6355 
       
  6356 /**
       
  6357 Finds the object in the array which matches the specified object using a binary 
       
  6358 search technique.
       
  6359 
       
  6360 The function assumes that existing objects within the array are in unsigned 
       
  6361 key order.
       
  6362 
       
  6363 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6364 
       
  6365 @param anEntry A reference to an object of type class T to be used for matching.
       
  6366 @param anIndex On return contains an index value of the matching object within the array. 
       
  6367                If the function leaves with KErrNotFound,  this is the index of the
       
  6368                first element in the array whose key is bigger than the key of the
       
  6369                element being sought. If there are no elements in the array with
       
  6370                a bigger key, then the index value is the same as the total 
       
  6371                number of elements in the array.
       
  6372 @leave  KErrNotFound, if no matching object can be found.
       
  6373 */
       
  6374 template <class T>
       
  6375 inline void RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex) const
       
  6376 	{ User::LeaveIfError(FindInUnsignedKeyOrder(anEntry, anIndex));}
       
  6377 
       
  6378 
       
  6379 /**
       
  6380 Finds the object in the array which matches the specified object using a binary 
       
  6381 search technique and an ordering algorithm.
       
  6382 
       
  6383 The function assumes that existing objects within the array are in object 
       
  6384 order as determined by an algorithm supplied by the caller and packaged as 
       
  6385 a TLinearOrder<T>.
       
  6386 
       
  6387 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6388 
       
  6389 @param anEntry A reference to an object of type class T to be used for matching.
       
  6390 @param anIndex On return contains the index value of the matching object within the array
       
  6391                If the function leaves with KErrNotFound, this is the index of
       
  6392                the first element in the array that is bigger than the element
       
  6393                being searched for - if no elements in the array are bigger,
       
  6394                then the index value is the same as the total number of elements
       
  6395                in the array.
       
  6396 @param anOrder A package encapsulating the function which determines the order 
       
  6397                of two class T objects.
       
  6398 
       
  6399 @leave  KErrNotFound if no matching object can be found.
       
  6400 */
       
  6401 template <class T>
       
  6402 inline void RArray<T>::FindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
       
  6403 	{ User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder));}
       
  6404 
       
  6405 
       
  6406 /**
       
  6407 Finds the object in the array which matches the specified object using a binary 
       
  6408 search technique.
       
  6409 
       
  6410 The element ordering is determined by a signed 32-bit word
       
  6411 (the key) embedded in each array element. In the case that there is more than
       
  6412 one matching element, finds the first, last or any match as specified.
       
  6413 
       
  6414 The function assumes that existing objects within the array are in signed 
       
  6415 key order.
       
  6416 
       
  6417 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6418 
       
  6419 @param anEntry A reference to an object of type class T to be used for matching.
       
  6420 @param	aMode  Specifies whether to find the first match, the last match or
       
  6421                any match, as defined by one of the TArrayFindMode enum values.
       
  6422 
       
  6423 @return The array index of a matching element - what the index refers to
       
  6424         depends on the value of aMode:
       
  6425         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6426         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6427         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6428         the last matching element - if the last matching element is also the last element of
       
  6429         the array, then the index value is the same as the total number of elements in the array.
       
  6430 @leave  KErrNotFound if no matching entry exists.
       
  6431 
       
  6432 @see TArrayFindMode
       
  6433 */
       
  6434 template <class T>
       
  6435 inline TInt RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt aMode) const
       
  6436 { return User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, aMode));}
       
  6437 
       
  6438 
       
  6439 /**
       
  6440 Finds the object in the array which matches the specified object using a binary 
       
  6441 search technique.
       
  6442 
       
  6443 The element ordering is determined by an unsigned 32-bit word
       
  6444 (the key) embedded in each array element. In the case that there is more than
       
  6445 one matching element, finds the first, last or any match as specified.
       
  6446 
       
  6447 The function assumes that existing objects within the array are in unsigned 
       
  6448 key order.
       
  6449 
       
  6450 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6451 
       
  6452 @param anEntry A reference to an object of type class T to be used for matching.
       
  6453 @param	aMode  Specifies whether to find the first match, the last match or any
       
  6454         match, as defined by one of the TArrayFindMode enum values.
       
  6455 
       
  6456 @return The array index of a matching element -  what the index refers to
       
  6457         depends on the value of aMode:
       
  6458         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6459         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6460         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6461         the last matching element - if the last matching element is also the last element
       
  6462         of the array, then the index value is the same as the total number of elements in the array.
       
  6463         
       
  6464 @leave  KErrNotFound if no matching entry exists.
       
  6465 
       
  6466 @see TArrayFindMode
       
  6467 */
       
  6468 template <class T>
       
  6469 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt aMode) const
       
  6470 	{ return User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, aMode));}
       
  6471 
       
  6472 
       
  6473 /**
       
  6474 Finds the object in the array which matches the specified object using a binary 
       
  6475 search technique and an ordering algorithm.
       
  6476 
       
  6477 Where there is more than one matching element, it finds the first, the last or
       
  6478 any matching element as specified by the value of aMode.
       
  6479 
       
  6480 The function assumes that existing objects within the array are in object 
       
  6481 order as determined by an algorithm supplied by the caller and packaged as 
       
  6482 a TLinearOrder<T> type.
       
  6483 
       
  6484 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6485 
       
  6486 @param anEntry A reference to an object of type class T to be used for matching.
       
  6487 @param anOrder A package encapsulating the function which determines the order 
       
  6488                of two class T objects.
       
  6489 @param	aMode  Specifies whether to find the first match, the last match or any match,
       
  6490                as defined by one of the TArrayFindMode enum values.
       
  6491 
       
  6492 @return The array index of a matching element -  what the index refers to
       
  6493         depends on the value of aMode:
       
  6494         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6495         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6496         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6497         the last matching element - if the last matching element is also the last element
       
  6498         of the array, then the index value is the same as the total number of elements in the array.
       
  6499         
       
  6500 @leave KErrNotFound if no matching entry exists.
       
  6501 
       
  6502 @see TArrayFindMode
       
  6503 */
       
  6504 template <class T>
       
  6505 inline TInt RArray<T>::SpecificFindInOrderL(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const
       
  6506 { return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
       
  6507 
       
  6508 
       
  6509 /**
       
  6510 Finds the object in the array which matches the specified object using a binary 
       
  6511 search technique.
       
  6512 
       
  6513 The element ordering is determined by a signed 32-bit word
       
  6514 (the key) embedded in each array element. In the case that there is more than
       
  6515 one matching element, finds the first, last or any match as specified.
       
  6516 
       
  6517 The function assumes that existing objects within the array are in signed 
       
  6518 key order.
       
  6519 
       
  6520 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6521 
       
  6522 @param anEntry A reference to an object of type class T to be used for matching.
       
  6523 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  6524                index value depending on whether a match is found and on the
       
  6525                value of aMode. If there is no matching element in the array,
       
  6526                then this is the index of the first element in the array that
       
  6527                is bigger than the element being searched for - if no elements
       
  6528                in the array are bigger, then the index value is the same as
       
  6529                the total number of elements in the array.
       
  6530                If there is a matching element, then what the index refers to
       
  6531                depends on the value of aMode:
       
  6532                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6533                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6534                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6535                the last matching element - if the last matching element is also the last element
       
  6536                of the array, then the index value is the same as the total number of elements
       
  6537                in the array.
       
  6538 @param aMode   Specifies whether to find the first match, the last match or any match,
       
  6539                as defined by one of the TArrayFindMode enum values.
       
  6540                
       
  6541 @leave KErrNotFound if no matching entry exists.
       
  6542 
       
  6543 @see TArrayFindMode
       
  6544 */
       
  6545 template <class T>
       
  6546 inline void RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
       
  6547 	{ User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, anIndex, aMode));}
       
  6548 
       
  6549 
       
  6550 /**
       
  6551 Finds the object in the array which matches the specified object using a binary 
       
  6552 search technique.
       
  6553 
       
  6554 The element ordering is determined by an unsigned 32-bit word
       
  6555 (the key) embedded in each array element. In the case that there is more than
       
  6556 one matching element, finds the first, last or any match as specified.
       
  6557 
       
  6558 The function assumes that existing objects within the array are in unsigned 
       
  6559 key order.
       
  6560 
       
  6561 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6562 
       
  6563 @param anEntry A reference to an object of type class T to be used for matching.
       
  6564 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  6565                index value depending on whether a match is found and on the
       
  6566                value of aMode. If there is no matching element in the array,
       
  6567                then this is the index of the first element in the array that
       
  6568                is bigger than the element being searched for - if no elements
       
  6569                in the array are bigger, then the index value is the same as
       
  6570                the total number of elements in the array. If there is a matching
       
  6571                element, then what the index refers to depends on the value of aMode:
       
  6572                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6573                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6574                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6575                the last matching element - if the last matching element is also the last element
       
  6576                of the array, then the index value is the same as the total number of elements in the array.
       
  6577 @param aMode   Specifies whether to find the first match, the last match or any match,
       
  6578                as defined by one of the  TArrayFindMode enum values.
       
  6579                
       
  6580 @leave KErrNotFound if no matching entry exists.
       
  6581 
       
  6582 @see TArrayFindMode
       
  6583 */
       
  6584 template <class T>
       
  6585 inline void RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
       
  6586 	{ User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, anIndex, aMode));}
       
  6587 
       
  6588 
       
  6589 /**
       
  6590 Finds the object in the array which matches the specified object using a binary 
       
  6591 search technique and a specified ordering algorithm.
       
  6592 
       
  6593 Where there is more than one matching element, it finds the first, the last or
       
  6594 any matching element as specified by the value of aMode.
       
  6595 
       
  6596 The function assumes that existing objects within the array are in object 
       
  6597 order as determined by an algorithm supplied by the caller and packaged as 
       
  6598 a TLinearOrder<T> type.
       
  6599 
       
  6600 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6601 
       
  6602 @param anEntry A reference to an object of type class T to be used for matching.
       
  6603 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  6604                index value depending on whether a match is found and on the value
       
  6605                of aMode. If there is no matching element in the array, then this is
       
  6606                the  index of the first element in the array that is bigger than the
       
  6607                element being searched for - if no elements in the array are bigger,
       
  6608                then the index value is the same as the total number of elements
       
  6609                in the array. If there is a matching element, then what the index
       
  6610                refers to depends on the value of aMode:
       
  6611                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6612                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6613                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6614                the last matching element - if the last matching element is also the last element
       
  6615                of the array, then the index value is the same as the total number of elements in the array.
       
  6616                
       
  6617 @param anOrder A package encapsulating the function which determines the order 
       
  6618                of two class T objects.
       
  6619 @param aMode   Specifies whether to find the first match, the last match or any match,
       
  6620                as defined by one of the TArrayFindMode enum values.
       
  6621                
       
  6622 @leave KErrNotFound if no matching entry exists.
       
  6623 
       
  6624 @see TArrayFindMode
       
  6625 */
       
  6626 template <class T>
       
  6627 inline void RArray<T>::SpecificFindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
       
  6628 	{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode));}
       
  6629 
       
  6630 
       
  6631 /**
       
  6632 Inserts an object into the array in ascending signed key order.
       
  6633 
       
  6634 The order of two class T type objects is based on comparing a TInt value
       
  6635 located at the key offset position within the class T object.
       
  6636 
       
  6637 No duplicate entries are permitted.
       
  6638 
       
  6639 The function leaves with one of the system wide error codes, if the operation fails.
       
  6640 
       
  6641 Note that the array remains unchanged following an attempt to insert a duplicate entry.
       
  6642 
       
  6643 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6644 
       
  6645 @param anEntry A reference to the object of type class T to be inserted.
       
  6646 */
       
  6647 template <class T>
       
  6648 inline void RArray<T>::InsertInSignedKeyOrderL(const T& anEntry)
       
  6649 	{ User::LeaveIfError(InsertInSignedKeyOrder(anEntry));}
       
  6650 
       
  6651 
       
  6652 /**
       
  6653 Inserts an object into the array in ascending unsigned key order, not allowing 
       
  6654 duplicate entries.
       
  6655 
       
  6656 The order of two class T type objects is based on comparing a TUint value 
       
  6657 located at the key offset position within the class T object. 
       
  6658 
       
  6659 The function leaves with one of the system wide error codes, if the operation fails.
       
  6660 
       
  6661 Note that the array remains unchanged following an attempt to insert a duplicate entry.
       
  6662 
       
  6663 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6664 
       
  6665 @param anEntry A reference to the object of type class T to be inserted.
       
  6666 */
       
  6667 template <class T>
       
  6668 inline void RArray<T>::InsertInUnsignedKeyOrderL(const T& anEntry)
       
  6669 	{ User::LeaveIfError(InsertInUnsignedKeyOrder(anEntry));}
       
  6670 
       
  6671 
       
  6672 /**
       
  6673 Inserts an object of into the array in object order.
       
  6674 
       
  6675 The algorithm for determining the order of two class T type objects is provided 
       
  6676 by a function supplied by the caller.
       
  6677 
       
  6678 No duplicate entries are permitted.
       
  6679 
       
  6680 The function assumes that existing objects within the array are in object 
       
  6681 order.
       
  6682 
       
  6683 The function leaves with one of the system wide error codes, if the operation fails.
       
  6684 
       
  6685 Note that the array remains unchanged following an attempt to insert a duplicate entry.
       
  6686 
       
  6687 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6688 
       
  6689 @param anEntry A reference to the object of type class T to be inserted.
       
  6690 @param anOrder A package encapsulating the function which determines the order 
       
  6691                of two class T objects.
       
  6692 */
       
  6693 template <class T>
       
  6694 inline void RArray<T>::InsertInOrderL(const T& anEntry, TLinearOrder<T> anOrder)
       
  6695 	{ User::LeaveIfError(InsertInOrder(anEntry, anOrder));}
       
  6696 
       
  6697 
       
  6698 /**
       
  6699 Inserts an object into the array in ascending signed key order,
       
  6700 allowing duplicates.
       
  6701 
       
  6702 The order of two class T type objects is based on comparing a TInt value
       
  6703 located at the key offset position within the class T object. 
       
  6704 
       
  6705 If anEntry is a duplicate of an existing object in the array, then the new 
       
  6706 object is inserted after the existing object. If more than one duplicate object 
       
  6707 already exists in the array, then any new duplicate object is inserted after 
       
  6708 the last one.
       
  6709 
       
  6710 The function leaves with one of the system wide error codes, if the operation fails.
       
  6711 
       
  6712 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6713 
       
  6714 @param anEntry A reference to the object of type class T to be inserted.
       
  6715 */
       
  6716 template <class T>
       
  6717 inline void RArray<T>::InsertInSignedKeyOrderAllowRepeatsL(const T& anEntry)
       
  6718 	{ User::LeaveIfError(InsertInSignedKeyOrderAllowRepeats(anEntry));}
       
  6719 
       
  6720 
       
  6721 /**
       
  6722 Inserts an object into the array in ascending unsigned key order, allowing 
       
  6723 duplicates.
       
  6724 
       
  6725 The order of two class T type objects is based on comparing a TUint value 
       
  6726 located at the key offset position within the class T object. 
       
  6727 
       
  6728 If anEntry is a duplicate of an existing object in the array, then the new 
       
  6729 object is inserted after the existing object. If more than one duplicate object 
       
  6730 already exists in the array, then any new duplicate object is inserted after 
       
  6731 the last one.
       
  6732 
       
  6733 The function leaves with one of the system wide error codes, if the operation fails.
       
  6734 
       
  6735 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6736 
       
  6737 @param anEntry A reference to the object of type class T to be inserted.
       
  6738 */
       
  6739 template <class T>
       
  6740 inline void RArray<T>::InsertInUnsignedKeyOrderAllowRepeatsL(const T& anEntry)
       
  6741 	{ User::LeaveIfError(InsertInUnsignedKeyOrderAllowRepeats(anEntry));}
       
  6742 
       
  6743 
       
  6744 /**
       
  6745 Inserts an object into the array in object order, allowing duplicates.
       
  6746 
       
  6747 The algorithm for determining the order of two class T type objects is provided 
       
  6748 by a function supplied by the caller.
       
  6749 
       
  6750 If anEntry is a duplicate of an existing object in the array, then the new 
       
  6751 object is inserted after the existing object. If more than one duplicate object 
       
  6752 already exists in the array, then anEntry is inserted after the last one.
       
  6753 
       
  6754 The function assumes that existing objects within the array are in object 
       
  6755 order.
       
  6756 
       
  6757 The function leaves with one of the system wide error codes, if the operation fails.
       
  6758 
       
  6759 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6760 
       
  6761 @param anEntry A reference to the object of type class T to be inserted.
       
  6762 @param anOrder A package encapsulating the function which determines the order 
       
  6763                of two class T objects.
       
  6764 */
       
  6765 template <class T>
       
  6766 inline void RArray<T>::InsertInOrderAllowRepeatsL(const T& anEntry, TLinearOrder<T> anOrder)
       
  6767 	{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder));}
       
  6768 
       
  6769 
       
  6770 
       
  6771 /**
       
  6772 Reserves space for the specified number of elements.
       
  6773 
       
  6774 After a call to this function, the memory allocated to the array is sufficient 
       
  6775 to hold the number of objects specified. Adding new objects to the array 
       
  6776 does not result in a re-allocation of memory until the the total number of 
       
  6777 objects exceeds the specified count.
       
  6778 
       
  6779 @param	aCount	The number of objects for which space should be reserved
       
  6780 @leave KErrNoMemory	If the requested amount of memory could not be allocated
       
  6781 */
       
  6782 template <class T>
       
  6783 inline void RArray<T>::ReserveL(TInt aCount)
       
  6784 	{ User::LeaveIfError(RArrayBase::DoReserve(aCount)); }
       
  6785 
       
  6786 
       
  6787 
       
  6788 
       
  6789 /**
       
  6790 Appends a signed integer onto the array.
       
  6791 
       
  6792 The function leaves with one of the system wide error codes, if the operation fails.
       
  6793 	
       
  6794 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  6795 	
       
  6796 @param anEntry The signed integer to be appended.
       
  6797 */
       
  6798 inline void RArray<TInt>::AppendL(TInt anEntry)
       
  6799 	{ User::LeaveIfError(Append(anEntry));}
       
  6800 
       
  6801 
       
  6802 /**
       
  6803 Inserts a signed integer into the array at the specified position.
       
  6804 	
       
  6805 The function leaves with one of the system wide error codes, if the operation fails.
       
  6806 	
       
  6807 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  6808 	
       
  6809 @param anEntry The signed integer to be inserted.
       
  6810 @param aPos    The position within the array where the signed integer is to be 
       
  6811 	           inserted. The position is relative to zero, i.e. zero implies
       
  6812 			   that an entry is inserted at the beginning of the array.
       
  6813 		   
       
  6814 @panic USER 131, if aPos is negative, or is greater than the number of entries
       
  6815        currently in the array.
       
  6816 */
       
  6817 inline void RArray<TInt>::InsertL(TInt anEntry, TInt aPos)
       
  6818 	{ User::LeaveIfError(Insert(anEntry, aPos));}
       
  6819 
       
  6820 
       
  6821 /**
       
  6822 Finds the first signed integer in the array which matches the specified signed 
       
  6823 integer using a sequential search.
       
  6824 
       
  6825 The find operation always starts at the low index end of the array. There 
       
  6826 is no assumption about the order of entries in the array.
       
  6827 
       
  6828 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6829 	
       
  6830 @param anEntry The signed integer to be found.
       
  6831 
       
  6832 @return The index of the first matching signed integer within the array.
       
  6833 @leave  KErrNotFound, if no matching entry can be found.
       
  6834 */
       
  6835 inline TInt RArray<TInt>::FindL(TInt anEntry) const
       
  6836 	{ return User::LeaveIfError(Find(anEntry));}
       
  6837 
       
  6838 
       
  6839 /**
       
  6840 Finds the last signed integer in the array which matches the specified signed 
       
  6841 integer using a sequential search.
       
  6842 
       
  6843 The find operation always starts at the high index end of the array. There 
       
  6844 is no assumption about the order of entries in the array.
       
  6845 
       
  6846 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6847 	
       
  6848 @param anEntry The signed integer to be found.
       
  6849 
       
  6850 @return The index of the last matching signed integer within the array.
       
  6851 @leave  KErrNotFound, if no matching entry can be found.
       
  6852 */
       
  6853 inline TInt RArray<TInt>::FindReverseL(TInt anEntry) const
       
  6854 	{ return User::LeaveIfError(FindReverse(anEntry));}
       
  6855 
       
  6856 
       
  6857 /**
       
  6858 Finds the signed integer in the array that matches the specified signed integer 
       
  6859 using a binary search technique.
       
  6860 
       
  6861 The function assumes that the array is in signed integer order.
       
  6862 	
       
  6863 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  6864 	
       
  6865 @param anEntry The signed integer to be found.
       
  6866 
       
  6867 @return The index of the matching signed integer within the array.
       
  6868 @leave  KErrNotFound, if no match can be found.
       
  6869 */
       
  6870 inline TInt RArray<TInt>::FindInOrderL(TInt anEntry) const
       
  6871 	{ return User::LeaveIfError(FindInOrder(anEntry));}
       
  6872 
       
  6873 
       
  6874 /**
       
  6875 Finds the signed integer in the array that matches the specified signed integer
       
  6876 using a binary search technique.
       
  6877 	
       
  6878 The function assumes that the array is in signed integer order.
       
  6879 	
       
  6880 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  6881 	
       
  6882 @param anEntry The signed integer to be found.
       
  6883 @param anIndex A reference to a signed integer into which the
       
  6884                function puts an index value: If the function returns ,
       
  6885                this is the index of the matching signed integer within the
       
  6886                array. If the function leaves with KErrNotFound, this is the
       
  6887                index of the first signed integer within the array that is
       
  6888                bigger than the signed integer being searched for - if no
       
  6889                signed integers within the array are bigger, then the index
       
  6890                value is the same as the total number of signed integers
       
  6891                within the array.
       
  6892 @leave  KErrNotFound if no  match can be found.
       
  6893 */
       
  6894 inline void RArray<TInt>::FindInOrderL(TInt anEntry, TInt& anIndex) const
       
  6895 	{ User::LeaveIfError(FindInOrder(anEntry, anIndex));}
       
  6896 
       
  6897 
       
  6898 /**
       
  6899 Finds the signed integer in the array that matches the specified signed integer 
       
  6900 using a binary search technique.
       
  6901 
       
  6902 Where there is more than one matching element, it finds the first, last or any
       
  6903 matching element  as specified by the value of aMode.
       
  6904 	
       
  6905 The function assumes that the array is in signed integer order.
       
  6906 	
       
  6907 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  6908 	
       
  6909 @param anEntry The signed integer to be found.
       
  6910 @param aMode   Specifies whether to find the first match, the last match or
       
  6911                any match, as defined by one of the TArrayFindMode enum values.
       
  6912 
       
  6913 @return The array index of a matching element - what the index refers to
       
  6914         depends on the value of aMode:
       
  6915         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6916         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6917         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6918         the last matching element - if the last matching element is also the last element
       
  6919         of the array, then the index value is the same as the total number of elements in the array.
       
  6920         
       
  6921 @leave  KErrNotFound if no matching entry exists.
       
  6922 
       
  6923 @see TArrayFindMode
       
  6924 */
       
  6925 inline TInt RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt aMode) const
       
  6926 	{ return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
       
  6927 
       
  6928 
       
  6929 /**
       
  6930 Finds the signed integer in the array that matches the specified signed integer
       
  6931 using a binary search technique.
       
  6932 
       
  6933 Where there is more than one matching element, it finds the first, last or any
       
  6934 matching element  as specified by the value of aMode.
       
  6935 
       
  6936 The function assumes that the array is in signed integer order.
       
  6937 
       
  6938 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6939 	
       
  6940 @param anEntry The signed integer to be found.
       
  6941 @param anIndex A TInt type supplied by the caller. On return, it contains an
       
  6942                index value depending on whether a match is found and on the value of aMode.
       
  6943                If there is no matching element in the array, then this is
       
  6944                the  index of the first element in the array that is bigger
       
  6945                than the element being searched for - if no elements in the
       
  6946                array are bigger, then the index value is the same as the total
       
  6947                number of elements in the array. If there is a matching element,
       
  6948                then what the index refers to depends on the value of aMode:
       
  6949                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  6950                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  6951                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  6952                the last matching element - if the last matching element is also the last element
       
  6953                of the array, then the index value is the same as the total number of elements in the array.
       
  6954                
       
  6955 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined
       
  6956                by one of the TArrayFindMode enum values.
       
  6957                
       
  6958 @leave KErrNotFound if no matching entry exists.
       
  6959 
       
  6960 @see TArrayFindMode
       
  6961 */
       
  6962 inline void RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt& anIndex, TInt aMode) const
       
  6963 	{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
       
  6964 
       
  6965 
       
  6966 /**
       
  6967 Inserts a signed integer into the array in signed integer order.
       
  6968 
       
  6969 No duplicate entries are permitted.
       
  6970 
       
  6971 The function assumes that existing entries within the array are in signed 
       
  6972 integer order.
       
  6973 
       
  6974 The function leaves with one of the system wide error codes, if the operation fails.
       
  6975 
       
  6976 Note that the array remains unchanged following an attempt to insert a duplicate entry. 
       
  6977 
       
  6978 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  6979 
       
  6980 @param anEntry The signed integer to be inserted.
       
  6981 */
       
  6982 inline void RArray<TInt>::InsertInOrderL(TInt anEntry)
       
  6983 	{ User::LeaveIfError(InsertInOrder(anEntry));}
       
  6984 
       
  6985 
       
  6986 /**
       
  6987 Inserts a signed integer into the array in signed integer order,
       
  6988 allowing duplicates.
       
  6989 
       
  6990 If anEntry is a duplicate of an existing entry in the array, then the new 
       
  6991 signed integer is inserted after the existing one. If more than one duplicate 
       
  6992 entry already exists in the array, then any new duplicate signed integer is 
       
  6993 inserted after the last one.
       
  6994 
       
  6995 The function assumes that existing entries within the array are in signed 
       
  6996 integer order.
       
  6997 
       
  6998 The function leaves with one of the system wide error codes, if the operation fails.
       
  6999 	
       
  7000 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  7001 	
       
  7002 @param anEntry The signed integer to be inserted.
       
  7003 */
       
  7004 inline void RArray<TInt>::InsertInOrderAllowRepeatsL(TInt anEntry)
       
  7005 	{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
       
  7006 
       
  7007 
       
  7008 
       
  7009 /**
       
  7010 Reserves space for the specified number of elements.
       
  7011 
       
  7012 After a call to this function, the memory allocated to the array is sufficient 
       
  7013 to hold the number of integers specified. Adding new integers to the array 
       
  7014 does not result in a re-allocation of memory until the the total number of 
       
  7015 integers exceeds the specified count.
       
  7016 
       
  7017 @param	aCount	The number of integers for which space should be reserved
       
  7018 @leave KErrNoMemory	If the requested amount of memory could not be allocated
       
  7019 */
       
  7020 inline void RArray<TInt>::ReserveL(TInt aCount)
       
  7021 	{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
       
  7022 
       
  7023 
       
  7024 
       
  7025 
       
  7026 /**
       
  7027 Appends an unsigned integer onto the array.
       
  7028 	
       
  7029 The function leaves with one of the system wide error codes, if the operation fails.
       
  7030 	
       
  7031 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7032 	
       
  7033 @param anEntry The unsigned integer to be appended.
       
  7034 */
       
  7035 inline void RArray<TUint>::AppendL(TUint anEntry)
       
  7036 	{ User::LeaveIfError(Append(anEntry));}
       
  7037 
       
  7038 
       
  7039 /**
       
  7040 Inserts an unsigned integer into the array at the specified position.
       
  7041 	
       
  7042 The function leaves with one of the system wide error codes, if the operation fails.
       
  7043 	
       
  7044 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7045 	
       
  7046 @param anEntry  The unsigned integer to be inserted.
       
  7047 @param aPos     The position within the array where the unsigned integer is to 
       
  7048 	            be inserted. The position is relative to zero, i.e. zero
       
  7049 				implies that an entry is inserted at the beginning of
       
  7050 				the array.
       
  7051 			
       
  7052 @panic USER 131, if aPos is negative, or is greater than the number of entries
       
  7053        currently in the array.
       
  7054 */
       
  7055 inline void RArray<TUint>::InsertL(TUint anEntry, TInt aPos)
       
  7056 	{ User::LeaveIfError(Insert(anEntry, aPos));}
       
  7057 
       
  7058 
       
  7059 /**
       
  7060 Finds the first unsigned integer in the array which matches the specified
       
  7061 value, using a sequential search.
       
  7062 
       
  7063 The find operation always starts at the low index end of the array. There 
       
  7064 is no assumption about the order of entries in the array.
       
  7065 	
       
  7066 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7067 	
       
  7068 @param anEntry The unsigned integer to be found.
       
  7069 @return The index of the first matching unsigned integer within the array.
       
  7070 @leave  KErrNotFound, if no matching entry can be found.
       
  7071 */
       
  7072 inline TInt RArray<TUint>::FindL(TUint anEntry) const
       
  7073 	{ return User::LeaveIfError(Find(anEntry));}
       
  7074 
       
  7075 
       
  7076 /**
       
  7077 Finds the last unsigned integer in the array which matches the specified
       
  7078 value, using a sequential search.
       
  7079 
       
  7080 The find operation always starts at the high index end of the array. There 
       
  7081 is no assumption about the order of entries in the array.
       
  7082 	
       
  7083 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7084 	
       
  7085 @param anEntry The unsigned integer to be found.
       
  7086 @return The index of the last matching unsigned integer within the array.
       
  7087 @leave  KErrNotFound, if no matching entry can be found.
       
  7088 */
       
  7089 inline TInt RArray<TUint>::FindReverseL(TUint anEntry) const
       
  7090 	{ return User::LeaveIfError(FindReverse(anEntry));}
       
  7091 
       
  7092 
       
  7093 /**
       
  7094 Finds the unsigned integer in the array which matches the specified value, 
       
  7095 using a binary search technique.
       
  7096 	
       
  7097 The functions assume that existing entries within the array are in unsigned 
       
  7098 integer order.
       
  7099 
       
  7100 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  7101 	
       
  7102 @param anEntry The unsigned integer to be found.
       
  7103 
       
  7104 @return The index of the matching unsigned integer within the array;
       
  7105 @leave  KErrNotFound, if no matching entry can be found.
       
  7106 */
       
  7107 inline TInt RArray<TUint>::FindInOrderL(TUint anEntry) const
       
  7108 	{ return User::LeaveIfError(FindInOrder(anEntry));}
       
  7109 
       
  7110 
       
  7111 /**
       
  7112 Finds the unsigned integer in the array which matches the specified value, 
       
  7113 using a binary search technique.
       
  7114 
       
  7115 If the index cannot be found, the function returns the index of the last
       
  7116 unsigned integer within the array which logically precedes anEntry.
       
  7117 The functions assume that existing entries within the array are in unsigned 
       
  7118 integer order.
       
  7119 	
       
  7120 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  7121 	
       
  7122 @param anEntry The unsigned integer to be found.
       
  7123 @param anIndex A TInt supplied by the caller. On return, contains an index
       
  7124                value of the matching unsigned integer within the array. 
       
  7125                If the function leaves with KErrNotFound, this is the index of the
       
  7126                first unsigned integer within the array that is bigger than the
       
  7127                unsigned integer being searched for - if no unsigned integers within
       
  7128                the array are bigger, then the index value is the same as the
       
  7129                total number of unsigned integers within the array.
       
  7130 
       
  7131 @leave  KErrNotFound, if no matching entry can be found.
       
  7132 */
       
  7133 inline void RArray<TUint>::FindInOrderL(TUint anEntry, TInt& anIndex) const
       
  7134 	{ User::LeaveIfError(FindInOrder(anEntry, anIndex));}
       
  7135 
       
  7136 
       
  7137 /**
       
  7138 Finds the unsigned integer in the array that matches the specified unsigned integer 
       
  7139 using a binary search technique.
       
  7140 
       
  7141 In the case that there is more than one matching element, finds the first, last or any
       
  7142 match as specified.
       
  7143 	
       
  7144 The function assumes that the array is in unsigned integer order.
       
  7145 
       
  7146 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
       
  7147 	
       
  7148 @param anEntry The unsigned integer to be found.
       
  7149 @param aMode   Specifies whether to find the first match, the last match or 
       
  7150                any match, as defined by one of the TArrayFindMode enum values.
       
  7151 
       
  7152 @return The array index of a matching element - what the index refers to depends
       
  7153         on the value of aMode:
       
  7154         if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  7155         if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  7156         if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  7157         the last matching element - if the last matching element is also the last element
       
  7158         of the array, then the index value is the same as the total number of elements in the array.
       
  7159         
       
  7160 @leave KErrNotFound if no matching entry exists.
       
  7161 
       
  7162 @see TArrayFindMode
       
  7163 */
       
  7164 inline TInt RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt aMode) const
       
  7165 	{ return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
       
  7166 
       
  7167 
       
  7168 /**
       
  7169 Finds the unsigned integer in the array that matches the specified unsigned integer
       
  7170 using a binary search technique.
       
  7171 
       
  7172 Where there is more than one matching element, it finds the first, last or
       
  7173 any matching element as specified by the value of aMode.
       
  7174 
       
  7175 The function assumes that the array is in unsigned integer order.
       
  7176 	
       
  7177 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7178 	
       
  7179 @param anEntry The unsigned integer to be found.
       
  7180 @param anIndex A TInt type supplied by the caller. On return, it contains an index
       
  7181                value depending on whether a match is found and on the value of aMode.
       
  7182                If there is no matching element in the array, then this is the
       
  7183                index of the first element in the array that is bigger than the element
       
  7184                being searched for - if no elements in the array are bigger, then
       
  7185                the index value is the same as the total number of elements in the array.
       
  7186                If there is a matching element, then what the index refers to depends on
       
  7187                the value of aMode:
       
  7188                if this is EArrayFindMode_First, then the index refers to the first matching element;
       
  7189                if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
       
  7190                if this is EArrayFindMode_Last, then the index refers to first element that follows
       
  7191                the last matching element - if the last matching element is also the last element of the array,
       
  7192                then the index value is the same as the total number of elements in the array.
       
  7193                
       
  7194 @param	aMode  Specifies whether to find the first match, the last match or any match, as defined by
       
  7195                one of the TArrayFindMode enum values.
       
  7196 @leave KErrNotFound if no matching entry exists.
       
  7197 
       
  7198 @see TArrayFindMode
       
  7199 */
       
  7200 inline void RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt& anIndex, TInt aMode) const
       
  7201 	{ User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
       
  7202 
       
  7203 
       
  7204 /**
       
  7205 Inserts an unsigned integer into the array in unsigned integer order.
       
  7206 
       
  7207 No duplicate entries are permitted.
       
  7208 
       
  7209 The function assumes that existing entries within the array are in unsigned 
       
  7210 integer order.
       
  7211 
       
  7212 The function leaves with one of the system wide error codes, if the operation fails.
       
  7213 	
       
  7214 Note that the array remains unchanged following an attempt to insert a duplicate entry.
       
  7215 	
       
  7216 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7217 	
       
  7218 @param anEntry The unsigned integer to be inserted.
       
  7219 */
       
  7220 inline void RArray<TUint>::InsertInOrderL(TUint anEntry)
       
  7221 	{ User::LeaveIfError(InsertInOrder(anEntry));}
       
  7222 
       
  7223 
       
  7224 /**
       
  7225 Inserts an unsigned integer into the array in unsigned integer order, allowing 
       
  7226 duplicates.
       
  7227 
       
  7228 If the new integer is a duplicate of an existing entry in the array, then 
       
  7229 the new unsigned integer is inserted after the existing one. If more than 
       
  7230 one duplicate entry already exists in the array, then any new duplicate
       
  7231 unsigned integer is inserted after the last one.
       
  7232 	
       
  7233 The function assumes that existing entries within the array are in unsigned 
       
  7234 integer order.
       
  7235 
       
  7236 The function leaves with one of the system wide error codes, if the operation fails.
       
  7237 	
       
  7238 NOTE: This function is NOT AVAILABLE to code running on the kernel side.	
       
  7239 	
       
  7240 @param anEntry The unsigned integer to be inserted.
       
  7241 */
       
  7242 inline void RArray<TUint>::InsertInOrderAllowRepeatsL(TUint anEntry)
       
  7243 	{ User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
       
  7244 
       
  7245 
       
  7246 
       
  7247 /**
       
  7248 Reserves space for the specified number of elements.
       
  7249 
       
  7250 After a call to this function, the memory allocated to the array is sufficient 
       
  7251 to hold the number of integers specified. Adding new integers to the array 
       
  7252 does not result in a re-allocation of memory until the the total number of 
       
  7253 integers exceeds the specified count.
       
  7254 
       
  7255 @param	aCount	The number of integers for which space should be reserved
       
  7256 @leave KErrNoMemory	If the requested amount of memory could not be allocated
       
  7257 */
       
  7258 inline void RArray<TUint>::ReserveL(TInt aCount)
       
  7259 	{ User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
       
  7260 
       
  7261 
       
  7262 
       
  7263 
       
  7264 /**
       
  7265 Sets the priority of the client's process.
       
  7266 
       
  7267 @param aPriority The priority value.
       
  7268 */
       
  7269 inline void RMessagePtr2::SetProcessPriorityL(TProcessPriority aPriority) const
       
  7270 	{ User::LeaveIfError(SetProcessPriority(aPriority));}
       
  7271 
       
  7272 
       
  7273 /**
       
  7274 Opens a handle on the client thread.
       
  7275 
       
  7276 @param aClient    On successful return, the handle to the client thread.
       
  7277 @param aOwnerType An enumeration whose enumerators define the ownership of
       
  7278                   the handle. If not explicitly specified,
       
  7279                   EOwnerProcess is taken as default.
       
  7280 */
       
  7281 inline void RMessagePtr2::ClientL(RThread& aClient, TOwnerType aOwnerType) const
       
  7282 	{ User::LeaveIfError(Client(aClient, aOwnerType));}
       
  7283 
       
  7284 
       
  7285 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  7286 
       
  7287 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, const char* aDiagnostic) const
       
  7288 	{
       
  7289 	return DoHasCapability(aCapability, aDiagnostic);
       
  7290 	}
       
  7291 
       
  7292 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, const char* aDiagnosticMessage) const
       
  7293 	{
       
  7294 	if (!HasCapability(aCapability, aDiagnosticMessage))
       
  7295 		{
       
  7296 		User::Leave(KErrPermissionDenied);
       
  7297 		}
       
  7298 	}
       
  7299 
       
  7300 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
       
  7301 	{
       
  7302 	return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
       
  7303 	}
       
  7304 
       
  7305 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, const char* aDiagnosticMessage) const
       
  7306 	{
       
  7307 	if (!HasCapability(aCapability1, aCapability2, aDiagnosticMessage))
       
  7308 		{
       
  7309 		User::Leave(KErrPermissionDenied);
       
  7310 		}
       
  7311 	}
       
  7312 
       
  7313 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  7314 
       
  7315 // Only available to NULL arguments
       
  7316 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
       
  7317 	{
       
  7318 	return DoHasCapability(aCapability);
       
  7319 	}
       
  7320 
       
  7321 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnosticMessage*/) const
       
  7322 	{
       
  7323 	if (!DoHasCapability(aCapability))
       
  7324 		{
       
  7325 		User::Leave(KErrPermissionDenied);
       
  7326 		}
       
  7327 	}
       
  7328 
       
  7329 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
       
  7330 	{
       
  7331 	return DoHasCapability(aCapability1, aCapability2);
       
  7332 	}
       
  7333 
       
  7334 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnosticMessage*/) const
       
  7335 	{
       
  7336 	if (!DoHasCapability(aCapability1, aCapability2))
       
  7337 		{
       
  7338 		User::Leave(KErrPermissionDenied);
       
  7339 		}
       
  7340 	}
       
  7341 
       
  7342 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
       
  7343 // For things using KSuppressPlatSecDiagnostic
       
  7344 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  7345 	{
       
  7346 	return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
       
  7347 	}
       
  7348 
       
  7349 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  7350 	{
       
  7351 	if (!DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue))
       
  7352 		{
       
  7353 		User::Leave(KErrPermissionDenied);
       
  7354 		}
       
  7355 	}
       
  7356 
       
  7357 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  7358 	{
       
  7359 	return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
       
  7360 	}
       
  7361 
       
  7362 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
       
  7363 	{
       
  7364 	if (!DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue))
       
  7365 		{
       
  7366 		User::Leave(KErrPermissionDenied);
       
  7367 		}
       
  7368 	}
       
  7369 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
       
  7370 
       
  7371 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
       
  7372 
       
  7373 inline TInt RThread::RenameMe(const TDesC& aName)
       
  7374 	{ return User::RenameThread(aName); }
       
  7375 inline TInt RProcess::RenameMe(const TDesC& aName)
       
  7376 	{ return User::RenameProcess(aName); }
       
  7377 
       
  7378 #endif // !__KERNEL_MODE__
       
  7379 
       
  7380 #ifdef __SUPPORT_CPP_EXCEPTIONS__
       
  7381 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
       
  7382 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
       
  7383 // when we move to supporting Standard C++.
       
  7384 
       
  7385 // The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target.
       
  7386 // In this case, we wish to avoid defining uncaught_exception below since it clashes with the StdC++ specification 
       
  7387 #if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__) && !defined(__SYMBIAN_STDCPP_SUPPORT__)
       
  7388 
       
  7389 #if defined(__VC32__) && !defined(_CRTIMP_PURE)
       
  7390 
       
  7391 	// Declare MS EH runtime functions
       
  7392 	bool __uncaught_exception(void);
       
  7393 
       
  7394 #if _MSC_VER >= 1200
       
  7395 	__declspec(noreturn) void terminate(void);
       
  7396 	__declspec(noreturn) void unexpected(void);
       
  7397 #else
       
  7398 	void terminate(void);
       
  7399 	void unexpected(void);
       
  7400 #endif
       
  7401 
       
  7402 	typedef void (*terminate_handler)();
       
  7403 	terminate_handler set_terminate(terminate_handler h) throw();
       
  7404 	typedef void (*unexpected_handler)();
       
  7405 	unexpected_handler set_unexpected(unexpected_handler h) throw();
       
  7406 
       
  7407 namespace std {
       
  7408 #ifdef __MSVCDOTNET__
       
  7409 	inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
       
  7410 #else // !__MSVCDOTNET__
       
  7411 	// MS KB242192: BUG: uncaught_exception() Always Returns False
       
  7412 	inline bool uncaught_exception(void) { return false; }
       
  7413 #endif //__MSVCDOTNET__
       
  7414 	inline void terminate(void) { ::terminate(); }
       
  7415 	inline void unexpected(void) { ::unexpected(); }
       
  7416 	inline terminate_handler set_terminate(terminate_handler h) throw() { return ::set_terminate(h); }
       
  7417 	inline unexpected_handler set_unexpected(unexpected_handler h) throw() { return ::set_unexpected(h); }
       
  7418 }
       
  7419 
       
  7420 #endif // extract from MSVC headers
       
  7421 
       
  7422 #ifdef __CW32__
       
  7423 
       
  7424 	extern "C" bool __uncaught_exception(void);
       
  7425 
       
  7426 namespace std {
       
  7427 #if __MWERKS__ > 0x3200
       
  7428 	inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
       
  7429 #else
       
  7430 	// no uncaught_exception() implementation on CW 2.4.7
       
  7431 	inline bool uncaught_exception(void) { return false; }
       
  7432 #endif
       
  7433 }
       
  7434 
       
  7435 #endif // extract from CW headers
       
  7436 
       
  7437 #endif // <exception> header guard
       
  7438 
       
  7439 #endif //__SUPPORT_CPP_EXCEPTIONS__