1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/e32std.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,7401 @@
1.4 +// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\e32std.inl
1.18 +//
1.19 +//
1.20 +
1.21 +// Global leaving operator new
1.22 +inline TAny* operator new(TUint aSize, TLeave)
1.23 + {return User::AllocL(aSize);}
1.24 +inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize)
1.25 + {return User::AllocL(aSize + aExtraSize);}
1.26 +#if !defined(__VC32__) || defined (__MSVCDOTNET__)
1.27 +inline TAny* operator new[](TUint aSize, TLeave)
1.28 + {return User::AllocL(aSize);}
1.29 +#endif
1.30 +
1.31 +
1.32 +
1.33 +
1.34 +// class Mem
1.35 +inline TUint8* Mem::Copy(TAny* aTrg, const TAny* aSrc, TInt aLength)
1.36 +/**
1.37 +Copies data from a source location to a target location and returns a pointer
1.38 +to the end of the copied data.
1.39 +
1.40 +The source and target areas can overlap.
1.41 +
1.42 +The copy operation is optimised so that if both source and target locations
1.43 +are aligned on a word boundary, the operation performs the copy on a word
1.44 +by word basis.
1.45 +
1.46 +@param aTrg A pointer to the target location for the copy operation.
1.47 +@param aSrc A pointer to the source location for the copy operation.
1.48 +@param aLength The number of bytes to be copied. This value must not
1.49 + be negative.
1.50 +
1.51 +@return A pointer to a location aLength bytes beyond aTrg (i.e. the location
1.52 + aTrg+aLength).
1.53 +
1.54 +@panic USER 90 In debug builds only, if aLength is negative.
1.55 +*/
1.56 + { return (TUint8*)memmove(aTrg, aSrc, aLength) + aLength; }
1.57 +
1.58 +
1.59 +
1.60 +
1.61 +inline TUint8* Mem::Move(TAny* aTrg, const TAny* aSrc, TInt aLength)
1.62 +/**
1.63 +Moves a block of data from a source location to a target location and returns
1.64 +a pointer to the end of the moved data.
1.65 +
1.66 +The source and target areas can overlap.
1.67 +
1.68 +Both source and target locations must be aligned on a word boundary.
1.69 +The specified length must also be a multiple of 4.
1.70 +
1.71 +@param aTrg A pointer to the target location for the move operation. This
1.72 + pointer must be word aligned.
1.73 +@param aSrc A pointer to the source location for the move operation. This
1.74 + pointer must be word aligned.
1.75 +@param aLength The number of bytes to be copied. This value must be a multiple
1.76 + of 4.
1.77 +
1.78 +@return A pointer to a location aLength bytes beyond aTrg (i.e. the location
1.79 + aTrg+aLength).
1.80 +
1.81 +@panic USER 93 In debug builds only, if aTrg is not word aligned.
1.82 +@panic USER 92 In debug builds only, if aSrc is not word aligned.
1.83 +@panic USER 91 In debug builds only, if aLength is not a multiple of 4.
1.84 +*/
1.85 + { return (TUint8*)wordmove(aTrg, aSrc, aLength) + aLength; }
1.86 +
1.87 +
1.88 +
1.89 +
1.90 +inline void Mem::Fill(TAny* aTrg, TInt aLength, TChar aChar)
1.91 +/**
1.92 +Fills a specified block of data with a specified character, replacing
1.93 +any existing content.
1.94 +
1.95 +The function assumes that the fill character is a non-Unicode character.
1.96 +
1.97 +@param aTrg A pointer to the location where filling is to start.
1.98 +@param aLength The number of bytes to be filled. This value must not
1.99 + be negative.
1.100 +@param aChar The fill character.
1.101 +
1.102 +@panic USER 95 In debug builds only, if aLength is negative.
1.103 +*/
1.104 + { memset(aTrg, (TInt)(aChar.operator TUint()), aLength); }
1.105 +
1.106 +
1.107 +
1.108 +
1.109 +inline void Mem::FillZ(TAny* aTrg,TInt aLength)
1.110 +/**
1.111 +Fills a specified block of data with binary zeroes (i.e. 0x00), replacing any
1.112 +existing content.
1.113 +
1.114 +@param aTrg A pointer to the location where filling is to start.
1.115 +@param aLength The number of bytes to be filled. This value must not
1.116 + be negative.
1.117 +
1.118 +@panic USER 95 In debug builds only, if aLength is negative.
1.119 +*/
1.120 + { memclr(aTrg, aLength); }
1.121 +
1.122 +
1.123 +
1.124 +
1.125 +#ifndef __GCC32__
1.126 +inline TInt Mem::Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL)
1.127 +/**
1.128 +Compares a block of data at one specified location with a block of data at
1.129 +another specified location.
1.130 +
1.131 +The comparison proceeds on a byte for byte basis, the result of the comparison
1.132 +is based on the difference of the first bytes to disagree.
1.133 +
1.134 +The data at the two locations are equal if they have the same length and content.
1.135 +Where the lengths are different and the shorter section of data is the same
1.136 +as the first part of the longer section of data, the shorter is considered
1.137 +to be less than the longer.
1.138 +
1.139 +@param aLeft A pointer to the first (or left) block of 8 bit data
1.140 + to be compared.
1.141 +@param aLeftL The length of the first (or left) block of data to be compared,
1.142 + i.e. the number of bytes.
1.143 +@param aRight A pointer to the second (or right) block of 8 bit data to be
1.144 + compared.
1.145 +@param aRightL The length of the second (or right) block of data to be compared
1.146 + i.e. the number of bytes.
1.147 +
1.148 +@return Positive, if the first (or left) block of data is greater than the
1.149 + second (or right) block of data.
1.150 + Negative, if the first (or left) block of data is less than the
1.151 + second (or right) block of data.
1.152 + Zero, if both the first (or left) and second (or right) blocks of data
1.153 + have the same length and the same content.
1.154 +*/
1.155 + { return memcompare(aLeft, aLeftL, aRight, aRightL); }
1.156 +#endif
1.157 +
1.158 +
1.159 +
1.160 +
1.161 +// class RHeap
1.162 +inline TInt RHeap::SetBrk(TInt aBrk)
1.163 + { return ((RChunk*)&iChunkHandle)->Adjust(aBrk); }
1.164 +
1.165 +
1.166 +
1.167 +
1.168 +// class TChar
1.169 +#ifndef __KERNEL_MODE__
1.170 +inline void TChar::SetChar(TUint aChar)
1.171 + {iChar=aChar;}
1.172 +
1.173 +
1.174 +
1.175 +
1.176 +inline void TChar::Fold()
1.177 +/**
1.178 +Converts the character to a form which can be used in tolerant comparisons
1.179 +without control over the operations performed.
1.180 +
1.181 +Tolerant comparisons are those which ignore character differences like case
1.182 +and accents.
1.183 +
1.184 +This function can be used when searching for a string in a text file or a
1.185 +file in a directory. Folding performs the following conversions: converts
1.186 +to lowercase, strips accents, converts all digits representing the values
1.187 +0..9 to the ordinary digit characters '0'..'9', converts all spaces (standard,
1.188 +non-break, fixed-width, ideographic, etc.) to the ordinary space character
1.189 +(0x0020), converts Japanese characters in the hiragana syllabary to katakana,
1.190 +and converts East Asian halfwidth and fullwidth variants to their ordinary
1.191 +forms. You can choose to perform any subset of these operations by using the
1.192 +other function overload.
1.193 +
1.194 +@see User::Fold
1.195 +*/
1.196 + {iChar=User::Fold(iChar);}
1.197 +
1.198 +
1.199 +
1.200 +
1.201 +inline void TChar::LowerCase()
1.202 +/**
1.203 +Converts the character to its lowercase form.
1.204 +
1.205 +Characters lacking a lowercase form are unchanged.
1.206 +
1.207 +@see User::LowerCase
1.208 +*/
1.209 + {iChar=User::LowerCase(iChar);}
1.210 +
1.211 +
1.212 +
1.213 +
1.214 +inline void TChar::UpperCase()
1.215 +/**
1.216 +Converts the character to its uppercase form.
1.217 +
1.218 +Characters lacking an uppercase form are unchanged.
1.219 +
1.220 +@see User::UpperCase
1.221 +*/
1.222 + {iChar=User::UpperCase(iChar);}
1.223 +
1.224 +
1.225 +
1.226 +
1.227 +#ifdef _UNICODE
1.228 +inline void TChar::Fold(TInt aFlags)
1.229 +/**
1.230 +Converts the character to a form which can be used in tolerant comparisons
1.231 +allowing selection of the specific fold operations to be performed.
1.232 +
1.233 +@param aFlags Flags which define the operations to be performed. The values
1.234 + are defined in the enum beginning with EFoldCase.
1.235 +
1.236 +@see TChar::EFoldCase
1.237 +@see User::Fold
1.238 +*/
1.239 + {iChar=User::Fold(iChar,aFlags);}
1.240 +
1.241 +
1.242 +
1.243 +
1.244 +inline void TChar::TitleCase()
1.245 +/**
1.246 +Converts the character to its titlecase form.
1.247 +
1.248 +The titlecase form of a character is identical to its uppercase form unless
1.249 +a specific titlecase form exists. Characters lacking a titlecase form are
1.250 +unchanged.
1.251 +*/
1.252 + {iChar=User::TitleCase(iChar);}
1.253 +#endif
1.254 +
1.255 +
1.256 +
1.257 +
1.258 +inline TBool TChar::Eos() const
1.259 +/**
1.260 +Tests whether the character is the C/C++ end-of-string character - 0.
1.261 +
1.262 +@return True, if the character is 0; false, otherwise.
1.263 +*/
1.264 + {return(iChar==0);}
1.265 +#endif // _UNICODE
1.266 +
1.267 +
1.268 +
1.269 +
1.270 +// Class TCallBack
1.271 +inline TCallBack::TCallBack()
1.272 +/**
1.273 +Default constructor.
1.274 +
1.275 +Sets the function pointer to Null.
1.276 +*/
1.277 + {iFunction=NULL;}
1.278 +
1.279 +
1.280 +
1.281 +
1.282 +inline TCallBack::TCallBack(TInt (*aFunction)(TAny *aPtr))
1.283 + : iFunction(aFunction),iPtr(NULL)
1.284 +/**
1.285 +Constructs the callback object with the specified callback function.
1.286 +
1.287 +@param aFunction A pointer to the callback function. It takes an argument of
1.288 + type TAny* and returns a TInt.
1.289 + It must be either a static member of a class or a function
1.290 + which is not a member of any class.
1.291 +*/
1.292 + {}
1.293 +
1.294 +
1.295 +
1.296 +
1.297 +inline TCallBack::TCallBack(TInt (*aFunction)(TAny *aPtr),TAny *aPtr)
1.298 + : iFunction(aFunction),iPtr(aPtr)
1.299 +/**
1.300 +Constructs the callback object with the specified callback function and
1.301 +a pointer to any object.
1.302 +
1.303 +@param aFunction A pointer to the callback function. It takes an argument of
1.304 + type TAny* and returns a TInt.
1.305 + It must be either a static member of a class or a function
1.306 + which is not a member of any class.
1.307 +@param aPtr A pointer which is always passed to the callback function.
1.308 +*/
1.309 + {}
1.310 +
1.311 +
1.312 +
1.313 +
1.314 +/**
1.315 +Calls the callback function.
1.316 +
1.317 +@return The value returned by the callback function. The meaning of this value
1.318 + depends entirely on the context in which the callback function
1.319 + is called.
1.320 + For example, when used with the CIdle class, a false (zero) value
1.321 + indicates that the callback function should not be called again.
1.322 + As another example, when used with the CPeriodic class, the return
1.323 + value is ignored and is irrelevant in that context.
1.324 +
1.325 +@see CIdle
1.326 +@see CPeriodic
1.327 +*/
1.328 +inline TInt TCallBack::CallBack() const
1.329 + { return (iFunction ? (*iFunction)(iPtr) : 0); }
1.330 +
1.331 +
1.332 +
1.333 +
1.334 +// Class TSglQue
1.335 +template <class T>
1.336 +inline TSglQue<T>::TSglQue()
1.337 +/**
1.338 +Constructs an empty list header and sets the offset value of the link object
1.339 +to zero.
1.340 +
1.341 +In practice, never assume that the offset of the link object from the start
1.342 +of a list element is zero, even if the link object is declared as the first
1.343 +data member in the list element class.
1.344 +
1.345 +If this default constructor is used, then call the SetOffset() function of
1.346 +the base class to ensure that the offset value is set correctly.
1.347 +
1.348 +@see TSglQueBase::SetOffset
1.349 +*/
1.350 + {}
1.351 +
1.352 +
1.353 +
1.354 +
1.355 +template <class T>
1.356 +inline TSglQue<T>::TSglQue(TInt aOffset)
1.357 + : TSglQueBase(aOffset)
1.358 +/**
1.359 +Constructs an empty list header and sets the offset of the link object to the
1.360 +specified value.
1.361 +
1.362 +@param aOffset The offset of the link object from the start of a list element.
1.363 + The macro _FOFF can be used to calculate this value.
1.364 +
1.365 +@panic USER 75, if aOffset is not divisible by four.
1.366 +
1.367 +@see _FOFF
1.368 +*/
1.369 + {}
1.370 +
1.371 +
1.372 +
1.373 +
1.374 +template <class T>
1.375 +inline void TSglQue<T>::AddFirst(T &aRef)
1.376 +/**
1.377 +Inserts the specified list element at the front of the singly linked list.
1.378 +
1.379 +If the list is not empty, the specified element becomes the first in the list.
1.380 +What was previously the first element becomes the second in the list.
1.381 +
1.382 +@param aRef The list element to be inserted at the front of the singly linked
1.383 + list.
1.384 +*/
1.385 + {DoAddFirst(&aRef);}
1.386 +
1.387 +
1.388 +
1.389 +
1.390 +template <class T>
1.391 +inline void TSglQue<T>::AddLast(T &aRef)
1.392 +/**
1.393 +Inserts the specified list element at the back of the singly linked list.
1.394 +
1.395 +If the list is not empty, the specified element becomes the last in the list.
1.396 +What was previously the last element becomes the next to last element in the
1.397 +list.
1.398 +
1.399 +@param aRef The list element to be inserted at the back of the singly linked
1.400 + list.
1.401 +*/
1.402 + {DoAddLast(&aRef);}
1.403 +
1.404 +
1.405 +
1.406 +
1.407 +template <class T>
1.408 +inline TBool TSglQue<T>::IsFirst(const T *aPtr) const
1.409 +/**
1.410 +Tests whether the specified element is the first in the singly linked list.
1.411 +
1.412 +@param aPtr A pointer to the element whose position in the list is to be
1.413 + checked.
1.414 +
1.415 +@return True, if the element is the first in the list; false, otherwise.
1.416 +*/
1.417 + {return(PtrAdd(aPtr,iOffset)==(T *)iHead);}
1.418 +
1.419 +
1.420 +
1.421 +
1.422 +template <class T>
1.423 +inline TBool TSglQue<T>::IsLast(const T *aPtr) const
1.424 +/**
1.425 +Tests whether the specified element is the last in the singly linked list.
1.426 +
1.427 +@param aPtr A pointer to the element whose position in the list is
1.428 + to be checked.
1.429 +
1.430 +@return True, if the element is the last in the list; false, otherwise.
1.431 +*/
1.432 + {return(PtrAdd(aPtr,iOffset)==(T *)iLast);}
1.433 +
1.434 +
1.435 +
1.436 +
1.437 +template <class T>
1.438 +inline T *TSglQue<T>::First() const
1.439 +/**
1.440 +Gets a pointer to the first list element in the singly linked list.
1.441 +
1.442 +@return A pointer to the first list element in the singly linked list. If
1.443 + the list is empty, this pointer is not necessarily NULL and must not
1.444 + be assumed to point to a valid object.
1.445 +*/
1.446 + {return(PtrSub((T *)iHead,iOffset));}
1.447 +
1.448 +
1.449 +
1.450 +
1.451 +template <class T>
1.452 +inline T *TSglQue<T>::Last() const
1.453 +/**
1.454 +Gets a pointer to the last list element in the singly linked list.
1.455 +
1.456 +@return A pointer to the last list element in the singly linked list. If the
1.457 + list is empty, this pointer is not necessarily NULL and must not be
1.458 + assumed to point to a valid object.
1.459 +*/
1.460 + {return(PtrSub((T *)iLast,iOffset));}
1.461 +
1.462 +
1.463 +
1.464 +
1.465 +template <class T>
1.466 +inline void TSglQue<T>::Remove(T &aRef)
1.467 +/**
1.468 +Removes the specified element from the singly linked list.
1.469 +
1.470 +The singly linked list must not be empty.
1.471 +
1.472 +@param aRef A list element to be removed from the singly linked list.
1.473 +
1.474 +@panic USER 76, if the element to be removed is not in the list
1.475 +*/
1.476 + {DoRemove(&aRef);}
1.477 +
1.478 +
1.479 +
1.480 +
1.481 +// Class TDblQue
1.482 +template <class T>
1.483 +inline TDblQue<T>::TDblQue()
1.484 +/**
1.485 +Constructs an empty list header and sets the offset value of the link object
1.486 +to zero.
1.487 +
1.488 +In practice, never assume that the offset of the link object from the start
1.489 +of a list element is zero, even if the link object is declared as the first
1.490 +data member in the list element class.
1.491 +
1.492 +If this default constructor is used, then call the SetOffset() function of
1.493 +the base class to ensure that the offset value is set correctly.
1.494 +
1.495 +@see TDblQueBase::SetOffset()
1.496 +*/
1.497 + {}
1.498 +
1.499 +
1.500 +
1.501 +
1.502 +template <class T>
1.503 +inline TDblQue<T>::TDblQue(TInt aOffset)
1.504 + : TDblQueBase(aOffset)
1.505 +/**
1.506 +Constructs an empty list header and sets the offset of the link object to the
1.507 +specified value.
1.508 +
1.509 +@param aOffset The offset of the link object from the start of a list element.
1.510 + The macro _FOFF can be used to calculate this value.
1.511 +
1.512 +@panic USER 78. if aOffset is not divisble by 4.
1.513 +
1.514 +@see _FOFF
1.515 +*/
1.516 + {}
1.517 +
1.518 +
1.519 +
1.520 +
1.521 +template <class T>
1.522 +inline void TDblQue<T>::AddFirst(T &aRef)
1.523 +/**
1.524 +Inserts the specified list element at the front of the doubly linked list.
1.525 +
1.526 +If the list is not empty, the specified element becomes the first in the list.
1.527 +What was previously the first element becomes the second in the list.
1.528 +
1.529 +@param aRef The list element to be inserted at the front of the doubly linked
1.530 + list.
1.531 +*/
1.532 + {DoAddFirst(&aRef);}
1.533 +
1.534 +
1.535 +
1.536 +
1.537 +template <class T>
1.538 +inline void TDblQue<T>::AddLast(T &aRef)
1.539 +/**
1.540 +Inserts the specified list element at the back of the doubly linked list.
1.541 +
1.542 +If the list is not empty, the specified element becomes the last in the list.
1.543 +What was previously the last element becomes the next to last element in the
1.544 +list.
1.545 +
1.546 +@param aRef The list element to be inserted at the back of the doubly linked
1.547 + list.
1.548 +*/
1.549 + {DoAddLast(&aRef);}
1.550 +
1.551 +
1.552 +
1.553 +
1.554 +template <class T>
1.555 +inline TBool TDblQue<T>::IsHead(const T *aPtr) const
1.556 +/**
1.557 +Tests whether the end of a list has been reached.
1.558 +
1.559 +A doubly linked list is circular; in following the chain of elements in a
1.560 +list (e.g. using the iterator operator++ or operator--), the chain eventually
1.561 +reaches the end of the list and aPtr corresponds to the header (although it
1.562 +will not point to a valid T object).
1.563 +
1.564 +@param aPtr The pointer value to be checked.
1.565 +
1.566 +@return True, if the end of the list has been reached. False, if the end of
1.567 + the list has not been reached; aPtr points to an element in the list.
1.568 +*/
1.569 + {return(PtrAdd(aPtr,iOffset)==(T *)&iHead);}
1.570 +
1.571 +
1.572 +
1.573 +
1.574 +template <class T>
1.575 +inline TBool TDblQue<T>::IsFirst(const T *aPtr) const
1.576 +/**
1.577 +Tests whether the specified element is the first in the doubly linked list.
1.578 +
1.579 +@param aPtr A pointer to the element whose position in the list is to be checked.
1.580 +
1.581 +@return True, if the element is the first in the list; false, otherwise.
1.582 +*/
1.583 + {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iNext);}
1.584 +
1.585 +
1.586 +
1.587 +
1.588 +template <class T>
1.589 +inline TBool TDblQue<T>::IsLast(const T *aPtr) const
1.590 +/**
1.591 +Tests whether the specified element is the last in the doubly linked list.
1.592 +
1.593 +@param aPtr A pointer to the element whose position in the list is to be checked.
1.594 +
1.595 +@return True, if the element is the last in the list; false, otherwise.
1.596 +*/
1.597 + {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iPrev);}
1.598 +
1.599 +
1.600 +
1.601 +
1.602 +template <class T>
1.603 +inline T *TDblQue<T>::First() const
1.604 +/**
1.605 +Gets a pointer to the first list element in the doubly linked list.
1.606 +
1.607 +@return A pointer to the first list element in the doubly linked list. If
1.608 + the list is empty, this pointer is not necessarily NULL and must not
1.609 + be assumed to point to a valid object.
1.610 +*/
1.611 + {
1.612 +#if defined (_DEBUG)
1.613 + __DbgTestEmpty();
1.614 +#endif
1.615 + return(PtrSub((T *)iHead.iNext,iOffset));
1.616 + }
1.617 +
1.618 +
1.619 +
1.620 +
1.621 +template <class T>
1.622 +inline T *TDblQue<T>::Last() const
1.623 +/**
1.624 +Gets a pointer to the last list element in the doubly linked list.
1.625 +
1.626 +@return A pointer to the last list element in the doubly linked list. If the
1.627 + list is empty, this pointer is not necessarily NULL and must not be assumed
1.628 + to point to a valid object.
1.629 +*/
1.630 + {
1.631 +#if defined (_DEBUG)
1.632 + __DbgTestEmpty();
1.633 +#endif
1.634 + return(PtrSub((T *)iHead.iPrev,iOffset));
1.635 + }
1.636 +
1.637 +
1.638 +
1.639 +
1.640 +// Class TPriQue
1.641 +template <class T>
1.642 +inline TPriQue<T>::TPriQue()
1.643 +/**
1.644 +Default constructor.
1.645 +
1.646 +Constructs an empty list header and sets the offset value of the link
1.647 +object to zero.
1.648 +
1.649 +In practice, never assume that the offset of the link object from the start
1.650 +of a list element is zero, even if the link object is declared as the first
1.651 +data member in the list element class.
1.652 +
1.653 +If this default constructor is used, then call the SetOffset() function of
1.654 +the base class to ensure that the offset value is set correctly.
1.655 +
1.656 +@see TDblQueBase::SetOffset
1.657 +*/
1.658 + {}
1.659 +
1.660 +
1.661 +
1.662 +
1.663 +template <class T>
1.664 +inline TPriQue<T>::TPriQue(TInt aOffset)
1.665 + : TDblQueBase(aOffset)
1.666 +/**
1.667 +Constructs an empty list header and sets the offset of the link object
1.668 +to the specified value.
1.669 +
1.670 +@param aOffset The offset of the link object from the start of a list element.
1.671 + The macro _FOFF can be used to calculate this value.
1.672 +
1.673 +@panic USER 78 if aOffset is not divisible by four.
1.674 +*/
1.675 + {}
1.676 +
1.677 +
1.678 +
1.679 +
1.680 +template <class T>
1.681 +inline void TPriQue<T>::Add(T &aRef)
1.682 +/**
1.683 +Inserts the specified list element in descending priority order.
1.684 +
1.685 +If there is an existing list element with the same priority, then the new
1.686 +element is added after the existing element.
1.687 +
1.688 +@param aRef The list element to be inserted.
1.689 +*/
1.690 + {DoAddPriority(&aRef);}
1.691 +
1.692 +
1.693 +
1.694 +
1.695 +template <class T>
1.696 +inline TBool TPriQue<T>::IsHead(const T *aPtr) const
1.697 +/**
1.698 +Tests whether the end of a list has been reached.
1.699 +
1.700 +A doubly linked list is circular; in following the chain of elements in a list
1.701 +(e.g. using the iterator operator++ or operator--), the chain eventually
1.702 +reaches the end of the list and aPtr corresponds to the header (although it
1.703 +will not point to a valid T object).
1.704 +
1.705 +@param aPtr The pointer value to be checked.
1.706 +
1.707 +@return True, if the end of the list has been reached. False, if the end of the
1.708 + list has not been reached; aPtr points to an element in the list.
1.709 +*/
1.710 + {return(PtrAdd(aPtr,iOffset)==(T *)&iHead);}
1.711 +
1.712 +
1.713 +
1.714 +
1.715 +template <class T>
1.716 +inline TBool TPriQue<T>::IsFirst(const T *aPtr) const
1.717 +/**
1.718 +Tests whether the specified element is the first in the linked list.
1.719 +
1.720 +@param aPtr A pointer to the element whose position in the list is to
1.721 + be checked.
1.722 +
1.723 +@return True, if the element is the first in the list; false, otherwise.
1.724 +*/
1.725 + {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iNext);}
1.726 +
1.727 +
1.728 +
1.729 +
1.730 +template <class T>
1.731 +inline TBool TPriQue<T>::IsLast(const T *aPtr) const
1.732 +/**
1.733 +Tests whether the specified element is the last in the linked list.
1.734 +
1.735 +@param aPtr A pointer to the element whose position in the list is to
1.736 + be checked.
1.737 +
1.738 +@return True, if the element is the last in the list; false, otherwise.
1.739 +*/
1.740 + {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iPrev);}
1.741 +
1.742 +
1.743 +
1.744 +
1.745 +template <class T>
1.746 +inline T *TPriQue<T>::First() const
1.747 +/**
1.748 +Gets a pointer to the first list element in the linked list.
1.749 +
1.750 +@return A pointer to the first list element in the linked list.
1.751 + If the list is empty, this pointer is not necessarily NULL and must
1.752 + not be assumed to point to a valid object.
1.753 +*/
1.754 + {return(PtrSub((T *)iHead.iNext,iOffset));}
1.755 +
1.756 +
1.757 +
1.758 +
1.759 +template <class T>
1.760 +inline T *TPriQue<T>::Last() const
1.761 +/**
1.762 +Gets a pointer to the last list element in the linked list.
1.763 +
1.764 +@return A pointer to the last list element in the linked list.
1.765 + If the list is empty, this pointer is not necessarily NULL and must
1.766 + not be assumed to point to a valid object.
1.767 +*/
1.768 + {return(PtrSub((T *)iHead.iPrev,iOffset));}
1.769 +
1.770 +
1.771 +
1.772 +
1.773 +// Class TDeltaQue
1.774 +template <class T>
1.775 +inline TDeltaQue<T>::TDeltaQue()
1.776 +/**
1.777 +Constructs an empty list header and sets the offset value of the link object
1.778 +to zero.
1.779 +
1.780 +In practice, never assume that the offset of the link object from the start
1.781 +of a list element is zero, even if the link object is declared as the first
1.782 +data member in the list element class.
1.783 +
1.784 +If this default constructor is used, then call the TDblQueBase::SetOffset()
1.785 +function in the base class to ensure that the offset value is set correctly.
1.786 +
1.787 +TDeltaQueBase::iFirstDelta is set to NULL.
1.788 +
1.789 +@see TDblQueBase::SetOffset
1.790 +*/
1.791 + {}
1.792 +
1.793 +
1.794 +
1.795 +
1.796 +template <class T>
1.797 +inline TDeltaQue<T>::TDeltaQue(TInt aOffset)
1.798 + : TDeltaQueBase(aOffset)
1.799 +/**
1.800 +Constructs an empty list header and sets the offset of the link object to the
1.801 +specified value.
1.802 +
1.803 +TDeltaQueBase::iFirstDelta is set to NULL.
1.804 +
1.805 +@param aOffset The offset of the link object from the start of a list element.
1.806 + The macro _FOFF can be used to calculate this value.
1.807 +
1.808 +@panic USER 78, if aOffset is not divisible by four.
1.809 +
1.810 +@see _FOFF
1.811 +*/
1.812 + {}
1.813 +
1.814 +
1.815 +
1.816 +
1.817 +template <class T>
1.818 +inline void TDeltaQue<T>::Add(T &aRef,TInt aDelta)
1.819 +/**
1.820 +Adds the specified list element, having the specified 'distance' from the
1.821 +nominal zero point, into the list.
1.822 +
1.823 +The element is added into the list, the adjacent delta values adjusted, and
1.824 +a suitable delta value assigned to the new element, so that the new element
1.825 +is at the specified 'distance' from the nominal zero point.
1.826 +
1.827 +@param aRef The list element to be inserted.
1.828 +@param aDelta The 'distance' from the nominal zero point.
1.829 +*/
1.830 + {DoAddDelta(&aRef,aDelta);}
1.831 +
1.832 +
1.833 +
1.834 +
1.835 +template <class T>
1.836 +inline void TDeltaQue<T>::Remove(T &aRef)
1.837 +/**
1.838 +Removes the specified list element from the linked list.
1.839 +
1.840 +The delta value of the element following the removed element is adjusted
1.841 +so that its 'distance' from the nominal zero point remains the same.
1.842 +
1.843 +@param aRef The list element to be removed.
1.844 +*/
1.845 + {DoRemove(&aRef);}
1.846 +
1.847 +
1.848 +
1.849 +
1.850 +template <class T>
1.851 +inline T *TDeltaQue<T>::RemoveFirst()
1.852 +/**
1.853 +Removes the first list element from the linked list if its delta value is zero
1.854 +or negative.
1.855 +
1.856 +@return A pointer to the element removed from the linked list. This is NULL,
1.857 + if the first element has a positive delta value.
1.858 +*/
1.859 + {return((T *) DoRemoveFirst());}
1.860 +
1.861 +
1.862 +
1.863 +
1.864 +// Class TSglQueIter
1.865 +template <class T>
1.866 +inline TSglQueIter<T>::TSglQueIter(TSglQueBase &aQue)
1.867 + : TSglQueIterBase(aQue)
1.868 +/**
1.869 +Constructs the iterator for the specified singly linked list.
1.870 +
1.871 +The iterator can be constructed whether or not the list contains any elements.
1.872 +
1.873 +If the list does contain elements, the iterator pointer is set to the first one.
1.874 +
1.875 +If the list has no elements, the iterator pointer is not set and the conversion
1.876 +operator T*() and the post increment operator ++ subsequently return NULL.
1.877 +Once elements have been added to the list, use either the
1.878 +TSglQueIter::Set() function or the TSglQueIterBase::SetToFirst() function to set the
1.879 +iterator pointer.
1.880 +
1.881 +@param aQue A reference to a singly linked list header.
1.882 +
1.883 +@see TSglQueIter::Set
1.884 +@see TSglQueIterBase::SetToFirst
1.885 +*/
1.886 + {}
1.887 +
1.888 +
1.889 +
1.890 +
1.891 +template <class T>
1.892 +inline void TSglQueIter<T>::Set(T &aLink)
1.893 +/**
1.894 +Sets the iterator to point to a specific element in the list.
1.895 +
1.896 +This function can be used to alter the pointer at any time during the iterator's
1.897 +existence. The referenced element must be in the list, otherwise the result
1.898 +is undefined.
1.899 +
1.900 +@param aLink A reference to the element from where iteration is to continue.
1.901 +*/
1.902 + {DoSet(&aLink);}
1.903 +
1.904 +
1.905 +
1.906 +
1.907 +template <class T>
1.908 +inline TSglQueIter<T>::operator T *()
1.909 +/**
1.910 +Gets a pointer to the iterator’s current element.
1.911 +
1.912 +The operator is normally used implicitly; e.g. some member functions of the
1.913 +list header class TSglQue require a pointer to an element (of type class T)
1.914 +as a parameter, but in practice an iterator is often passed instead.
1.915 +This operator performs the necessary conversion.
1.916 +*/
1.917 + {return((T *)DoCurrent());}
1.918 +
1.919 +
1.920 +
1.921 +
1.922 +template <class T>
1.923 +inline T *TSglQueIter<T>::operator++(TInt)
1.924 +/**
1.925 +Gets a pointer to the iterator's current element and then sets the iterator
1.926 +to point to the next element.
1.927 +
1.928 +Repeated use of this operator allows successive elements to be accessed.
1.929 +
1.930 +@return A pointer to the current list element, if the iterator points to an
1.931 + element. NULL, if the iterator does not point to an element; i.e. the
1.932 + iterator pointer has reached the end of the list.
1.933 +*/
1.934 + {return((T *)DoPostInc());}
1.935 +
1.936 +
1.937 +
1.938 +
1.939 +// Class TDblQueIter
1.940 +template <class T>
1.941 +inline TDblQueIter<T>::TDblQueIter(TDblQueBase &aQue)
1.942 + : TDblQueIterBase(aQue)
1.943 +/**
1.944 +Constructs the iterator for the specified doubly linked list
1.945 +
1.946 +The iterator can be constructed whether or not the list contains any elements.
1.947 +
1.948 +If the list does contain elements, the iterator pointer is set to the first one.
1.949 +
1.950 +If the list has no elements, the iterator pointer is not set and the conversion
1.951 +operator T*(), the post increment operator++() and the post decrement operator
1.952 +--() subsequently return NULL. Once elements have been added to the list, use
1.953 +either the TDblQueIter::Set() function, the TDblQueIterBase::SetToFirst()
1.954 +function or the TDblQueIterBase::SetToLast() function to set the iterator
1.955 +pointer.
1.956 +
1.957 +@param aQue A reference to a doubly linked list header.
1.958 +
1.959 +@see TDblQueIter::Set
1.960 +@see TDblQueIterBase::SetToFirst
1.961 +@see TDblQueIterBase::SetToLast
1.962 +*/
1.963 + {}
1.964 +
1.965 +
1.966 +
1.967 +
1.968 +template <class T>
1.969 +inline void TDblQueIter<T>::Set(T &aLink)
1.970 +/**
1.971 +Sets the iterator to point to a specific element in the list.
1.972 +
1.973 +This function can be used to alter the pointer at any time during
1.974 +the iterator's existence. The referenced element must be in the list,
1.975 +otherwise the result is undefined.
1.976 +
1.977 +@param aLink A reference to the element from where iteration is to continue.
1.978 +*/
1.979 + {DoSet(&aLink);}
1.980 +
1.981 +
1.982 +
1.983 +
1.984 +template <class T>
1.985 +inline TDblQueIter<T>::operator T *()
1.986 +/**
1.987 +Gets a pointer to the iterator’s current element.
1.988 +
1.989 +The operator is normally used implicitly; e.g. some member functions of the
1.990 +list header class TDblQue require a pointer to an element (of type class T)
1.991 +as a parameter but in practice, an iterator is often passed instead.
1.992 +This operator performs the necessary conversion.
1.993 +
1.994 +@return A pointer to the current element, if the iterator points to an element
1.995 + in the list. NULL, if the iterator does not point to an element;
1.996 + i.e. the iterator pointer has previously reached the end of the list
1.997 + (see operator++) or the start of the list (see operator--) or
1.998 + the list is empty.
1.999 +*/
1.1000 + {return((T *) DoCurrent());}
1.1001 +
1.1002 +
1.1003 +
1.1004 +
1.1005 +template <class T>
1.1006 +inline T *TDblQueIter<T>::operator++(TInt)
1.1007 +/**
1.1008 +Gets a pointer to the iterator's current element and then sets the iterator
1.1009 +to point to the next element.
1.1010 +
1.1011 +Repeated use of this operator allows successive
1.1012 +elements to be accessed in the forwards direction.
1.1013 +
1.1014 +@return A pointer to the current list element, if the iterator points to an
1.1015 + element. NULL, if the iterator does not point to an element;
1.1016 + i.e. the iterator pointer has reached the end of the list.
1.1017 +*/
1.1018 + {return((T *) DoPostInc());}
1.1019 +
1.1020 +
1.1021 +
1.1022 +
1.1023 +template <class T>
1.1024 +inline T *TDblQueIter<T>::operator--(TInt)
1.1025 +/**
1.1026 +Gets a pointer to the iterator's current element and then sets the iterator
1.1027 +to point to the previous element.
1.1028 +
1.1029 +Repeated use of this operator allows successive
1.1030 +elements to be accessed in the backwards direction.
1.1031 +
1.1032 +@return A pointer to the current element, if the iterator points to an element.
1.1033 + NULL, if the iterator does not point to an element; i.e. the iterator
1.1034 + pointer has reached the beginning of the list.
1.1035 +*/
1.1036 + {return((T *) DoPostDec());}
1.1037 +
1.1038 +
1.1039 +
1.1040 +
1.1041 +// Class TKey
1.1042 +inline void TKey::SetPtr(const TAny *aPtr)
1.1043 +/**
1.1044 +Sets the pointer to a sample element whose key is to be used for comparison.
1.1045 +
1.1046 +The element can be in an existing array or it can be located anywhere in
1.1047 +addressable memory.
1.1048 +
1.1049 +The At() member function supplied by a derived class must return a pointer
1.1050 +to this sample element's key when passed an index value of KIndexPtr.
1.1051 +
1.1052 +SetPtr() must be called before calling User::BinarySearch() because this algorithm
1.1053 +uses the key of this sample element as the basis for searching the array.
1.1054 +
1.1055 +@param aPtr A pointer to a sample element.
1.1056 +*/
1.1057 + {iPtr=aPtr;}
1.1058 +
1.1059 +
1.1060 +
1.1061 +
1.1062 +// Class TCharF
1.1063 +inline TCharF::TCharF(TUint aChar)
1.1064 + : TChar(User::Fold(aChar))
1.1065 +/**
1.1066 +Constructs this 'fold character' object and initialises it with the specified
1.1067 +value.
1.1068 +
1.1069 +@param aChar The initialisation value.
1.1070 +*/
1.1071 + {}
1.1072 +
1.1073 +
1.1074 +
1.1075 +
1.1076 +inline TCharF::TCharF(const TChar& aChar)
1.1077 + : TChar(User::Fold(aChar))
1.1078 +/**
1.1079 +Constructs this 'fold character' object and initialises it with the value of
1.1080 +the TChar object aChar.
1.1081 +
1.1082 +@param aChar The character object to use as the initialisation value.
1.1083 +*/
1.1084 + {}
1.1085 +
1.1086 +
1.1087 +
1.1088 +
1.1089 +inline TCharF& TCharF::operator=(TUint aChar)
1.1090 +/**
1.1091 +Assigns an unsigned integer value to the 'fold character' object.
1.1092 +
1.1093 +@param aChar The value to assign.
1.1094 +
1.1095 +@return A reference to this 'fold character' object.
1.1096 +*/
1.1097 + {SetChar(User::Fold(aChar));return(*this);}
1.1098 +
1.1099 +
1.1100 +
1.1101 +
1.1102 +inline TCharF& TCharF::operator=(const TChar& aChar)
1.1103 +/**
1.1104 +Assigns the specified character object to this 'fold character' object.
1.1105 +
1.1106 +@param aChar The character object to assign.
1.1107 +
1.1108 +@return A reference to this 'fold character' object.
1.1109 +*/
1.1110 + {SetChar(User::Fold(aChar));return(*this);}
1.1111 +
1.1112 +
1.1113 +
1.1114 +
1.1115 +// Class TCharLC
1.1116 +inline TCharLC::TCharLC(TUint aChar)
1.1117 + : TChar(User::LowerCase(aChar))
1.1118 +/**
1.1119 +Constructs this 'character to lower case' object and initialises it with the
1.1120 +specified value.
1.1121 +
1.1122 +@param aChar The initialisation value.
1.1123 +
1.1124 +*/
1.1125 + {}
1.1126 +
1.1127 +
1.1128 +
1.1129 +
1.1130 +inline TCharLC::TCharLC(const TChar& aChar)
1.1131 + : TChar(User::LowerCase(aChar))
1.1132 +/**
1.1133 +Constructs this 'character to lower case' object and initialises it with the
1.1134 +value of the TChar object aChar.
1.1135 +
1.1136 +@param aChar The character object to use as the initialisation value.
1.1137 +*/
1.1138 + {}
1.1139 +
1.1140 +
1.1141 +
1.1142 +
1.1143 +inline TCharLC& TCharLC::operator=(TUint aChar)
1.1144 +/**
1.1145 +Assigns an unsigned integer value to the 'character to lower case' object.
1.1146 +
1.1147 +@param aChar The value to assign.
1.1148 +
1.1149 +@return A reference to this 'character to lower case' object.
1.1150 +*/
1.1151 + {SetChar(User::LowerCase(aChar));return(*this);}
1.1152 +
1.1153 +
1.1154 +
1.1155 +
1.1156 +inline TCharLC& TCharLC::operator=(const TChar& aChar)
1.1157 +/**
1.1158 +Assigns the specified character object to this 'character to lower case'
1.1159 +object.
1.1160 +
1.1161 +@param aChar The character object to assign.
1.1162 +
1.1163 +@return A reference to this 'character to lower case' object.
1.1164 +*/
1.1165 + {SetChar(User::LowerCase(aChar));return(*this);}
1.1166 +
1.1167 +
1.1168 +
1.1169 +
1.1170 +// Class TCharUC
1.1171 +inline TCharUC::TCharUC(TUint aChar)
1.1172 + : TChar(User::UpperCase(aChar))
1.1173 +/**
1.1174 +Constructs this 'character to upper case' object and initialises it with the
1.1175 +specified value.
1.1176 +
1.1177 +@param aChar The initialisation value.
1.1178 +*/
1.1179 + {}
1.1180 +
1.1181 +
1.1182 +
1.1183 +
1.1184 +inline TCharUC::TCharUC(const TChar& aChar)
1.1185 + : TChar(User::UpperCase(aChar))
1.1186 +/**
1.1187 +Constructs this 'character to upper case' object and initialises it with the
1.1188 +value of the TChar object aChar.
1.1189 +
1.1190 +@param aChar The character object to use as the initialisation value.
1.1191 +*/
1.1192 + {}
1.1193 +
1.1194 +
1.1195 +
1.1196 +
1.1197 +inline TCharUC& TCharUC::operator=(TUint aChar)
1.1198 +/**
1.1199 +Assigns an unsigned integer value to the 'character to upper case' object.
1.1200 +
1.1201 +@param aChar The value to assign.
1.1202 +
1.1203 +@return A reference to this 'character to upper case' object.
1.1204 +*/
1.1205 + {SetChar(User::UpperCase(aChar));return(*this);}
1.1206 +
1.1207 +
1.1208 +
1.1209 +
1.1210 +inline TCharUC& TCharUC::operator=(const TChar& aChar)
1.1211 +/**
1.1212 +Assigns the specified character object to this 'character to upper case'
1.1213 +object.
1.1214 +
1.1215 +@param aChar The character object to assign.
1.1216 +
1.1217 +@return A reference to this 'character to upper case' object.
1.1218 +*/
1.1219 + {SetChar(User::UpperCase(aChar));return(*this);}
1.1220 +
1.1221 +
1.1222 +
1.1223 +
1.1224 +// Class TDateTime
1.1225 +inline TDateTime::TDateTime()
1.1226 + : iYear(1980),
1.1227 + iMonth(EJanuary),
1.1228 + iDay(1),
1.1229 + iHour(0),
1.1230 + iMinute(0),
1.1231 + iSecond(0),
1.1232 + iMicroSecond(0)
1.1233 +/**
1.1234 +Constructs an uninitialised TDateTime object.
1.1235 +*/
1.1236 + {}
1.1237 +
1.1238 +
1.1239 +
1.1240 +
1.1241 +inline TInt TDateTime::Year() const
1.1242 +/**
1.1243 +Gets the year component of the date/time.
1.1244 +
1.1245 +A negative value indicates a BC date.
1.1246 +
1.1247 +@return The year
1.1248 +*/
1.1249 + {return(iYear);}
1.1250 +
1.1251 +
1.1252 +
1.1253 +
1.1254 +inline TMonth TDateTime::Month() const
1.1255 +/**
1.1256 +Gets the month component of the date/time.
1.1257 +
1.1258 +@return The month. EJanuary to EDecember. Offset from zero, so add one before
1.1259 + displaying the month number.
1.1260 +*/
1.1261 + {return(iMonth);}
1.1262 +
1.1263 +
1.1264 +
1.1265 +
1.1266 +inline TInt TDateTime::Day() const
1.1267 +/**
1.1268 +Gets the day component of the date/time.
1.1269 +
1.1270 +@return The day. Offset from zero, so add one before displaying the day number.
1.1271 +*/
1.1272 + {return(iDay);}
1.1273 +
1.1274 +
1.1275 +
1.1276 +
1.1277 +inline TInt TDateTime::Hour() const
1.1278 +/**
1.1279 +Gets the hour component of the date/time.
1.1280 +
1.1281 +@return The hour.
1.1282 +*/
1.1283 + {return(iHour);}
1.1284 +
1.1285 +
1.1286 +
1.1287 +
1.1288 +inline TInt TDateTime::Minute() const
1.1289 +/**
1.1290 +Gets the minute component of the date/time.
1.1291 +
1.1292 +@return The minute.
1.1293 +*/
1.1294 + {return(iMinute);}
1.1295 +
1.1296 +
1.1297 +
1.1298 +
1.1299 +inline TInt TDateTime::Second() const
1.1300 +/**
1.1301 +Gets the second component of the date/time.
1.1302 +
1.1303 +@return The second.
1.1304 +*/
1.1305 + {return(iSecond);}
1.1306 +
1.1307 +
1.1308 +
1.1309 +
1.1310 +inline TInt TDateTime::MicroSecond() const
1.1311 +/**
1.1312 +Gets the microsecond component of the date/time.
1.1313 +
1.1314 +@return The microsecond.
1.1315 +*/
1.1316 + {return(iMicroSecond);}
1.1317 +
1.1318 +// Class TTimeIntervalMicroSeconds
1.1319 +
1.1320 +
1.1321 +
1.1322 +
1.1323 +inline TTimeIntervalMicroSeconds::TTimeIntervalMicroSeconds()
1.1324 +/**
1.1325 +Default constructor.
1.1326 +
1.1327 +Constructs an uninitialised object.
1.1328 +*/
1.1329 + {}
1.1330 +
1.1331 +
1.1332 +
1.1333 +
1.1334 +inline TTimeIntervalMicroSeconds::TTimeIntervalMicroSeconds(const TInt64& aInterval)
1.1335 + : iInterval(aInterval)
1.1336 +/**
1.1337 +Constructs the object with the specified 64-bit interval value.
1.1338 +
1.1339 +@param aInterval The 64-bit interval value with which the object is to be
1.1340 + initialised.
1.1341 +*/
1.1342 + {}
1.1343 +
1.1344 +
1.1345 +
1.1346 +
1.1347 +inline TTimeIntervalMicroSeconds& TTimeIntervalMicroSeconds::operator=(const TInt64& aInterval)
1.1348 +/**
1.1349 +Assigns a 64-bit integer value to this object.
1.1350 +
1.1351 +@param aInterval The 64-bit integer interval value to be assigned.
1.1352 +
1.1353 +@return A reference to this object.
1.1354 +*/
1.1355 + {iInterval=aInterval;return(*this);}
1.1356 +
1.1357 +
1.1358 +
1.1359 +
1.1360 +inline TBool TTimeIntervalMicroSeconds::operator==(const TTimeIntervalMicroSeconds& aInterval) const
1.1361 +/**
1.1362 +Tests whether this TTimeIntervalMicroSeconds object is equal to the
1.1363 +specified TTimeIntervalMicroSeconds object.
1.1364 +
1.1365 +@param aInterval The time interval to be compared with this time interval.
1.1366 +
1.1367 +@return True if the two time intervals are equal. False otherwise.
1.1368 +*/
1.1369 + {return(iInterval==aInterval.iInterval);}
1.1370 +
1.1371 +
1.1372 +
1.1373 +
1.1374 +inline TBool TTimeIntervalMicroSeconds::operator!=(const TTimeIntervalMicroSeconds& aInterval) const
1.1375 +/**
1.1376 +Tests whether this TTimeIntervalMicroSeconds object is not equal to the
1.1377 +specified TTimeIntervalMicroSeconds object.
1.1378 +
1.1379 +@param aInterval The time interval to be compared with this time interval.
1.1380 +
1.1381 +@return True if the two time intervals are not equal. False otherwise.
1.1382 +*/
1.1383 + {return(iInterval!=aInterval.iInterval);}
1.1384 +
1.1385 +
1.1386 +
1.1387 +
1.1388 +inline TBool TTimeIntervalMicroSeconds::operator>=(const TTimeIntervalMicroSeconds& aInterval) const
1.1389 +/**
1.1390 +Tests whether this TTimeIntervalMicroSeconds object is greater than or equal to the
1.1391 +specified TTimeIntervalMicroSeconds object.
1.1392 +
1.1393 +@param aInterval The time interval to be compared with this time interval.
1.1394 +
1.1395 +@return True if this time interval is greater than or equal to the specified
1.1396 + time interval. False otherwise.
1.1397 +*/
1.1398 + {return(iInterval>=aInterval.iInterval);}
1.1399 +
1.1400 +
1.1401 +
1.1402 +
1.1403 +inline TBool TTimeIntervalMicroSeconds::operator<=(const TTimeIntervalMicroSeconds& aInterval) const
1.1404 +/**
1.1405 +Tests whether this TTimeIntervalMicroSeconds object is less than or equal to the
1.1406 +specified TTimeIntervalMicroSeconds object.
1.1407 +
1.1408 +@param aInterval The time interval to be compared with this time interval.
1.1409 +
1.1410 +@return True if this time interval is less than or equal to the specified
1.1411 + time interval. False otherwise.
1.1412 +*/
1.1413 + {return(iInterval<=aInterval.iInterval);}
1.1414 +
1.1415 +
1.1416 +
1.1417 +
1.1418 +inline TBool TTimeIntervalMicroSeconds::operator>(const TTimeIntervalMicroSeconds& aInterval) const
1.1419 +/**
1.1420 +Tests whether this TTimeIntervalMicroSeconds object is greater than the
1.1421 +specified TTimeIntervalMicroSeconds object.
1.1422 +
1.1423 +@param aInterval The time interval to be compared with this time interval.
1.1424 +
1.1425 +@return True if this time interval is greater than the specified
1.1426 + time interval. False otherwise.
1.1427 +*/
1.1428 + {return(iInterval>aInterval.iInterval);}
1.1429 +
1.1430 +
1.1431 +
1.1432 +
1.1433 +inline TBool TTimeIntervalMicroSeconds::operator<(const TTimeIntervalMicroSeconds& aInterval) const
1.1434 +/**
1.1435 +Tests whether this TTimeIntervalMicroSeconds object is less than the
1.1436 +specified TTimeIntervalMicroSeconds object.
1.1437 +
1.1438 +@param aInterval The time interval to be compared with this time interval.
1.1439 +
1.1440 +@return True if this time interval is less than the specified
1.1441 + time interval. False otherwise.
1.1442 +*/
1.1443 + {return(iInterval<aInterval.iInterval);}
1.1444 +
1.1445 +
1.1446 +
1.1447 +
1.1448 +inline const TInt64& TTimeIntervalMicroSeconds::Int64() const
1.1449 +/**
1.1450 +Gets the time interval as a 64-bit integer value.
1.1451 +
1.1452 +@return This 64-bit integer time interval value.
1.1453 +*/
1.1454 + {return(iInterval);}
1.1455 +
1.1456 +
1.1457 +
1.1458 +
1.1459 +// Class TTimeIntervalBase
1.1460 +inline TTimeIntervalBase::TTimeIntervalBase()
1.1461 +/**
1.1462 +Default constructor.
1.1463 +*/
1.1464 + {}
1.1465 +
1.1466 +
1.1467 +
1.1468 +
1.1469 +inline TTimeIntervalBase::TTimeIntervalBase(TInt aInterval)
1.1470 + : iInterval(aInterval)
1.1471 +/**
1.1472 +Constructor taking an interval value.
1.1473 +
1.1474 +@param aInterval The interval value.
1.1475 +*/
1.1476 + {}
1.1477 +
1.1478 +
1.1479 +
1.1480 +
1.1481 +inline TBool TTimeIntervalBase::operator==(TTimeIntervalBase aInterval) const
1.1482 +/**
1.1483 +Tests whether this time interval is the same as the specified time interval.
1.1484 +
1.1485 +@param aInterval The time interval to be compared with this time interval.
1.1486 +
1.1487 +@return True if the two time intervals are equal. False otherwise.
1.1488 +*/
1.1489 + {return(iInterval==aInterval.iInterval);}
1.1490 +
1.1491 +
1.1492 +
1.1493 +
1.1494 +inline TBool TTimeIntervalBase::operator!=(TTimeIntervalBase aInterval) const
1.1495 +/**
1.1496 +Tests whether this time interval is not the same as the specified
1.1497 +time interval.
1.1498 +
1.1499 +@param aInterval The time interval to be compared with this time interval.
1.1500 +
1.1501 +@return True if the two time intervals differ. False otherwise.
1.1502 +*/
1.1503 + {return(iInterval!=aInterval.iInterval);}
1.1504 +
1.1505 +
1.1506 +
1.1507 +
1.1508 +inline TBool TTimeIntervalBase::operator>=(TTimeIntervalBase aInterval) const
1.1509 +/**
1.1510 +Tests whether this time interval is greater than or equal to the
1.1511 +specified time interval.
1.1512 +
1.1513 +@param aInterval The time interval to be compared with this time interval.
1.1514 +
1.1515 +@return True if this time interval is greater than or equal to the specified
1.1516 + time interval. False otherwise.
1.1517 +*/
1.1518 + {return(iInterval>=aInterval.iInterval);}
1.1519 +
1.1520 +
1.1521 +
1.1522 +
1.1523 +inline TBool TTimeIntervalBase::operator<=(TTimeIntervalBase aInterval) const
1.1524 +/**
1.1525 +Tests whether this time interval is less than or equal to the
1.1526 +specified time interval.
1.1527 +
1.1528 +@param aInterval The time interval to be compared with this time interval.
1.1529 +
1.1530 +@return True if this time interval is less than or equal to the specified
1.1531 + time interval. False otherwise.
1.1532 +*/
1.1533 + {return(iInterval<=aInterval.iInterval);}
1.1534 +
1.1535 +
1.1536 +
1.1537 +
1.1538 +inline TBool TTimeIntervalBase::operator>(TTimeIntervalBase aInterval) const
1.1539 +/**
1.1540 +Tests whether this time interval is greater than the specified time interval.
1.1541 +
1.1542 +@param aInterval The time interval to be compared with this time interval.
1.1543 +
1.1544 +@return True if this time interval is greater than the specified
1.1545 + time interval. False otherwise.
1.1546 +*/
1.1547 + {return(iInterval>aInterval.iInterval);}
1.1548 +
1.1549 +
1.1550 +
1.1551 +
1.1552 +inline TBool TTimeIntervalBase::operator<(TTimeIntervalBase aInterval) const
1.1553 +/**
1.1554 +Tests whether this time interval is less than the specified time interval.
1.1555 +
1.1556 +@param aInterval The time interval to be compared with this time interval.
1.1557 +
1.1558 +@return True if this time interval is less than the specified
1.1559 + time interval. False otherwise.
1.1560 +*/
1.1561 + {return(iInterval<aInterval.iInterval);}
1.1562 +
1.1563 +
1.1564 +
1.1565 +
1.1566 +inline TInt TTimeIntervalBase::Int() const
1.1567 +/**
1.1568 +Gets the time interval as a 32 bit integer.
1.1569 +
1.1570 +@return The time interval as a 32 bit integer.
1.1571 +*/
1.1572 + {return(iInterval);}
1.1573 +
1.1574 +
1.1575 +
1.1576 +
1.1577 +// Class TTimeIntervalMicroSeconds32
1.1578 +inline TTimeIntervalMicroSeconds32::TTimeIntervalMicroSeconds32()
1.1579 +/**
1.1580 +Default constructor.
1.1581 +
1.1582 +Constructs an uninitialised object.
1.1583 +*/
1.1584 + {}
1.1585 +
1.1586 +
1.1587 +
1.1588 +
1.1589 +inline TTimeIntervalMicroSeconds32::TTimeIntervalMicroSeconds32(TInt aInterval)
1.1590 + : TTimeIntervalBase(aInterval)
1.1591 +/**
1.1592 +Constructs the object with the specified interval value.
1.1593 +
1.1594 +@param aInterval The interval value with which the object is to be initialised.
1.1595 +*/
1.1596 + {}
1.1597 +
1.1598 +
1.1599 +
1.1600 +
1.1601 +inline TTimeIntervalMicroSeconds32& TTimeIntervalMicroSeconds32::operator=(TInt aInterval)
1.1602 +/**
1.1603 +Assigns a value to this object.
1.1604 +
1.1605 +@param aInterval The interval value to be assigned.
1.1606 +
1.1607 +@return A reference to this object.
1.1608 +*/
1.1609 + {iInterval=aInterval;return(*this);}
1.1610 +
1.1611 +
1.1612 +
1.1613 +
1.1614 +// Class TTimeIntervalSeconds
1.1615 +inline TTimeIntervalSeconds::TTimeIntervalSeconds()
1.1616 +/**
1.1617 +Default constructor.
1.1618 +
1.1619 +Constructs an uninitialised object.
1.1620 +*/
1.1621 + {}
1.1622 +
1.1623 +
1.1624 +
1.1625 +
1.1626 +inline TTimeIntervalSeconds::TTimeIntervalSeconds(TInt aInterval)
1.1627 + : TTimeIntervalBase(aInterval)
1.1628 +/**
1.1629 +Constructs the object with the specified interval value.
1.1630 +
1.1631 +@param aInterval The interval value with which the object is to be initialised.
1.1632 +*/
1.1633 + {}
1.1634 +
1.1635 +
1.1636 +
1.1637 +
1.1638 +inline TTimeIntervalSeconds& TTimeIntervalSeconds::operator=(TInt aInterval)
1.1639 +/**
1.1640 +Assigns a value to this object.
1.1641 +
1.1642 +@param aInterval The interval value to be assigned.
1.1643 +
1.1644 +@return A reference to this object.
1.1645 +*/
1.1646 + {iInterval=aInterval;return(*this);}
1.1647 +
1.1648 +
1.1649 +
1.1650 +
1.1651 +// Class TTimeIntervalMinutes
1.1652 +inline TTimeIntervalMinutes::TTimeIntervalMinutes()
1.1653 +/**
1.1654 +Default constructor.
1.1655 +
1.1656 +Constructs an uninitialised object.
1.1657 +*/
1.1658 + {}
1.1659 +
1.1660 +
1.1661 +
1.1662 +
1.1663 +inline TTimeIntervalMinutes::TTimeIntervalMinutes(TInt aInterval)
1.1664 + : TTimeIntervalBase(aInterval)
1.1665 +/**
1.1666 +Constructs the object with the specified interval value.
1.1667 +
1.1668 +@param aInterval The interval value with which the object is to be initialised.
1.1669 +*/
1.1670 + {}
1.1671 +
1.1672 +
1.1673 +
1.1674 +
1.1675 +inline TTimeIntervalMinutes& TTimeIntervalMinutes::operator=(TInt aInterval)
1.1676 +/**
1.1677 +Assigns a value to this object.
1.1678 +
1.1679 +@param aInterval The interval value to be assigned.
1.1680 +
1.1681 +@return A reference to this object.
1.1682 +*/
1.1683 + {iInterval=aInterval;return(*this);}
1.1684 +
1.1685 +
1.1686 +
1.1687 +
1.1688 +// Class TTimeIntervalHours
1.1689 +inline TTimeIntervalHours::TTimeIntervalHours()
1.1690 +/**
1.1691 +Default constructor.
1.1692 +
1.1693 +Constructs an uninitialised object.
1.1694 +*/
1.1695 + {}
1.1696 +inline TTimeIntervalHours::TTimeIntervalHours(TInt aInterval)
1.1697 + : TTimeIntervalBase(aInterval)
1.1698 +/**
1.1699 +Constructs the object with the specified interval value.
1.1700 +
1.1701 +@param aInterval The interval value with which the object is to be initialised.
1.1702 +*/
1.1703 + {}
1.1704 +
1.1705 +
1.1706 +
1.1707 +
1.1708 +inline TTimeIntervalHours& TTimeIntervalHours::operator=(TInt aInterval)
1.1709 +/**
1.1710 +Assigns a value to this object.
1.1711 +
1.1712 +@param aInterval The interval value to be assigned.
1.1713 +
1.1714 +@return A reference to this object.
1.1715 +*/
1.1716 + {iInterval=aInterval;return(*this);}
1.1717 +
1.1718 +
1.1719 +
1.1720 +
1.1721 +// Class TTimeIntervalDays
1.1722 +inline TTimeIntervalDays::TTimeIntervalDays()
1.1723 +/**
1.1724 +Default constructor.
1.1725 +
1.1726 +Constructs an uninitialised object.
1.1727 +*/
1.1728 + {}
1.1729 +
1.1730 +
1.1731 +
1.1732 +
1.1733 +inline TTimeIntervalDays::TTimeIntervalDays(TInt aInterval)
1.1734 + : TTimeIntervalBase(aInterval)
1.1735 +/**
1.1736 +Constructs the object with the specified interval value.
1.1737 +
1.1738 +@param aInterval The interval value with which the object is to be initialised.
1.1739 +*/
1.1740 + {}
1.1741 +
1.1742 +
1.1743 +
1.1744 +
1.1745 +inline TTimeIntervalDays& TTimeIntervalDays::operator=(TInt aInterval)
1.1746 +/**
1.1747 +Assigns a value to this object.
1.1748 +
1.1749 +@param aInterval The interval value to be assigned.
1.1750 +
1.1751 +@return A reference to this object.
1.1752 +*/
1.1753 + {iInterval=aInterval;return(*this);}
1.1754 +
1.1755 +
1.1756 +
1.1757 +
1.1758 +// Class TTimeIntervalMonths
1.1759 +inline TTimeIntervalMonths::TTimeIntervalMonths()
1.1760 +/**
1.1761 +Default constructor.
1.1762 +
1.1763 +Constructs an uninitialised object.
1.1764 +*/
1.1765 + {}
1.1766 +
1.1767 +
1.1768 +
1.1769 +
1.1770 +inline TTimeIntervalMonths::TTimeIntervalMonths(TInt aInterval)
1.1771 + : TTimeIntervalBase(aInterval)
1.1772 +/**
1.1773 +Constructs the object with the specified interval value.
1.1774 +
1.1775 +@param aInterval The interval value with which the object is to be initialised.
1.1776 +*/
1.1777 + {}
1.1778 +
1.1779 +
1.1780 +
1.1781 +
1.1782 +inline TTimeIntervalMonths& TTimeIntervalMonths::operator=(TInt aInterval)
1.1783 +/**
1.1784 +Assigns a value to this object.
1.1785 +
1.1786 +@param aInterval The interval value to be assigned.
1.1787 +
1.1788 +@return A reference to this object.
1.1789 +*/
1.1790 + {iInterval=aInterval;return(*this);}
1.1791 +
1.1792 +
1.1793 +
1.1794 +
1.1795 +// Class TTimeIntervalYears
1.1796 +inline TTimeIntervalYears::TTimeIntervalYears()
1.1797 +/**
1.1798 +Default constructor.
1.1799 +
1.1800 +Constructs an uninitialised object.
1.1801 +*/
1.1802 + {}
1.1803 +
1.1804 +
1.1805 +
1.1806 +
1.1807 +inline TTimeIntervalYears::TTimeIntervalYears(TInt aInterval)
1.1808 + : TTimeIntervalBase(aInterval)
1.1809 +/**
1.1810 +Constructs the object with the specified interval value.
1.1811 +
1.1812 +@param aInterval The interval value with which the object is to be initialised.
1.1813 +*/
1.1814 + {}
1.1815 +
1.1816 +
1.1817 +
1.1818 +
1.1819 +inline TTimeIntervalYears& TTimeIntervalYears::operator=(TInt aInterval)
1.1820 +/**
1.1821 +Assigns a value to this object.
1.1822 +
1.1823 +@param aInterval The interval value to be assigned.
1.1824 +
1.1825 +@return A reference to this object.
1.1826 +*/
1.1827 + {iInterval=aInterval;return(*this);}
1.1828 +
1.1829 +
1.1830 +
1.1831 +
1.1832 +// Class TTime
1.1833 +inline TTime::TTime()
1.1834 +/**
1.1835 +Default constructor.
1.1836 +
1.1837 +The object is initialised to an arbitrary value.
1.1838 +*/
1.1839 + {}
1.1840 +
1.1841 +
1.1842 +
1.1843 +
1.1844 +inline TTime::TTime(const TInt64& aTime)
1.1845 + : iTime(aTime)
1.1846 +/**
1.1847 +Constructs the object from a 64-bit microsecond value.
1.1848 +
1.1849 +@param aTime Microsecond value to which to initialise the TTime object.
1.1850 +*/
1.1851 + {}
1.1852 +
1.1853 +
1.1854 +
1.1855 +
1.1856 +inline TTime &TTime::operator=(const TInt64& aTime)
1.1857 +/**
1.1858 +Assigns a value contained in a 64-bit integer to this TTime object.
1.1859 +
1.1860 +@param aTime Microsecond value which to assign to the TTime object.
1.1861 +
1.1862 +@return This TTime object.
1.1863 +*/
1.1864 + {iTime=aTime;return(*this);}
1.1865 +
1.1866 +
1.1867 +
1.1868 +
1.1869 +inline TBool TTime::operator==(TTime aTime) const
1.1870 +/**
1.1871 +Tests whether two date/times are equal.
1.1872 +
1.1873 +@param aTime The time to be compared with this TTime.
1.1874 +
1.1875 +@return True if the two TTimes are equal. False if not.
1.1876 +*/
1.1877 + {return(iTime==aTime.iTime);}
1.1878 +
1.1879 +
1.1880 +
1.1881 +
1.1882 +inline TBool TTime::operator!=(TTime aTime) const
1.1883 +/**
1.1884 +Tests whether two date/times are not equal.
1.1885 +
1.1886 +@param aTime The date/time to be compared with this TTime.
1.1887 +
1.1888 +@return True if the two TTimes are different. False if the same.
1.1889 +*/
1.1890 + {return(iTime!=aTime.iTime);}
1.1891 +
1.1892 +
1.1893 +
1.1894 +
1.1895 +inline TBool TTime::operator>=(TTime aTime) const
1.1896 +/**
1.1897 +Tests whether this date/time is later than or the same as the
1.1898 +specified date/time.
1.1899 +
1.1900 +@param aTime The date/time to be compared with this date/time.
1.1901 +
1.1902 +@return True if this date/time is later than or the same as the
1.1903 + specified date/time. False otherwise.
1.1904 +*/
1.1905 + {return(iTime>=aTime.iTime);}
1.1906 +
1.1907 +
1.1908 +
1.1909 +
1.1910 +inline TBool TTime::operator<=(TTime aTime) const
1.1911 +/**
1.1912 +Tests whether this date/time is earlier than or the same as the
1.1913 +specified date/time.
1.1914 +
1.1915 +@param aTime The date/time to be compared with this date/time.
1.1916 +
1.1917 +@return True if this date/time is earlier than or the same as the
1.1918 + specified date/time. False otherwise.
1.1919 +*/
1.1920 + {return(iTime<=aTime.iTime);}
1.1921 +
1.1922 +
1.1923 +
1.1924 +
1.1925 +inline TBool TTime::operator>(TTime aTime) const
1.1926 +/**
1.1927 +Tests whether this date/time is later than the specified date/time.
1.1928 +
1.1929 +@param aTime The date/time to be compared with this date/time.
1.1930 +
1.1931 +@return True if this date/time is later than the specified date/time.
1.1932 + False otherwise.
1.1933 +*/
1.1934 + {return(iTime>aTime.iTime);}
1.1935 +
1.1936 +
1.1937 +
1.1938 +
1.1939 +inline TBool TTime::operator<(TTime aTime) const
1.1940 +/**
1.1941 +Tests whether this date/time is earlier than the specified date/time.
1.1942 +
1.1943 +@param aTime The date/time to be compared with this date/time.
1.1944 +
1.1945 +@return True if this date/time is earlier than the specified date/time.
1.1946 + False otherwise.
1.1947 +*/
1.1948 + {return(iTime<aTime.iTime);}
1.1949 +
1.1950 +
1.1951 +
1.1952 +
1.1953 +inline const TInt64& TTime::Int64() const
1.1954 +/**
1.1955 +Gets the 64 bit integer representation of this TTime obect.
1.1956 +
1.1957 +@return The 64 bit integer representation.
1.1958 +*/
1.1959 + {return(iTime);}
1.1960 +
1.1961 +
1.1962 +
1.1963 +
1.1964 +// Class TLexMark8
1.1965 +inline TLexMark8::TLexMark8()
1.1966 + : iPtr(NULL)
1.1967 +/**
1.1968 +Default constructor.
1.1969 +*/
1.1970 + {}
1.1971 +
1.1972 +
1.1973 +
1.1974 +
1.1975 +inline TLexMark8::TLexMark8(const TUint8 *aString)
1.1976 + : iPtr(aString)
1.1977 + {}
1.1978 +
1.1979 +
1.1980 +
1.1981 +
1.1982 +// Class TLex8
1.1983 +inline TLex8::TLex8(const TUint8 *aString)
1.1984 +/**
1.1985 +Constructs the object with a pointer to a string.
1.1986 +
1.1987 +The extraction mark and next character members are initialised to point
1.1988 +to the start of the string.
1.1989 +
1.1990 +@param aString String to be assigned.
1.1991 +*/
1.1992 + {Assign(TPtrC8(aString));}
1.1993 +
1.1994 +
1.1995 +
1.1996 +
1.1997 +inline TLex8::TLex8(const TDesC8 &aDes)
1.1998 +/**
1.1999 +Constructs the object with a descriptor.
1.2000 +
1.2001 +The extraction mark and next character
1.2002 +members are initialised to point to the start of the string.
1.2003 +
1.2004 +@param aDes Descriptor to be assigned by reference.
1.2005 +*/
1.2006 + {Assign(aDes);}
1.2007 +
1.2008 +
1.2009 +
1.2010 +
1.2011 +inline TLex8& TLex8::operator=(const TUint8* aString)
1.2012 +/**
1.2013 +Allows strings to be assigned to a TLex8.
1.2014 +
1.2015 +@param aString String to be assigned to the TLex8.
1.2016 +
1.2017 +@return TLex8 descriptor.
1.2018 +*/
1.2019 + {Assign(TPtrC8(aString));return(*this);}
1.2020 +
1.2021 +
1.2022 +
1.2023 +
1.2024 +inline TLex8& TLex8::operator=(const TDesC8& aBuf)
1.2025 +/**
1.2026 +Allows descriptors to be assigned to a TLex8.
1.2027 +
1.2028 +@param aBuf Descriptor to be assigned to the TLex8.
1.2029 +
1.2030 +@return TLex8 descriptor.
1.2031 +*/
1.2032 + {Assign(aBuf);return(*this);}
1.2033 +
1.2034 +
1.2035 +
1.2036 +
1.2037 +inline TBool TLex8::Eos() const
1.2038 +/**
1.2039 +Tests whether the next character position is at the end of the string.
1.2040 +
1.2041 +@return True if at end of string, false otherwise.
1.2042 +*/
1.2043 + {return(iNext==iEnd);}
1.2044 +
1.2045 +
1.2046 +
1.2047 +
1.2048 +inline void TLex8::Mark()
1.2049 +/**
1.2050 +Sets the TLex8's next character position to its extraction mark.
1.2051 +*/
1.2052 + {Mark(iMark);}
1.2053 +
1.2054 +
1.2055 +
1.2056 +
1.2057 +inline void TLex8::Mark(TLexMark8& aMark) const
1.2058 +/**
1.2059 +Sets the supplied extraction mark to the TLex8's next character position.
1.2060 +
1.2061 +@param aMark On return, this is set to the next character position.
1.2062 +*/
1.2063 + {aMark.iPtr=iNext;}
1.2064 +
1.2065 +
1.2066 +
1.2067 +
1.2068 +inline void TLex8::UnGetToMark()
1.2069 +/**
1.2070 +Sets the next character position to the current extraction mark position.
1.2071 +
1.2072 +@panic USER 63, if the extraction mark is before the start or beyond the end
1.2073 + of the string.
1.2074 +*/
1.2075 + {UnGetToMark(iMark);}
1.2076 +
1.2077 +
1.2078 +
1.2079 +
1.2080 +inline void TLex8::SkipAndMark(TInt aNumber)
1.2081 +/**
1.2082 +Moves the next character position a specified number of characters.
1.2083 +
1.2084 +@param aNumber Number of characters to skip.
1.2085 +
1.2086 +@panic USER 61, if the skip moves the next character position either to before
1.2087 + the start or beyond the end of the string.
1.2088 +*/
1.2089 + {SkipAndMark(aNumber,iMark);}
1.2090 +
1.2091 +
1.2092 +
1.2093 +
1.2094 +inline void TLex8::SkipSpaceAndMark()
1.2095 +/**
1.2096 +Moves the next character position past any white space and copies it to the
1.2097 +TLex8's extraction mark.
1.2098 +
1.2099 +Stops if at the end of the string.
1.2100 +*/
1.2101 + {SkipSpaceAndMark(iMark);}
1.2102 +
1.2103 +
1.2104 +
1.2105 +
1.2106 +inline TInt TLex8::TokenLength() const
1.2107 +/**
1.2108 +Gets the length of the token.
1.2109 +
1.2110 +This is the difference between the next character
1.2111 +position and the extraction mark.
1.2112 +
1.2113 +@return Length of the token.
1.2114 +*/
1.2115 + {return(iNext-iMark.iPtr);}
1.2116 +
1.2117 +
1.2118 +
1.2119 +
1.2120 +inline TInt TLex8::MarkedOffset() const
1.2121 +/**
1.2122 +Gets the offset of the extraction mark from the start of the string.
1.2123 +
1.2124 +@return The offset of the extraction mark.
1.2125 +*/
1.2126 + {return(iMark.iPtr-iBuf);}
1.2127 +
1.2128 +
1.2129 +
1.2130 +
1.2131 +inline TInt TLex8::Val(TInt &aVal)
1.2132 +/**
1.2133 +Parses the string to extract a signed integer.
1.2134 +
1.2135 +@param aVal On return, contains the extracted integer.
1.2136 +
1.2137 +@return KErrNone if successful.
1.2138 + KErrGeneral if the next character position is initially at the end of the string
1.2139 + or no valid characters found initially.
1.2140 + KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
1.2141 + If error codes KErrGeneral or KErrOverflow are returned, the object's
1.2142 + members are left unaltered.
1.2143 +*/
1.2144 + {return(Val((TInt32&)aVal));}
1.2145 +
1.2146 +
1.2147 +
1.2148 +
1.2149 +inline TInt TLex8::Val(TUint &aVal,TRadix aRadix)
1.2150 +/**
1.2151 +Parses the string to extract an unsigned integer, using the specified radix.
1.2152 +
1.2153 +@param aVal On return, contains the extracted integer.
1.2154 +@param aRadix The radix to use when converting the number. The default radix
1.2155 + for this function overload is decimal.
1.2156 +
1.2157 +@return KErrNone if successful.
1.2158 + KErrGeneral if the next character position is initially at the end of the string
1.2159 + or no valid characters found initially.
1.2160 + KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
1.2161 + If error codes KErrGeneral or KErrOverflow are returned, the object's
1.2162 + members are left unaltered.
1.2163 +*/
1.2164 + {return(Val((TUint32&)aVal,aRadix));}
1.2165 +
1.2166 +
1.2167 +
1.2168 +
1.2169 +inline void TLex8::Assign(const TLex8& aLex)
1.2170 +/**
1.2171 +Assigns a string to this object from another TLex8 object.
1.2172 +
1.2173 +@param aLex The object to be assigned.
1.2174 +*/
1.2175 + {new(this) TLex8(aLex);}
1.2176 +
1.2177 +
1.2178 +
1.2179 +
1.2180 +// Class TLexMark16
1.2181 +inline TLexMark16::TLexMark16()
1.2182 + : iPtr(NULL)
1.2183 +/**
1.2184 +Default constructor.
1.2185 +*/
1.2186 + {}
1.2187 +
1.2188 +
1.2189 +
1.2190 +
1.2191 +inline TLexMark16::TLexMark16(const TUint16 *aString)
1.2192 + : iPtr(aString)
1.2193 + {}
1.2194 +
1.2195 +
1.2196 +
1.2197 +
1.2198 +// Class TLex16
1.2199 +inline TLex16::TLex16(const TUint16 *aString)
1.2200 +/**
1.2201 +Constructs the object with a pointer to a string.
1.2202 +
1.2203 +The extraction mark and next character members are initialised to point
1.2204 +to the start of the string.
1.2205 +
1.2206 +@param aString String to be assigned.
1.2207 +*/
1.2208 + {Assign(TPtrC16(aString));}
1.2209 +
1.2210 +
1.2211 +
1.2212 +
1.2213 +inline TLex16::TLex16(const TDesC16 &aDes)
1.2214 +/**
1.2215 +Constructs the object with a descriptor.
1.2216 +
1.2217 +The extraction mark and next character
1.2218 +members are initialised to point to the start of the string.
1.2219 +
1.2220 +@param aDes Descriptor to be assigned by reference.
1.2221 +*/
1.2222 + {Assign(aDes);}
1.2223 +
1.2224 +
1.2225 +
1.2226 +inline TLex16& TLex16::operator=(const TUint16* aString)
1.2227 +/**
1.2228 +Allows strings to be assigned to a TLex16.
1.2229 +
1.2230 +@param aString String to be assigned to the TLex16.
1.2231 +
1.2232 +@return TLex16 descriptor.
1.2233 +*/
1.2234 + {Assign(TPtrC16(aString));return(*this);}
1.2235 +
1.2236 +
1.2237 +
1.2238 +
1.2239 +inline TLex16& TLex16::operator=(const TDesC16& aBuf)
1.2240 +/**
1.2241 +Allows descriptors to be assigned to a TLex16.
1.2242 +
1.2243 +@param aBuf Descriptor to be assigned to the TLex16.
1.2244 +
1.2245 +@return TLex8 descriptor.
1.2246 +*/
1.2247 + {Assign(aBuf);return(*this);}
1.2248 +
1.2249 +
1.2250 +
1.2251 +
1.2252 +inline TBool TLex16::Eos() const
1.2253 +/**
1.2254 +Tests whether the next character position is at the end of the string.
1.2255 +
1.2256 +@return True if at end of string, false otherwise.
1.2257 +*/
1.2258 + {return(iNext==iEnd);}
1.2259 +
1.2260 +
1.2261 +
1.2262 +
1.2263 +inline void TLex16::Mark(TLexMark16& aMark) const
1.2264 +/**
1.2265 +Sets the supplied extraction mark to the TLex16's next character position.
1.2266 +
1.2267 +@param aMark On return, set to the next character position.
1.2268 +*/
1.2269 + {aMark.iPtr=iNext;}
1.2270 +
1.2271 +
1.2272 +
1.2273 +
1.2274 +inline void TLex16::Mark()
1.2275 +/**
1.2276 +Sets the TLex16's next character position to its extraction mark.
1.2277 +*/
1.2278 + {iMark.iPtr=iNext;}
1.2279 +
1.2280 +
1.2281 +
1.2282 +
1.2283 +inline void TLex16::UnGetToMark()
1.2284 +/**
1.2285 +Sets the next character position to the current extraction mark position.
1.2286 +
1.2287 +@panic USER 68, if the specified mark is before the start or beyond the end
1.2288 + of the string.
1.2289 +*/
1.2290 + {UnGetToMark(iMark);}
1.2291 +
1.2292 +
1.2293 +
1.2294 +
1.2295 +inline void TLex16::SkipAndMark(TInt aNumber)
1.2296 +/**
1.2297 +Moves the next character position a specified number of characters.
1.2298 +
1.2299 +@param aNumber Number of characters to skip.
1.2300 +
1.2301 +@panic USER 68, if the skip moves the next character position either to before
1.2302 + the start or beyond the end of the string.
1.2303 +*/
1.2304 + {SkipAndMark(aNumber,iMark);}
1.2305 +
1.2306 +
1.2307 +
1.2308 +
1.2309 +inline void TLex16::SkipSpaceAndMark()
1.2310 +/**
1.2311 +Moves the next character position past any white space and copies it to the
1.2312 +TLex16's extraction mark.
1.2313 +
1.2314 +Stops if at the end of the string.
1.2315 +*/
1.2316 + {SkipSpaceAndMark(iMark);}
1.2317 +
1.2318 +
1.2319 +
1.2320 +
1.2321 +inline TInt TLex16::TokenLength() const
1.2322 +/**
1.2323 +Gets the length of the token.
1.2324 +
1.2325 +This is the difference between the next character
1.2326 +position and the extraction mark.
1.2327 +
1.2328 +@return Length of the token.
1.2329 +*/
1.2330 + {return(iNext-iMark.iPtr);}
1.2331 +
1.2332 +
1.2333 +
1.2334 +
1.2335 +inline TInt TLex16::MarkedOffset() const
1.2336 +/**
1.2337 +Gets the offset of the extraction mark from the start of the string.
1.2338 +
1.2339 +@return The offset of the extraction mark.
1.2340 +*/
1.2341 + {return(iMark.iPtr-iBuf);}
1.2342 +
1.2343 +
1.2344 +
1.2345 +
1.2346 +inline TInt TLex16::Val(TInt &aVal)
1.2347 +/**
1.2348 +Parses the string to extract a signed integer.
1.2349 +
1.2350 +@param aVal On return, contains the extracted integer.
1.2351 +
1.2352 +@return KErrNone if successful.
1.2353 + KErrGeneral if the next character position is initially at the end of the string
1.2354 + or no valid characters found initially.
1.2355 + KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
1.2356 + If error codes KErrGeneral or KErrOverflow are returned, the object's
1.2357 + members are left unaltered.
1.2358 +*/
1.2359 + {return(Val((TInt32&)aVal));}
1.2360 +
1.2361 +
1.2362 +
1.2363 +
1.2364 +inline TInt TLex16::Val(TUint &aVal,TRadix aRadix)
1.2365 +/**
1.2366 +Parses the string to extract an unsigned integer, using the specified radix.
1.2367 +
1.2368 +@param aVal On return, contains the extracted integer.
1.2369 +@param aRadix The radix to use when converting the number. The default radix
1.2370 + for this function overload is decimal.
1.2371 +
1.2372 +@return KErrNone if successful.
1.2373 + KErrGeneral if the next character position is initially at the end of the string
1.2374 + or no valid characters found initially.
1.2375 + KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
1.2376 + If error codes KErrGeneral or KErrOverflow are returned, the object's
1.2377 + members are left unaltered.
1.2378 +*/
1.2379 + {return(Val((TUint32&)aVal,aRadix));}
1.2380 +
1.2381 +
1.2382 +
1.2383 +
1.2384 +inline void TLex16::Assign(const TLex16& aLex)
1.2385 +/**
1.2386 +Assigns a string to this object from another TLex16 object.
1.2387 +
1.2388 +@param aLex The object to be assigned.
1.2389 +*/
1.2390 + {new(this) TLex16(aLex);}
1.2391 +
1.2392 +
1.2393 +
1.2394 +
1.2395 +// Class TLocale
1.2396 +inline TLocale::TLocale(TInt)
1.2397 + {}
1.2398 +
1.2399 +inline TInt TLocale::CountryCode() const
1.2400 +/**
1.2401 +Gets the code which is used to select country-specific locale data.
1.2402 +
1.2403 +The country code is the code used as the international dialling prefix.
1.2404 +This code is also used to identify a country by the dialling software.
1.2405 +
1.2406 +@return The country code.
1.2407 +*/
1.2408 + {return(iCountryCode);}
1.2409 +
1.2410 +
1.2411 +
1.2412 +
1.2413 +inline void TLocale::SetCountryCode(TInt aCode)
1.2414 +/**
1.2415 +Sets the value which is used to select country-specific locale data.
1.2416 +
1.2417 +This value can be retrieved by using TLocale::CountryCode(). The country code
1.2418 +is the code used as the international dialling prefix. This code is also used
1.2419 +to identify a country by the dialling software.
1.2420 +
1.2421 +@param aCode The country code.
1.2422 +
1.2423 +@see TLocale::CountryCode
1.2424 +*/
1.2425 + {iCountryCode=aCode;}
1.2426 +
1.2427 +
1.2428 +
1.2429 +
1.2430 +inline TTimeIntervalSeconds TLocale::UniversalTimeOffset() const
1.2431 +/**
1.2432 +Gets the locale's universal time offset.
1.2433 +
1.2434 +@return Offset in seconds from universal time. Time zones east of universal
1.2435 + time have positive offsets. Time zones west of universal time have negative
1.2436 + offsets.
1.2437 +
1.2438 +@deprecated Use User::UTCOffset to get the current offset inclusive of daylight
1.2439 + savings time. This function returns the same value, for compatibility.
1.2440 +*/
1.2441 + {return(iUniversalTimeOffset);}
1.2442 +
1.2443 +
1.2444 +
1.2445 +
1.2446 +inline TDateFormat TLocale::DateFormat() const
1.2447 +/**
1.2448 +Gets the date format.
1.2449 +
1.2450 +@return The date format.
1.2451 +*/
1.2452 + {return(iDateFormat);}
1.2453 +
1.2454 +
1.2455 +
1.2456 +
1.2457 +inline void TLocale::SetDateFormat(TDateFormat aFormat)
1.2458 +/**
1.2459 +Sets the date format.
1.2460 +
1.2461 +@param aFormat The date format to be used.
1.2462 +*/
1.2463 + {iDateFormat=aFormat;}
1.2464 +
1.2465 +
1.2466 +
1.2467 +
1.2468 +inline TTimeFormat TLocale::TimeFormat() const
1.2469 +/**
1.2470 +Gets the time format (12 or 24 hour).
1.2471 +
1.2472 +@return The time format.
1.2473 +*/
1.2474 + {return(iTimeFormat);}
1.2475 +
1.2476 +
1.2477 +
1.2478 +
1.2479 +inline void TLocale::SetTimeFormat(TTimeFormat aFormat)
1.2480 +/**
1.2481 +Sets the time format (12 or 24 hour).
1.2482 +
1.2483 +@param aFormat The time format.
1.2484 +*/
1.2485 + {iTimeFormat=aFormat;}
1.2486 +
1.2487 +
1.2488 +
1.2489 +
1.2490 +inline TLocalePos TLocale::CurrencySymbolPosition() const
1.2491 +/**
1.2492 +Gets the currency symbol position.
1.2493 +
1.2494 +For negative currency values, this position may be
1.2495 +reversed using SetNegativeCurrencySymbolOpposite().
1.2496 +
1.2497 +@return The currency symbol position.
1.2498 +
1.2499 +@see TLocale::SetNegativeCurrencySymbolOpposite
1.2500 +*/
1.2501 + {return(iCurrencySymbolPosition);}
1.2502 +
1.2503 +
1.2504 +
1.2505 +
1.2506 +inline void TLocale::SetCurrencySymbolPosition(TLocalePos aPos)
1.2507 +/**
1.2508 +Sets the currency symbol position.
1.2509 +
1.2510 +@param aPos The currency symbol position.
1.2511 +*/
1.2512 + {iCurrencySymbolPosition=aPos;}
1.2513 +
1.2514 +
1.2515 +
1.2516 +
1.2517 +inline TBool TLocale::CurrencySpaceBetween() const
1.2518 +/**
1.2519 +Gets whether or not a space is inserted between the currency symbol and the
1.2520 +currency value.
1.2521 +
1.2522 +For negative currency values, the space can be removed using SetNegativeLoseSpace().
1.2523 +
1.2524 +@return True if a space is inserted; false if not.
1.2525 +
1.2526 +@see TLocale::SetNegativeLoseSpace
1.2527 +*/
1.2528 + {return(iCurrencySpaceBetween);}
1.2529 +
1.2530 +
1.2531 +
1.2532 +
1.2533 +inline void TLocale::SetCurrencySpaceBetween(TBool aSpace)
1.2534 +/**
1.2535 +Sets whether a space is inserted between the currency symbol and the currency
1.2536 +amount.
1.2537 +
1.2538 +@param aSpace ETrue if a space is inserted; EFalse if not.
1.2539 +*/
1.2540 + {iCurrencySpaceBetween=aSpace;}
1.2541 +
1.2542 +
1.2543 +
1.2544 +
1.2545 +inline TInt TLocale::CurrencyDecimalPlaces() const
1.2546 +/**
1.2547 +Gets the number of decimal places to which currency values are set.
1.2548 +
1.2549 +@return The number of decimal places.
1.2550 +*/
1.2551 + {return(iCurrencyDecimalPlaces);}
1.2552 +
1.2553 +
1.2554 +
1.2555 +
1.2556 +inline void TLocale::SetCurrencyDecimalPlaces(TInt aPlaces)
1.2557 +/**
1.2558 +Sets the number of decimal places to which currency values should be set.
1.2559 +
1.2560 +@param aPlaces The number of decimal places.
1.2561 +*/
1.2562 + {iCurrencyDecimalPlaces=aPlaces;}
1.2563 +
1.2564 +
1.2565 +
1.2566 +
1.2567 +inline TBool TLocale::CurrencyNegativeInBrackets() const
1.2568 +/**
1.2569 +@deprecated
1.2570 +
1.2571 +Gets whether negative currency values are enclosed in brackets rather than
1.2572 +being preceded by a minus sign.
1.2573 +
1.2574 +This is deprecated, use NegativeCurrencyFormat() instead.
1.2575 +
1.2576 +@return True if negative currency is enclosed in brackets and has no minus
1.2577 + sign; false if negative currency has a minus sign and is not enclosed
1.2578 + in brackets.
1.2579 +
1.2580 +@see TLocale::NegativeCurrencyFormat
1.2581 +*/
1.2582 + {return((TBool)iNegativeCurrencyFormat);}
1.2583 +
1.2584 +
1.2585 +
1.2586 +
1.2587 +inline void TLocale::SetCurrencyNegativeInBrackets(TBool aBool)
1.2588 +/**
1.2589 +@deprecated
1.2590 +
1.2591 +Sets whether negative currency values are enclosed in brackets rather than
1.2592 +being preceded by a minus sign.
1.2593 +
1.2594 +This is deprecated, use SetNegativeCurrencyFormat() instead.
1.2595 +
1.2596 +@param aBool ETrue, if a negative currency value must be enclosed in brackets
1.2597 + without a minus sign; EFalse, if a negative currency value is
1.2598 + preceded by a minus sign without any enclosing brackets.
1.2599 +
1.2600 +@see TLocale::SetNegativeCurrencyFormat
1.2601 +*/
1.2602 + {iNegativeCurrencyFormat=(aBool)?EInBrackets:ELeadingMinusSign;}
1.2603 +
1.2604 +
1.2605 +
1.2606 +
1.2607 +inline TBool TLocale::CurrencyTriadsAllowed() const
1.2608 +/**
1.2609 +Gets whether triads are allowed in currency values. Triads are groups of
1.2610 +three digits separated by the thousands separator.
1.2611 +
1.2612 +@return True if triads are allowed; false if not.
1.2613 +*/
1.2614 + {return(iCurrencyTriadsAllowed);}
1.2615 +
1.2616 +
1.2617 +
1.2618 +
1.2619 +inline void TLocale::SetCurrencyTriadsAllowed(TBool aBool)
1.2620 +/**
1.2621 +Sets whether triads are allowed in currency values.
1.2622 +
1.2623 +@param aBool ETrue if triads are allowed; EFalse if triads not allowed.
1.2624 +*/
1.2625 + {iCurrencyTriadsAllowed=aBool;}
1.2626 +
1.2627 +
1.2628 +
1.2629 +
1.2630 +inline TChar TLocale::ThousandsSeparator() const
1.2631 +/**
1.2632 +Gets the character used to separate groups of three digits to the left of
1.2633 +the decimal separator.
1.2634 +
1.2635 +A thousands separator character is only displayed in currency values if currency
1.2636 +triads are allowed.
1.2637 +
1.2638 +@return The character used as the thousands separator.
1.2639 +*/
1.2640 + {return(iThousandsSeparator);}
1.2641 +
1.2642 +
1.2643 +
1.2644 +
1.2645 +inline void TLocale::SetThousandsSeparator(const TChar& aChar)
1.2646 +/**
1.2647 +Sets the character to be used to separate groups of three digits to the left
1.2648 +of the decimal separator.
1.2649 +
1.2650 +A thousands separator character is only displayed in currency values if currency
1.2651 +triads are allowed.
1.2652 +
1.2653 +@param aChar The character to be used as the thousands separator.
1.2654 +*/
1.2655 + {iThousandsSeparator=aChar;}
1.2656 +
1.2657 +
1.2658 +
1.2659 +
1.2660 +inline TChar TLocale::DecimalSeparator() const
1.2661 +/**
1.2662 +Gets the character used to separate a whole number from its fractional part.
1.2663 +
1.2664 +@return The character used as the decimal separator.
1.2665 +*/
1.2666 + {return(iDecimalSeparator);}
1.2667 +
1.2668 +
1.2669 +
1.2670 +
1.2671 +inline void TLocale::SetDecimalSeparator(const TChar& aChar)
1.2672 +/**
1.2673 +Sets the character to be used to separate a whole number from its fractional
1.2674 +part.
1.2675 +
1.2676 +@param aChar The character to be used as the decimal separator.
1.2677 +*/
1.2678 + {iDecimalSeparator=aChar;}
1.2679 +
1.2680 +
1.2681 +
1.2682 +
1.2683 +inline TChar TLocale::DateSeparator(TInt aIndex) const
1.2684 +/**
1.2685 +Gets one of the four characters used to separate the day, month and year
1.2686 +components of the date.
1.2687 +
1.2688 +If the four separators are represented by S0, S1, S2 and S3 and the three
1.2689 +date components are represented by XX, YY and ZZ, then the separators are
1.2690 +located: S0 XX S1 YY S2 ZZ S3.
1.2691 +
1.2692 +@param aIndex An index indicating which of the four separators is being accessed.
1.2693 + This must be a value between zero and three inclusive.
1.2694 +
1.2695 +@return A date separator character as determined by the value of aIndex.
1.2696 +*/
1.2697 + {return(iDateSeparator[aIndex]);}
1.2698 +
1.2699 +
1.2700 +
1.2701 +
1.2702 +inline void TLocale::SetDateSeparator(const TChar& aChar,TInt aIndex)
1.2703 +/**
1.2704 +Sets one of the four characters used to separate the day, month and year
1.2705 +components of the date.
1.2706 +
1.2707 +If the four separators are represented by S0, S1, S2 and S3 and the three
1.2708 +date components are represented by XX, YY and ZZ, then the separators are
1.2709 +located: S0 XX S1 YY S2 ZZ S3.
1.2710 +
1.2711 +@param aChar A date separator character to be used.
1.2712 +@param aIndex An index indicating which of the four separators is being accessed.
1.2713 + This must be a value between zero and three inclusive.
1.2714 +*/
1.2715 + {__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxDateSeparators,User::Invariant());
1.2716 + iDateSeparator[aIndex]=aChar;}
1.2717 +
1.2718 +
1.2719 +
1.2720 +
1.2721 +inline TChar TLocale::TimeSeparator(TInt aIndex) const
1.2722 +/**
1.2723 +Gets one of the four characters used to separate the hour, second and minute
1.2724 +components of the time.
1.2725 +
1.2726 +If the four separators are represented by S0, S1, S2 and S3 and the three
1.2727 +time components are represented by XX, YY and ZZ, then the separators are
1.2728 +located: S0 XX S1 YY S2 ZZ S3.
1.2729 +
1.2730 +@param aIndex An index indicating which of the four separators is being
1.2731 + accessed. This must be a value between zero and three inclusive.
1.2732 +
1.2733 +@return A time separator character as determined by the value of aIndex.
1.2734 +*/
1.2735 +
1.2736 + {return(iTimeSeparator[aIndex]);}
1.2737 +
1.2738 +
1.2739 +
1.2740 +
1.2741 +inline void TLocale::SetTimeSeparator(const TChar& aChar,TInt aIndex)
1.2742 +/**
1.2743 +Sets one of the four characters used to separate the hour, minute and second
1.2744 +components of the date.
1.2745 +
1.2746 +If the four separators are represented by S0, S1, S2 and S3 and the three
1.2747 +time components are represented by XX, YY and ZZ, then the separators are
1.2748 +located: S0 XX S1 YY S2 ZZ S3.
1.2749 +
1.2750 +@param aChar A time separator character to be used.
1.2751 +@param aIndex An index indicating which of the four separators is being accessed.
1.2752 + This must be a value between zero and three inclusive.
1.2753 +*/
1.2754 + {__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxTimeSeparators,User::Invariant());
1.2755 + iTimeSeparator[aIndex]=aChar;}
1.2756 +
1.2757 +
1.2758 +
1.2759 +
1.2760 +inline TLocalePos TLocale::AmPmSymbolPosition() const
1.2761 +/**
1.2762 +Gets the am/pm text position (before or after the time value).
1.2763 +
1.2764 +@return The am/pm text position (0 before, 1 after).
1.2765 +*/
1.2766 + {return(iAmPmSymbolPosition);}
1.2767 +
1.2768 +
1.2769 +
1.2770 +
1.2771 +inline void TLocale::SetAmPmSymbolPosition(TLocalePos aPos)
1.2772 +/**
1.2773 +Sets the am/pm text position (before or after the time value).
1.2774 +
1.2775 +@param aSpace The am/pm text position (0 before, 1 after).
1.2776 +*/
1.2777 + {iAmPmSymbolPosition=aPos;}
1.2778 +
1.2779 +
1.2780 +
1.2781 +
1.2782 +inline TBool TLocale::AmPmSpaceBetween() const
1.2783 +/**
1.2784 +Tests whether or not a space is inserted between the time and the preceding
1.2785 +or trailing am/pm text.
1.2786 +
1.2787 +@return True if a space is inserted between the time and am/pm text; false
1.2788 + if not.
1.2789 +*/
1.2790 + {return(iAmPmSpaceBetween);}
1.2791 +
1.2792 +
1.2793 +
1.2794 +
1.2795 +inline void TLocale::SetAmPmSpaceBetween(TBool aSpace)
1.2796 +/**
1.2797 +Sets whether a space is inserted between the time and the preceding or trailing
1.2798 +am/pm text.
1.2799 +
1.2800 +@param aPos ETrue if a space is inserted between the time and am/pm text;
1.2801 + EFalse otherwise.
1.2802 +*/
1.2803 + {iAmPmSpaceBetween=aSpace;}
1.2804 +
1.2805 +
1.2806 +
1.2807 +
1.2808 +inline TUint TLocale::DaylightSaving() const
1.2809 +/**
1.2810 +Gets the zones in which daylight saving is in effect.
1.2811 +
1.2812 +If daylight saving is in effect, one hour is added to the time.
1.2813 +
1.2814 +Use TLocale::QueryHomeHasDaylightSavingOn() to find out whether daylight saving
1.2815 +is in effect for the home city. This is because the daylight saving setting
1.2816 +for the home city may differ from that of the zone in which home is located.
1.2817 +
1.2818 +@return A bit mask in which the three least significant bits are defined,
1.2819 + indicating which of the three daylight saving zones are adjusted for
1.2820 + daylight saving. These bits represent:
1.2821 + Northern (non-European countries in the northern hemisphere),
1.2822 + Southern (southern hemisphere),
1.2823 + and European.
1.2824 +
1.2825 +@see TLocale::QueryHomeHasDaylightSavingOn
1.2826 +@see TDaylightSavingZone
1.2827 +
1.2828 +@deprecated Use the timezone server to retrieve information on timezones and DST.
1.2829 + This method will always indicate that DST is inactive, in order to
1.2830 + preserve compatibility.
1.2831 +*/
1.2832 + {return(iDaylightSaving);}
1.2833 +
1.2834 +
1.2835 +
1.2836 +
1.2837 +inline TBool TLocale::QueryHomeHasDaylightSavingOn() const
1.2838 +/**
1.2839 +Tests whether or not daylight saving is set for the home city.
1.2840 +
1.2841 +@return True if home daylight saving is set; false if not.
1.2842 +
1.2843 +@deprecated Use the timezone server to retrieve information on timezones and DST.
1.2844 + This method will always indicate that DST is inactive, in order to
1.2845 + preserve compatibility.
1.2846 +*/
1.2847 + {return((iHomeDaylightSavingZone|EDstHome) & iDaylightSaving);}
1.2848 +
1.2849 +
1.2850 +
1.2851 +
1.2852 +inline TDaylightSavingZone TLocale::HomeDaylightSavingZone() const
1.2853 +/**
1.2854 +Gets the daylight saving zone in which the home city is located.
1.2855 +
1.2856 +@return The daylight saving zone in which the home city is located.
1.2857 +
1.2858 +@deprecated Use the timezone server to retrieve information on timezones and DST.
1.2859 +*/
1.2860 + {return(iHomeDaylightSavingZone);}
1.2861 +
1.2862 +
1.2863 +
1.2864 +
1.2865 +inline TUint TLocale::WorkDays() const
1.2866 +/**
1.2867 +Gets a bit mask representing the days of the week which are considered as
1.2868 +working days.
1.2869 +
1.2870 +@return A bit mask of seven bits indicating (by being set) which days are
1.2871 + workdays. The least significant bit corresponds to Monday, the next bit to
1.2872 + Tuesday and so on.
1.2873 +*/
1.2874 + {return(iWorkDays);}
1.2875 +
1.2876 +
1.2877 +
1.2878 +
1.2879 +inline void TLocale::SetWorkDays(TUint aMask)
1.2880 +/**
1.2881 +Sets the days of the week which are considered as working days.
1.2882 +
1.2883 +@param aMask A bit mask of seven bits indicating (by being set) which days
1.2884 + are workdays. The least significant bit corresponds to Monday, the
1.2885 + next bit is Tuesday and so on.
1.2886 +*/
1.2887 + {iWorkDays=aMask;}
1.2888 +
1.2889 +
1.2890 +
1.2891 +
1.2892 +inline TDay TLocale::StartOfWeek() const
1.2893 +/**
1.2894 +Gets the day which is considered the first day of the week.
1.2895 +
1.2896 +@return The first day of the week.
1.2897 +*/
1.2898 + {return(iStartOfWeek);}
1.2899 +
1.2900 +
1.2901 +
1.2902 +
1.2903 +inline void TLocale::SetStartOfWeek(TDay aDay)
1.2904 +/**
1.2905 +Sets the day which is considered to be the first day of the week.
1.2906 +
1.2907 +@param aDay The first day of the week.
1.2908 +*/
1.2909 + {iStartOfWeek=aDay;}
1.2910 +
1.2911 +
1.2912 +
1.2913 +
1.2914 +inline TClockFormat TLocale::ClockFormat() const
1.2915 +/**
1.2916 +Gets the clock display format.
1.2917 +
1.2918 +@return The clock display format.
1.2919 +*/
1.2920 + {return(iClockFormat);}
1.2921 +
1.2922 +
1.2923 +
1.2924 +
1.2925 +inline void TLocale::SetClockFormat(TClockFormat aFormat)
1.2926 +/**
1.2927 +Sets the clock display format.
1.2928 +
1.2929 +@param aFormat The clock display format.
1.2930 +*/
1.2931 + {iClockFormat=aFormat;}
1.2932 +
1.2933 +
1.2934 +
1.2935 +
1.2936 +inline TUnitsFormat TLocale::UnitsGeneral() const
1.2937 +/**
1.2938 +Gets the general units of measurement.
1.2939 +
1.2940 +This function should be used when both short and long distances use the
1.2941 +same units of measurement.
1.2942 +
1.2943 +@return General units of measurement.
1.2944 +*/
1.2945 + {return(iUnitsGeneral);}
1.2946 +
1.2947 +
1.2948 +
1.2949 +
1.2950 +inline void TLocale::SetUnitsGeneral(TUnitsFormat aFormat)
1.2951 +/**
1.2952 +Sets the general units of measurement.
1.2953 +This function should be used when both short and long distances use the
1.2954 +same units of measurement.
1.2955 +
1.2956 +@param aFormat General units of measurement.
1.2957 +*/
1.2958 + {iUnitsGeneral=aFormat;}
1.2959 +
1.2960 +
1.2961 +
1.2962 +
1.2963 +inline TUnitsFormat TLocale::UnitsDistanceShort() const
1.2964 +/**
1.2965 +Gets the units of measurement for short distances.
1.2966 +
1.2967 +Short distances are those which would normally be represented by either
1.2968 +metres and centimetres or feet and inches.
1.2969 +
1.2970 +@return Units of measurement for short distances.
1.2971 +*/
1.2972 + {return(iUnitsDistanceShort);}
1.2973 +
1.2974 +
1.2975 +
1.2976 +
1.2977 +inline void TLocale::SetUnitsDistanceShort(TUnitsFormat aFormat)
1.2978 +/**
1.2979 +Sets the units of measurement for short distances.
1.2980 +
1.2981 +Short distances are those which would normally be represented by either
1.2982 +metres and centimetres or feet and inches.
1.2983 +
1.2984 +@param aFormat Units of measurement for short distances.
1.2985 +*/
1.2986 + {iUnitsDistanceShort=aFormat;}
1.2987 +
1.2988 +
1.2989 +
1.2990 +
1.2991 +inline TUnitsFormat TLocale::UnitsDistanceLong() const
1.2992 +/**
1.2993 +Gets the units of measurement for long distances.
1.2994 +
1.2995 +Long distances are those which would normally be represented by either
1.2996 +miles or kilometres.
1.2997 +
1.2998 +@return Units of measurement for long distances.
1.2999 +*/
1.3000 + {return(iUnitsDistanceLong);}
1.3001 +
1.3002 +
1.3003 +
1.3004 +
1.3005 +inline void TLocale::SetUnitsDistanceLong(TUnitsFormat aFormat)
1.3006 +/**
1.3007 +Sets the units of measurement for long distances.
1.3008 +
1.3009 +Long distances are those which would normally be represented by either
1.3010 +miles or kilometres.
1.3011 +
1.3012 +@param aFormat Units of measurement for long distances.
1.3013 +*/
1.3014 + {iUnitsDistanceLong=aFormat;}
1.3015 +
1.3016 +
1.3017 +
1.3018 +
1.3019 +inline void TLocale::SetNegativeCurrencyFormat(TLocale::TNegativeCurrencyFormat aNegativeCurrencyFormat)
1.3020 +/**
1.3021 +Sets the negative currency format.
1.3022 +
1.3023 +@param aNegativeCurrencyFormat How negative currency values are formatted.
1.3024 +*/
1.3025 + {iNegativeCurrencyFormat = aNegativeCurrencyFormat;}
1.3026 +
1.3027 +
1.3028 +
1.3029 +
1.3030 +inline TLocale::TNegativeCurrencyFormat TLocale::NegativeCurrencyFormat() const
1.3031 +/**
1.3032 +Gets the negative currency format.
1.3033 +
1.3034 +@return How negative currency values are formatted.
1.3035 +*/
1.3036 + {return(iNegativeCurrencyFormat);}
1.3037 +
1.3038 +
1.3039 +
1.3040 +
1.3041 +inline TBool TLocale::NegativeLoseSpace() const
1.3042 +/**
1.3043 +Gets whether negative currency values lose the space between the currency
1.3044 +symbol and the value.
1.3045 +
1.3046 +@return True, if negative currency values lose the space between the value
1.3047 + and the symbol; false, if not.
1.3048 +*/
1.3049 + {
1.3050 + if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeLoseSpace)==iExtraNegativeCurrencyFormatFlags)
1.3051 + return ETrue;
1.3052 + else
1.3053 + return EFalse;
1.3054 + }
1.3055 +
1.3056 +
1.3057 +
1.3058 +
1.3059 +inline void TLocale::SetNegativeLoseSpace(TBool aBool)
1.3060 +/**
1.3061 +Sets whether negative currency values lose the space between the currency symbol
1.3062 +and the value.
1.3063 +
1.3064 +@param aBool ETrue to set a flag which indicates that negative currency values
1.3065 + should lose the space between the value and the symbol. EFalse to unset it.
1.3066 +*/
1.3067 + {
1.3068 + if(aBool)
1.3069 + iExtraNegativeCurrencyFormatFlags |= EFlagNegativeLoseSpace;
1.3070 + else
1.3071 + iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeLoseSpace;
1.3072 + }
1.3073 +
1.3074 +
1.3075 +
1.3076 +
1.3077 +inline TBool TLocale::NegativeCurrencySymbolOpposite() const
1.3078 +/**
1.3079 +Gets whether in negative currency values, the position of the currency symbol
1.3080 +is set to be the opposite of the position used for non-negative values (before
1.3081 +or after the value, as set by SetCurrencySymbolPosition()).
1.3082 +
1.3083 +@return True, if the currency symbol position for negative currency values
1.3084 + is the opposite of the position set by SetCurrencySymbolPosition();
1.3085 + false, otherwise.
1.3086 +
1.3087 +@see TLocale::SetCurrencySymbolPosition
1.3088 +*/
1.3089 + {
1.3090 + if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeCurrencySymbolOpposite)==iExtraNegativeCurrencyFormatFlags)
1.3091 + return ETrue;
1.3092 + else
1.3093 + return EFalse;
1.3094 + }
1.3095 +
1.3096 +
1.3097 +
1.3098 +
1.3099 +inline void TLocale::SetNegativeCurrencySymbolOpposite(TBool aBool)
1.3100 +/**
1.3101 +Sets whether the position of the currency symbol for negative currency values
1.3102 +should be the opposite of the position used for non-negative values (before
1.3103 +or after the value, as set by SetCurrencySymbolPosition()).
1.3104 +
1.3105 +@param aBool ETrue to set the position of the currency symbol in negative
1.3106 + currency values to be the opposite of the position as set
1.3107 + using SetCurrencySymbolPosition(). EFalse to leave the
1.3108 + position unchanged.
1.3109 +
1.3110 +@see TLocale::SetCurrencySymbolPosition
1.3111 +*/
1.3112 + {
1.3113 + if (aBool)
1.3114 + iExtraNegativeCurrencyFormatFlags |= EFlagNegativeCurrencySymbolOpposite;
1.3115 + else
1.3116 + iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeCurrencySymbolOpposite;
1.3117 + }
1.3118 +
1.3119 +
1.3120 +
1.3121 +
1.3122 +inline TLanguage TLocale::LanguageDowngrade(TInt aIndex) const
1.3123 +/**
1.3124 +Gets the language that is stored at the specified index into the customisable
1.3125 +part of the language downgrade path.
1.3126 +
1.3127 +The second, third and fourth languages in the language downgrade path can
1.3128 +be customised. These can be enquired using this function. The first language
1.3129 +in the path is always the language of the current locale, as returned by User::Language().
1.3130 +
1.3131 +The languages in the downgrade path are used in turn by the BaflUtils::NearestLanguageFile()
1.3132 +function to find the best matching language-specific version of a language-neutral
1.3133 +filename.
1.3134 +
1.3135 +The full language downgrade path can be retrieved using BaflUtils::GetDowngradePath().
1.3136 +
1.3137 +@param aIndex An index into the customisable part of the language downgrade
1.3138 + path. Between zero and two inclusive.
1.3139 +
1.3140 +@return The language at the specified index.
1.3141 +
1.3142 +@see BaflUtils::NearestLanguageFile
1.3143 +@see BaflUtils::GetDowngradePath
1.3144 +*/
1.3145 + {
1.3146 + __ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
1.3147 + return static_cast<TLanguage>(iLanguageDowngrade[aIndex]);
1.3148 + }
1.3149 +
1.3150 +
1.3151 +
1.3152 +
1.3153 +inline void TLocale::SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage)
1.3154 +/**
1.3155 +Sets a language in the customisable part of the language downgrade path.
1.3156 +
1.3157 +@param aIndex An index into the customisable part of the path at which to
1.3158 + add the language, a value between zero and two.
1.3159 +@param aLanguage The language to add. ELangNone is considered to be the last
1.3160 + language in the path, no more will be searched, so can be used
1.3161 + to specify that no language downgrade is required.
1.3162 +
1.3163 +@see BaflUtils::NearestLanguageFile
1.3164 +@see BaflUtils::GetDowngradePath
1.3165 +*/
1.3166 + {
1.3167 + __ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
1.3168 + iLanguageDowngrade[aIndex] = static_cast<TUint16>(aLanguage);
1.3169 + }
1.3170 +
1.3171 +
1.3172 +
1.3173 +
1.3174 +/**
1.3175 +Gets the number mode stored in the locale.
1.3176 +
1.3177 +@return The number mode for the locale.
1.3178 +*/
1.3179 +inline TDigitType TLocale::DigitType() const
1.3180 + { return iDigitType; }
1.3181 +
1.3182 +
1.3183 +
1.3184 +
1.3185 +/**
1.3186 +Sets the number mode for the locale.
1.3187 +
1.3188 +@param aDigitType The number mode to be set.
1.3189 +*/
1.3190 +inline void TLocale::SetDigitType(TDigitType aDigitType)
1.3191 + { iDigitType=aDigitType; }
1.3192 +
1.3193 +
1.3194 +
1.3195 +
1.3196 +/**
1.3197 +Sets the device time state.
1.3198 +
1.3199 +@param aState The device time state.
1.3200 +
1.3201 +@deprecated Use the timezone server to coordinate automatic time adjustment.
1.3202 +*/
1.3203 +inline void TLocale::SetDeviceTime(TDeviceTimeState aState)
1.3204 + {
1.3205 + iDeviceTimeState=aState;
1.3206 + }
1.3207 +
1.3208 +
1.3209 +inline TLocale* TExtendedLocale::GetLocale()
1.3210 + { return &iLocale; }
1.3211 +
1.3212 +
1.3213 +/**
1.3214 +Gets the device time state.
1.3215 +
1.3216 +@return The device time state.
1.3217 +
1.3218 +@deprecated Use the timezone server to coordinate automatic time adjustment.
1.3219 +*/
1.3220 +inline TLocale::TDeviceTimeState TLocale::DeviceTime() const
1.3221 + {
1.3222 + return iDeviceTimeState;
1.3223 + }
1.3224 +
1.3225 +
1.3226 +// Class TFindSemaphore
1.3227 +inline TFindSemaphore::TFindSemaphore()
1.3228 + : TFindHandleBase()
1.3229 +/**
1.3230 +Constructs the object with a default match pattern.
1.3231 +
1.3232 +The default match pattern, as implemented by the base class, is the single
1.3233 +character "*".
1.3234 +
1.3235 +A new match pattern can be set after construction by calling the Find() member
1.3236 +function of the TFindHandleBase base class.
1.3237 +
1.3238 +@see TFindHandleBase::Find
1.3239 +*/
1.3240 + {}
1.3241 +
1.3242 +
1.3243 +
1.3244 +
1.3245 +inline TFindSemaphore::TFindSemaphore(const TDesC &aMatch)
1.3246 + : TFindHandleBase(aMatch)
1.3247 +/**
1.3248 +Constructs this object with the specified match pattern.
1.3249 +
1.3250 +A new match pattern can be set after construction by
1.3251 +calling TFindHandleBase::Find().
1.3252 +
1.3253 +Note that after construction, the object contains a copy of the supplied
1.3254 +match pattern; the source descriptor can, therefore, be safely discarded.
1.3255 +
1.3256 +@param aMatch A reference to the descriptor containing the match pattern.
1.3257 +
1.3258 +@see TFindHandleBase::Find
1.3259 +*/
1.3260 + {}
1.3261 +
1.3262 +
1.3263 +
1.3264 +
1.3265 +// Class TFindMutex
1.3266 +inline TFindMutex::TFindMutex()
1.3267 + : TFindHandleBase()
1.3268 +/**
1.3269 +Constructs this object with a default match pattern.
1.3270 +
1.3271 +The default match pattern, as implemented by the base class, is the single
1.3272 +character "*".
1.3273 +
1.3274 +A new match pattern can be set after construction by calling the Find() member
1.3275 +function of the TFindHandleBase base class.
1.3276 +
1.3277 +@see TFindHandleBase::Find
1.3278 +*/
1.3279 + {}
1.3280 +
1.3281 +
1.3282 +
1.3283 +
1.3284 +inline TFindMutex::TFindMutex(const TDesC &aMatch)
1.3285 + : TFindHandleBase(aMatch)
1.3286 +/**
1.3287 +Constructs this object with the specified match pattern.
1.3288 +
1.3289 +A new match pattern can be set after construction by calling the Find() member
1.3290 +function of the TFindHandleBase base class.
1.3291 +
1.3292 +After construction, the object contains a copy of the supplied match pattern;
1.3293 +the source descriptor can, therefore, be safely discarded.
1.3294 +
1.3295 +@param aMatch The match pattern.
1.3296 +
1.3297 +@see TFindHandleBase::Find
1.3298 +*/
1.3299 + {}
1.3300 +
1.3301 +
1.3302 +
1.3303 +
1.3304 +// Class TFindChunk
1.3305 +inline TFindChunk::TFindChunk()
1.3306 + : TFindHandleBase()
1.3307 +/**
1.3308 +Constructs this object with a default match pattern.
1.3309 +
1.3310 +The default match pattern, as implemented by the base class, is
1.3311 +the single character "*".
1.3312 +
1.3313 +A new match pattern can be set after construction by
1.3314 +calling TFindHandleBase::Find().
1.3315 +
1.3316 +@see TFindHandleBase
1.3317 +*/
1.3318 + {}
1.3319 +
1.3320 +
1.3321 +
1.3322 +
1.3323 +inline TFindChunk::TFindChunk(const TDesC &aMatch)
1.3324 + : TFindHandleBase(aMatch)
1.3325 +/**
1.3326 +Constructs the object with the specified match pattern.
1.3327 +
1.3328 +A new match pattern can be set after construction by
1.3329 +calling TFindHandleBase::Find().
1.3330 +
1.3331 +@param aMatch The match pattern.
1.3332 +
1.3333 +@see TFindHandleBase
1.3334 +*/
1.3335 + {}
1.3336 +
1.3337 +
1.3338 +
1.3339 +
1.3340 +// Class TFindThread
1.3341 +inline TFindThread::TFindThread()
1.3342 + : TFindHandleBase()
1.3343 +/**
1.3344 +Constructs this object with a default match pattern.
1.3345 +
1.3346 +The default match pattern, as implemented by the base class,
1.3347 +is the single character *.
1.3348 +
1.3349 +A new match pattern can be set after construction
1.3350 +by calling TFindHandleBase::Find().
1.3351 +
1.3352 +@see TFindHandleBase::Find
1.3353 +*/
1.3354 + {}
1.3355 +
1.3356 +
1.3357 +
1.3358 +
1.3359 +inline TFindThread::TFindThread(const TDesC &aMatch)
1.3360 + : TFindHandleBase(aMatch)
1.3361 +/**
1.3362 +Constructs this object with the specified match pattern.
1.3363 +
1.3364 +A new match pattern can be set after construction
1.3365 +by calling the TFindHandleBase::Find().
1.3366 +
1.3367 +@see TFindHandleBase::Find
1.3368 +*/
1.3369 + {}
1.3370 +
1.3371 +
1.3372 +
1.3373 +
1.3374 +// Class TFindProcess
1.3375 +inline TFindProcess::TFindProcess()
1.3376 + : TFindHandleBase()
1.3377 +/**
1.3378 +Constructs this object with a default match pattern.
1.3379 +
1.3380 +The default match pattern, as implemented by the base class,
1.3381 +is the single character *.
1.3382 +
1.3383 +A new match pattern can be set after construction
1.3384 +by calling TFindHandleBase::Find().
1.3385 +
1.3386 +@see TFindHandleBase::Find
1.3387 +*/
1.3388 + {}
1.3389 +
1.3390 +
1.3391 +
1.3392 +
1.3393 +inline TFindProcess::TFindProcess(const TDesC &aMatch)
1.3394 + : TFindHandleBase(aMatch)
1.3395 +/**
1.3396 +Constructs this object with the specified match pattern.
1.3397 +
1.3398 +A new match pattern can be set after construction
1.3399 +by calling the TFindHandleBase::Find().
1.3400 +
1.3401 +@see TFindHandleBase::Find
1.3402 +*/
1.3403 + {}
1.3404 +
1.3405 +
1.3406 +
1.3407 +
1.3408 +// Class TFindLogicalDevice
1.3409 +/**
1.3410 +Constructs the LDD factory object with a default match pattern.
1.3411 +
1.3412 +The default match pattern, as implemented by the base class, is the single
1.3413 +character "*".
1.3414 +
1.3415 +A new match pattern can be set after construction by calling the Find() member
1.3416 +function of the TFindHandleBase base class.
1.3417 +
1.3418 +@see TFindHandleBase::Find
1.3419 +*/
1.3420 +inline TFindLogicalDevice::TFindLogicalDevice()
1.3421 + : TFindHandleBase()
1.3422 + {}
1.3423 +
1.3424 +/**
1.3425 +Constructs the LDD factory object with a specified match pattern.
1.3426 +
1.3427 +A new match pattern can be set after construction by calling
1.3428 +TFindHandleBase::Find().
1.3429 +
1.3430 +@param aMatch The match pattern.
1.3431 +
1.3432 +@see TFindHandleBase::Find
1.3433 +*/
1.3434 +inline TFindLogicalDevice::TFindLogicalDevice(const TDesC &aMatch)
1.3435 + : TFindHandleBase(aMatch)
1.3436 + {}
1.3437 +
1.3438 +// Class TFindPhysicalDevice
1.3439 +/**
1.3440 +Constructs the PDD factory object with a default match pattern.
1.3441 +
1.3442 +The default match pattern, as implemented by the base class, is the single
1.3443 +character "*".
1.3444 +
1.3445 +A new match pattern can be set after construction by calling the Find() member
1.3446 +function of the TFindHandleBase base class.
1.3447 +
1.3448 +@see TFindHandleBase::Find
1.3449 +*/
1.3450 +inline TFindPhysicalDevice::TFindPhysicalDevice()
1.3451 + : TFindHandleBase()
1.3452 + {}
1.3453 +
1.3454 +/**
1.3455 +Constructs the PDD factory object with a specified match pattern.
1.3456 +
1.3457 +A new match pattern can be set after construction by calling
1.3458 +TFindHandleBase::Find().
1.3459 +
1.3460 +@param aMatch The match pattern.
1.3461 +
1.3462 +@see TFindHandleBase::Find
1.3463 +*/
1.3464 +inline TFindPhysicalDevice::TFindPhysicalDevice(const TDesC &aMatch)
1.3465 + : TFindHandleBase(aMatch)
1.3466 + {}
1.3467 +
1.3468 +
1.3469 +
1.3470 +
1.3471 +
1.3472 +// Class TFindServer
1.3473 +inline TFindServer::TFindServer()
1.3474 + : TFindHandleBase()
1.3475 +/**
1.3476 +Constructs the object with a default match pattern.
1.3477 +
1.3478 +The default match pattern, as implemented by the base class, is the single
1.3479 +character "*".
1.3480 +
1.3481 +A new match pattern can be set after construction by calling the Find() member
1.3482 +function of the TFindHandleBase base class.
1.3483 +
1.3484 +@see TFindHandleBase::Find
1.3485 +*/
1.3486 + {}
1.3487 +
1.3488 +
1.3489 +
1.3490 +
1.3491 +inline TFindServer::TFindServer(const TDesC &aMatch)
1.3492 + : TFindHandleBase(aMatch)
1.3493 +/**
1.3494 +Constructs the object with a specified match pattern.
1.3495 +
1.3496 +A new match pattern can be set after construction by calling
1.3497 +TFindHandleBase::Find().
1.3498 +
1.3499 +@param aMatch The match pattern.
1.3500 +
1.3501 +@see TFindHandleBase::Find
1.3502 +*/
1.3503 + {}
1.3504 +
1.3505 +
1.3506 +
1.3507 +
1.3508 +// Class TFindLibrary
1.3509 +inline TFindLibrary::TFindLibrary()
1.3510 + : TFindHandleBase()
1.3511 +/**
1.3512 +Constructs this object with a default match pattern.
1.3513 +
1.3514 +The default match pattern is the single character ‘*’ and is implemented by
1.3515 +the base class TFindHandleBase.
1.3516 +*/
1.3517 + {}
1.3518 +
1.3519 +
1.3520 +
1.3521 +
1.3522 +inline TFindLibrary::TFindLibrary(const TDesC &aMatch)
1.3523 + : TFindHandleBase(aMatch)
1.3524 +/**
1.3525 +Constructs this object with the specified match pattern.
1.3526 +
1.3527 +@param aMatch The descriptor containing the match pattern.
1.3528 +*/
1.3529 + {}
1.3530 +
1.3531 +
1.3532 +
1.3533 +
1.3534 +// Class RDevice
1.3535 +/**
1.3536 +Opens a handle to an LDD factory object found using a TFindLogicalDevice object.
1.3537 +
1.3538 +A TFindLogicalDevice object is used to find all LDD factory objects whose full names match
1.3539 +a specified pattern.
1.3540 +
1.3541 +@param aFind A reference to the object which is used to find the LDD factory object.
1.3542 +@param aType An enumeration whose enumerators define the ownership of this
1.3543 + LDD factory object handle. If not explicitly specified, EOwnerProcess is
1.3544 + taken as default.
1.3545 +
1.3546 +@return KErrNone if successful, otherwise one of the other system wide error
1.3547 + codes.
1.3548 +*/
1.3549 +inline TInt RDevice::Open(const TFindLogicalDevice& aFind,TOwnerType aType)
1.3550 + {return(RHandleBase::Open(aFind,aType));}
1.3551 +
1.3552 +
1.3553 +
1.3554 +
1.3555 +// Class RCriticalSection
1.3556 +inline TBool RCriticalSection::IsBlocked() const
1.3557 +/**
1.3558 +Tests whether the critical section is occupied by another thread.
1.3559 +
1.3560 +@return True, if the critical section is occupied by another thread. False,
1.3561 + otherwise.
1.3562 +*/
1.3563 + {return(iBlocked!=1);}
1.3564 +
1.3565 +
1.3566 +
1.3567 +
1.3568 +// Class RMutex
1.3569 +inline TInt RMutex::Open(const TFindMutex& aFind,TOwnerType aType)
1.3570 +/**
1.3571 +Opens a handle to the global mutex found using a TFindMutex object.
1.3572 +
1.3573 +A TFindMutex object is used to find all global mutexes whose full names match
1.3574 +a specified pattern.
1.3575 +
1.3576 +By default, any thread in the process can use this instance of RMutex to access
1.3577 +the mutex. However, specifying EOwnerThread as the second parameter to this
1.3578 +function, means that only the opening thread can use this instance of RMutex
1.3579 +to access the mutex; any other thread in this process that wants to access
1.3580 +the mutex must either duplicate the handle or use OpenGlobal() again.
1.3581 +
1.3582 +@param aFind A reference to the object which is used to find the mutex.
1.3583 +@param aType An enumeration whose enumerators define the ownership of this
1.3584 + mutex handle. If not explicitly specified, EOwnerProcess is
1.3585 + taken as default.
1.3586 +
1.3587 +@return KErrNone if successful, otherwise one of the other system wide error
1.3588 + codes.
1.3589 +*/
1.3590 + {return(RHandleBase::Open(aFind,aType));}
1.3591 +
1.3592 +
1.3593 +
1.3594 +
1.3595 +// Class RChunk
1.3596 +inline TInt RChunk::Open(const TFindChunk& aFind,TOwnerType aType)
1.3597 +/**
1.3598 +Opens a handle to the global chunk found using a TFindChunk object.
1.3599 +
1.3600 +A TFindChunk object is used to find all chunks whose full names match
1.3601 +a specified pattern.
1.3602 +
1.3603 +By default, ownership of this chunk handle is vested in the current process,
1.3604 +but can be vested in the current thread by passing EOwnerThread as the second
1.3605 +parameter to this function.
1.3606 +
1.3607 +@param aFind A reference to the TFindChunk object used to find the chunk.
1.3608 +@param aType An enumeration whose enumerators define the ownership of this
1.3609 + chunk handle. If not explicitly specified, EOwnerProcess is
1.3610 + taken as default.
1.3611 +
1.3612 +@return KErrNone if successful, otherwise another of the system error codes.
1.3613 +*/
1.3614 + {return(RHandleBase::Open(aFind,aType));}
1.3615 +
1.3616 +
1.3617 +
1.3618 +
1.3619 +inline TBool RChunk::IsReadable() const
1.3620 +/**
1.3621 +Tests whether the chunk is mapped into its process address space.
1.3622 +
1.3623 +@return True, if the chunk is readable; false, otherwise.
1.3624 +*/
1.3625 + {return (Attributes()&RHandleBase::EDirectReadAccess); }
1.3626 +
1.3627 +
1.3628 +
1.3629 +
1.3630 +inline TBool RChunk::IsWritable() const
1.3631 +/**
1.3632 +Tests whether the chunk mapped into its process address space and is writable.
1.3633 +
1.3634 +@return True, if the chunk is writable; false, otherwise.
1.3635 +*/
1.3636 + {return (Attributes()&RHandleBase::EDirectWriteAccess); }
1.3637 +
1.3638 +
1.3639 +
1.3640 +
1.3641 +// Class TObjectId
1.3642 +inline TObjectId::TObjectId()
1.3643 +/**
1.3644 +Default constructor.
1.3645 +*/
1.3646 + {}
1.3647 +
1.3648 +
1.3649 +
1.3650 +
1.3651 +inline TObjectId::TObjectId(TUint64 aId)
1.3652 + : iId(aId)
1.3653 +/**
1.3654 +Constructor taking an unsigned integer value.
1.3655 +
1.3656 +@param aId The value of the object id.
1.3657 +*/
1.3658 + {}
1.3659 +
1.3660 +
1.3661 +
1.3662 +
1.3663 +inline TUint64 TObjectId::Id() const
1.3664 +/**
1.3665 +Return the ID as a 64 bit integer
1.3666 +*/
1.3667 + { return iId; }
1.3668 +
1.3669 +
1.3670 +
1.3671 +
1.3672 +inline TObjectId::operator TUint() const
1.3673 +/**
1.3674 +Conversion operator invoked by the compiler when a TObjectId type is passed
1.3675 +to a function that is prototyped to take a TUint type.
1.3676 +
1.3677 +@see TUint
1.3678 +*/
1.3679 + { return TUint(iId); }
1.3680 +
1.3681 +
1.3682 +
1.3683 +
1.3684 +inline TBool TObjectId::operator==(TObjectId aId) const
1.3685 +/**
1.3686 +Tests whether this thread Id is equal to the specified Id.
1.3687 +
1.3688 +@param aId The thread Id to be compared with this thread Id.
1.3689 +
1.3690 +@return True, if the thread Ids are equal; false otherwise.
1.3691 +*/
1.3692 + {return iId==aId.iId;}
1.3693 +
1.3694 +
1.3695 +
1.3696 +
1.3697 +inline TBool TObjectId::operator!=(TObjectId aId) const
1.3698 +/**
1.3699 +Tests whether this thread Id is unequal to the specified thread Id.
1.3700 +
1.3701 +@param aId The thread Id to be compared with this thread Id.
1.3702 +
1.3703 +@return True, if the thread Ids are unequal; false otherwise.
1.3704 +*/
1.3705 + {return iId!=aId.iId;}
1.3706 +
1.3707 +
1.3708 +
1.3709 +
1.3710 +// Class TThreadId
1.3711 +inline TThreadId::TThreadId()
1.3712 + : TObjectId()
1.3713 +/**
1.3714 +Default constructor.
1.3715 +*/
1.3716 + {}
1.3717 +
1.3718 +
1.3719 +
1.3720 +
1.3721 +inline TThreadId::TThreadId(TUint64 aId)
1.3722 + : TObjectId(aId)
1.3723 +/**
1.3724 +Constructor taking an unsigned integer value.
1.3725 +
1.3726 +@param aId The value of the thread id.
1.3727 +*/
1.3728 + {}
1.3729 +
1.3730 +
1.3731 +
1.3732 +
1.3733 +// Class RThread
1.3734 +inline RThread::RThread()
1.3735 + : RHandleBase(KCurrentThreadHandle)
1.3736 +/**
1.3737 +Default constructor.
1.3738 +
1.3739 +The constructor exists to initialise private data within this handle; it does
1.3740 +not create the thread object.
1.3741 +
1.3742 +Specifically, it sets the handle-number to the value KCurrentThreadHandle.
1.3743 +In effect, the constructor creates a default thread handle.
1.3744 +*/
1.3745 + {}
1.3746 +
1.3747 +
1.3748 +
1.3749 +
1.3750 +inline TInt RThread::Open(const TFindThread& aFind,TOwnerType aType)
1.3751 +/**
1.3752 +Opens a handle to the thread found by pattern matching a name.
1.3753 +
1.3754 +A TFindThread object is used to find all threads whose full names match a
1.3755 +specified pattern.
1.3756 +
1.3757 +By default, ownership of this thread handle is vested in the current process,
1.3758 +but can be vested in the current thread by passing EOwnerThread as the second
1.3759 +parameter to this function.
1.3760 +
1.3761 +@param aFind A reference to the TFindThread object used to find the thread.
1.3762 +@param aType An enumeration whose enumerators define the ownership of this
1.3763 + thread handle. If not explicitly specified, EOwnerProcess is
1.3764 + taken as default.
1.3765 +
1.3766 +@return KErrNone if successful, otherwise one of the other system-wide error codes.
1.3767 +*/
1.3768 + {return(RHandleBase::Open(aFind,aType));}
1.3769 +
1.3770 +
1.3771 +
1.3772 +
1.3773 +#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.3774 +
1.3775 +inline TBool RThread::HasCapability(TCapability aCapability, const char* aDiagnostic) const
1.3776 + {
1.3777 + return DoHasCapability(aCapability, aDiagnostic);
1.3778 + }
1.3779 +
1.3780 +inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
1.3781 + {
1.3782 + return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
1.3783 + }
1.3784 +
1.3785 +#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.3786 +
1.3787 +// Only available to NULL arguments
1.3788 +inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
1.3789 + {
1.3790 + return DoHasCapability(aCapability);
1.3791 + }
1.3792 +
1.3793 +inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
1.3794 + {
1.3795 + return DoHasCapability(aCapability1, aCapability2);
1.3796 + }
1.3797 +
1.3798 +#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
1.3799 +// For things using KSuppressPlatSecDiagnostic
1.3800 +inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.3801 + {
1.3802 + return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
1.3803 + }
1.3804 +
1.3805 +inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.3806 + {
1.3807 + return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
1.3808 + }
1.3809 +
1.3810 +#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
1.3811 +
1.3812 +#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.3813 +
1.3814 +// Class TProcessId
1.3815 +inline TProcessId::TProcessId()
1.3816 + : TObjectId()
1.3817 +/**
1.3818 +Default constructor.
1.3819 +*/
1.3820 + {}
1.3821 +
1.3822 +
1.3823 +
1.3824 +
1.3825 +inline TProcessId::TProcessId(TUint64 aId)
1.3826 + : TObjectId(aId)
1.3827 +/**
1.3828 +Constructor taking an unsigned integer value.
1.3829 +
1.3830 +@param aId The value of the process id.
1.3831 +*/
1.3832 + {}
1.3833 +
1.3834 +
1.3835 +
1.3836 +
1.3837 +// Class RProcess
1.3838 +inline RProcess::RProcess()
1.3839 + : RHandleBase(KCurrentProcessHandle)
1.3840 +/**
1.3841 +Default constructor.
1.3842 +
1.3843 +The constructor exists to initialise private data within this handle; it does
1.3844 +not create the process object.
1.3845 +
1.3846 +Specifically, it sets the handle-number to the value KCurrentProcessHandle.
1.3847 +In effect, the constructor creates a default process handle.
1.3848 +*/
1.3849 + {}
1.3850 +
1.3851 +
1.3852 +
1.3853 +
1.3854 +inline RProcess::RProcess(TInt aHandle)
1.3855 + : RHandleBase(aHandle)
1.3856 +/**
1.3857 +Constructor taking a handle number.
1.3858 +
1.3859 +@param aHandle The handle number to be used to construct this RProcess handle.
1.3860 +*/
1.3861 + {}
1.3862 +
1.3863 +
1.3864 +
1.3865 +
1.3866 +inline TInt RProcess::Open(const TFindProcess& aFind,TOwnerType aType)
1.3867 +/**
1.3868 +Opens a handle to the process found by pattern matching a name.
1.3869 +
1.3870 +A TFindProcess object is used to find all processes whose full names match
1.3871 +a specified pattern.
1.3872 +
1.3873 +By default, ownership of this process handle is vested in the current process,
1.3874 +but can be vested in the current thread by passing EOwnerThread as the second
1.3875 +parameter to this function.
1.3876 +
1.3877 +@param aFind A reference to the TFindProcess object used to find the process.
1.3878 +@param aType An enumeration whose enumerators define the ownership of this
1.3879 + process handle. If not explicitly specified, EOwnerProcess is taken
1.3880 + as default.
1.3881 +
1.3882 +@return KErrNone if successful, otherwise one of the other system-wide error codes.
1.3883 +*/
1.3884 + {return(RHandleBase::Open(aFind,aType));}
1.3885 +
1.3886 +
1.3887 +
1.3888 +
1.3889 +#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.3890 +
1.3891 +inline TBool RProcess::HasCapability(TCapability aCapability, const char* aDiagnostic) const
1.3892 + {
1.3893 + return DoHasCapability(aCapability, aDiagnostic);
1.3894 + }
1.3895 +
1.3896 +inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
1.3897 + {
1.3898 + return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
1.3899 + }
1.3900 +
1.3901 +#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.3902 +
1.3903 +// Only available to NULL arguments
1.3904 +inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
1.3905 + {
1.3906 + return DoHasCapability(aCapability);
1.3907 + }
1.3908 +
1.3909 +inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
1.3910 + {
1.3911 + return DoHasCapability(aCapability1, aCapability2);
1.3912 + }
1.3913 +
1.3914 +#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
1.3915 +// For things using KSuppressPlatSecDiagnostic
1.3916 +inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.3917 + {
1.3918 + return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
1.3919 + }
1.3920 +
1.3921 +inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.3922 + {
1.3923 + return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
1.3924 + }
1.3925 +
1.3926 +#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
1.3927 +
1.3928 +#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.3929 +
1.3930 +
1.3931 +
1.3932 +
1.3933 +
1.3934 +// Class RSessionBase
1.3935 +
1.3936 +
1.3937 +/**
1.3938 +Creates a session with a server, specifying no message slots.
1.3939 +
1.3940 +It should be called as part of session initialisation in the derived class.
1.3941 +
1.3942 +Message slots are not pre-allocated for the session but are taken from
1.3943 +a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
1.3944 +This raises a risk of failure due to lack of memory and, therefore, this mode
1.3945 +of operation is not viable for sessions that make guarantees about the failure
1.3946 +modes of asynchonous services.
1.3947 +
1.3948 +@param aServer The name of the server with which a session is to
1.3949 + be established.
1.3950 +@param aVersion The lowest version of the server with which this client
1.3951 + is compatible
1.3952 +
1.3953 +@return KErrNone if successful, otherwise one of the other system-wide error
1.3954 + codes.
1.3955 +*/
1.3956 +inline TInt RSessionBase::CreateSession(const TDesC& aServer,const TVersion& aVersion)
1.3957 + {return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
1.3958 +
1.3959 +
1.3960 +
1.3961 +
1.3962 +/**
1.3963 +Creates a session with a server, specifying no message slots.
1.3964 +
1.3965 +It should be called as part of session initialisation in the derived class.
1.3966 +
1.3967 +Message slots are not pre-allocated for the session but are taken from
1.3968 +a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
1.3969 +This raises a risk of failure due to lack of memory and, therefore, this mode
1.3970 +of operation is not viable for sessions that make guarantees about the failure
1.3971 +modes of asynchonous services.
1.3972 +
1.3973 +@param aServer A handle to a server with which a session is to be established.
1.3974 +@param aVersion The lowest version of the server with which this client
1.3975 + is compatible
1.3976 +
1.3977 +@return KErrNone if successful, otherwise one of the other system-wide error
1.3978 + codes.
1.3979 +*/
1.3980 +inline TInt RSessionBase::CreateSession(RServer2 aServer,const TVersion& aVersion)
1.3981 + {return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
1.3982 +
1.3983 +
1.3984 +
1.3985 +
1.3986 +/**
1.3987 +Issues a blind request to the server with the specified function number,
1.3988 +and arguments.
1.3989 +
1.3990 +A blind request is one where the server does not issue a response
1.3991 +to the client.
1.3992 +
1.3993 +@param aFunction The function number identifying the request.
1.3994 +@param aArgs A set of up to 4 arguments and their types to be passed
1.3995 + to the server.
1.3996 +
1.3997 +@return KErrNone, if the send operation is successful;
1.3998 + KErrServerTerminated, if the server no longer present;
1.3999 + KErrServerBusy, if there are no message slots available;
1.4000 + KErrNoMemory, if there is insufficient memory available.
1.4001 +
1.4002 +@panic USER 72 if the function number is negative.
1.4003 +*/
1.4004 +inline TInt RSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
1.4005 + {return DoSend(aFunction,&aArgs);}
1.4006 +
1.4007 +
1.4008 +
1.4009 +
1.4010 +/**
1.4011 +Issues an asynchronous request to the server with the specified function
1.4012 +number and arguments.
1.4013 +
1.4014 +The completion status of the request is returned via the request
1.4015 +status object, aStatus.
1.4016 +
1.4017 +@param aFunction The function number identifying the request.
1.4018 +@param aArgs A set of up to 4 arguments and their types to be passed
1.4019 + to the server.
1.4020 +@param aStatus The request status object used to contain the completion status
1.4021 + of the request.
1.4022 +
1.4023 +@panic USER 72 if the function number is negative.
1.4024 +*/
1.4025 +inline void RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
1.4026 + {DoSendReceive(aFunction,&aArgs,aStatus);}
1.4027 +
1.4028 +
1.4029 +
1.4030 +
1.4031 +/**
1.4032 +Issues a synchronous request to the server with the specified function number
1.4033 +and arguments.
1.4034 +
1.4035 +@param aFunction The function number identifying the request.
1.4036 +@param aArgs A set of up to 4 arguments and their types to be passed
1.4037 + to the server.
1.4038 +
1.4039 +@return KErrNone, if the send operation is successful;
1.4040 + KErrServerTerminated, if the server no longer present;
1.4041 + KErrServerBusy, if there are no message slots available;
1.4042 + KErrNoMemory, if there is insufficient memory available.
1.4043 +
1.4044 +@panic USER 72 if the function number is negative.
1.4045 +*/
1.4046 +inline TInt RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
1.4047 + {return DoSendReceive(aFunction,&aArgs);}
1.4048 +
1.4049 +
1.4050 +
1.4051 +
1.4052 +/**
1.4053 +Issues a blind request to the server with the specified function number,
1.4054 +but with no arguments.
1.4055 +
1.4056 +A blind request is one where the server does not issue a response
1.4057 +to the client.
1.4058 +
1.4059 +@param aFunction The function number identifying the request.
1.4060 +
1.4061 +@return KErrNone, if the send operation is successful;
1.4062 + KErrServerTerminated, if the server no longer present;
1.4063 + KErrServerBusy, if there are no message slots available;
1.4064 + KErrNoMemory, if there is insufficient memory available.
1.4065 +
1.4066 +@panic USER 72 if the function number is negative.
1.4067 +*/
1.4068 +inline TInt RSessionBase::Send(TInt aFunction) const
1.4069 + {return DoSend(aFunction,NULL);}
1.4070 +
1.4071 +
1.4072 +
1.4073 +
1.4074 +/**
1.4075 +Issues an asynchronous request to the server with the specified function
1.4076 +number, but with no arguments.
1.4077 +
1.4078 +The completion status of the request is returned via the request
1.4079 +status object, aStatus.
1.4080 +
1.4081 +@param aFunction The function number identifying the request.
1.4082 +@param aStatus The request status object used to contain the completion
1.4083 + status of the request.
1.4084 +
1.4085 +@panic USER 72 if the function number is negative.
1.4086 +*/
1.4087 +inline void RSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
1.4088 + { DoSendReceive(aFunction,NULL,aStatus);}
1.4089 +
1.4090 +
1.4091 +
1.4092 +
1.4093 +/**
1.4094 +Sets the handle-number of this handle to the specified
1.4095 +value.
1.4096 +
1.4097 +The function can take a (zero or positive) handle-number,
1.4098 +or a (negative) error number.
1.4099 +
1.4100 +If aHandleOrError represents a handle-number, then the handle-number of this handle
1.4101 +is set to that value.
1.4102 +If aHandleOrError represents an error number, then the handle-number of this handle is set to zero
1.4103 +and the negative value is returned.
1.4104 +
1.4105 +@param aHandleOrError A handle-number, if zero or positive; an error value, if negative.
1.4106 +
1.4107 +@return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.
1.4108 +*/
1.4109 +inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError)
1.4110 + { return RHandleBase::SetReturnedHandle(aHandleOrError);}
1.4111 +
1.4112 +
1.4113 +
1.4114 +
1.4115 +inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle)
1.4116 + { return RHandleBase::SetReturnedHandle(aHandleOrError,aHandle);}
1.4117 +/**
1.4118 +Issues a synchronous request to the server with the specified function number,
1.4119 +but with no arguments.
1.4120 +
1.4121 +@param aFunction The function number identifying the request.
1.4122 +
1.4123 +@return KErrNone, if the send operation is successful;
1.4124 + KErrServerTerminated, if the server no longer present;
1.4125 + KErrServerBusy, if there are no message slots available;
1.4126 + KErrNoMemory, if there is insufficient memory available.
1.4127 +
1.4128 +@panic USER 72 if the function number is negative.
1.4129 +*/
1.4130 +inline TInt RSessionBase::SendReceive(TInt aFunction) const
1.4131 + {return DoSendReceive(aFunction,NULL);}
1.4132 +
1.4133 +
1.4134 +
1.4135 +
1.4136 +// Class RSubSessionBase
1.4137 +inline RSubSessionBase::RSubSessionBase()
1.4138 + : iSubSessionHandle(0)
1.4139 +/**
1.4140 +Default constructor
1.4141 +*/
1.4142 + {}
1.4143 +
1.4144 +
1.4145 +
1.4146 +
1.4147 +inline TInt RSubSessionBase::SubSessionHandle() const
1.4148 +/**
1.4149 +Gets the sub-session handle number.
1.4150 +
1.4151 +This number is automatically passed to the server when making requests and is
1.4152 +used to identify the appropriate server-side sub-session.
1.4153 +
1.4154 +@return The sub-session handle number.
1.4155 +*/
1.4156 + {return iSubSessionHandle;}
1.4157 +
1.4158 +
1.4159 +
1.4160 +
1.4161 +/**
1.4162 +Creates a new sub-session within an existing session.
1.4163 +
1.4164 +@param aSession The session to which this sub-session will belong.
1.4165 +@param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
1.4166 +@param aArgs The message arguments.
1.4167 +
1.4168 +@return KErrNone if successful, otherwise one of the system-wide error codes.
1.4169 +*/
1.4170 +inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs)
1.4171 + { return DoCreateSubSession(aSession,aFunction,&aArgs); }
1.4172 +
1.4173 +
1.4174 +
1.4175 +
1.4176 +/**
1.4177 +Creates a new sub-session within an existing session.
1.4178 +
1.4179 +This variant sends no message arguments to the server.
1.4180 +
1.4181 +@param aSession The session to which this sub-session will belong.
1.4182 +@param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
1.4183 +
1.4184 +@return KErrNone if successful, otherwise one of the system-wide error codes.
1.4185 +*/
1.4186 +inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction)
1.4187 + { return DoCreateSubSession(aSession,aFunction,NULL); }
1.4188 +
1.4189 +
1.4190 +
1.4191 +
1.4192 +/**
1.4193 +Sends a blind message to the server - no reply is expected.
1.4194 +
1.4195 +A set of message arguments is passed that can be used to specify client
1.4196 +addresses, which the server can use to read from and write to the client
1.4197 +address space.
1.4198 +
1.4199 +Note that this function can fail if there are no available message-slots, either
1.4200 +in the system wide pool (if this is being used), or in the session reserved pool
1.4201 +(if this is being used). If the client request is synchronous, then always use
1.4202 +the synchronous variant of SendReceive(); this is guaranteed to reach the server.
1.4203 +
1.4204 +@param aFunction The opcode specifying the requested service.
1.4205 +@param aArgs The message arguments.
1.4206 +
1.4207 +@return KErrNone if successful, otherwise one of the system-wide error codes.
1.4208 +*/
1.4209 +inline TInt RSubSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
1.4210 + {return DoSend(aFunction,&aArgs);}
1.4211 +
1.4212 +
1.4213 +
1.4214 +
1.4215 +/**
1.4216 +Sends a message to the server and waits asynchronously for the reply.
1.4217 +
1.4218 +An opcode specifies the service required.
1.4219 +A set of message arguments is passed that can be used to specify client addresses,
1.4220 +which the server can use to read from and write to the client address space.
1.4221 +
1.4222 +Note that this function can fail if there are no available message-slots,
1.4223 +either in the system wide pool (if this is being used), or in the session
1.4224 +reserved pool (if this is being used). If the client request is synchronous,
1.4225 +then always use the synchronous variant of SendReceive();
1.4226 +this is guaranteed to reach the server.
1.4227 +
1.4228 +@param aFunction The opcode specifying the requested service.
1.4229 +@param aArgs The message arguments.
1.4230 +@param aStatus A request status which indicates the completion status of the asynchronous request.
1.4231 +*/
1.4232 +inline void RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
1.4233 + {DoSendReceive(aFunction,&aArgs,aStatus);}
1.4234 +
1.4235 +
1.4236 +
1.4237 +
1.4238 +/**
1.4239 +Sends a message to the server and waits synchronously for a reply.
1.4240 +
1.4241 +An opcode specifies the service required.
1.4242 +A set of message arguments is passed that can be used to specify client addresses,
1.4243 +which the server can use to read from and write to the client address space.
1.4244 +
1.4245 +Note that this function will only fail if the server itself fails or environmental
1.4246 +errors occur in the server. All requests made using this function are guaranteed to
1.4247 +reach the server. This means that all synchronous client requests (typically those
1.4248 +that return void) should be routed through this synchronous variant of SendReceive().
1.4249 +
1.4250 +@param aFunction The opcode specifying the requested service.
1.4251 +@param aArgs The message arguments.
1.4252 +
1.4253 +@return KErrNone if successful, otherwise one of the system-wide error codes.
1.4254 +*/
1.4255 +inline TInt RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
1.4256 + {return DoSendReceive(aFunction,&aArgs);}
1.4257 +
1.4258 +
1.4259 +
1.4260 +
1.4261 +/**
1.4262 +Sends a blind message to the server - no reply is expected.
1.4263 +
1.4264 +This variant sends no message arguments to the server.
1.4265 +
1.4266 +@param aFunction The opcode specifying the requested service.
1.4267 +
1.4268 +@return KErrNone if successful, otherwise one of the system-wide error codes.
1.4269 +*/
1.4270 +inline TInt RSubSessionBase::Send(TInt aFunction) const
1.4271 + {return DoSend(aFunction,NULL);}
1.4272 +
1.4273 +
1.4274 +
1.4275 +
1.4276 +/**
1.4277 +Sends a message to the server and waits asynchronously for the reply.
1.4278 +
1.4279 +An opcode specifies the service required.
1.4280 +This variant sends no message arguments to the server.
1.4281 +
1.4282 +@param aFunction The opcode specifying the requested service.
1.4283 +@param aStatus A request status which indicates the completion status of the asynchronous request.
1.4284 +*/
1.4285 +inline void RSubSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
1.4286 + { DoSendReceive(aFunction,NULL,aStatus);}
1.4287 +
1.4288 +
1.4289 +
1.4290 +
1.4291 +/**
1.4292 +Sends a message to the server and waits synchronously for a reply.
1.4293 +
1.4294 +An opcode specifies the service required.
1.4295 +This variant sends no message arguments to the server.
1.4296 +
1.4297 +@param aFunction The opcode specifying the requested service.
1.4298 +
1.4299 +@return KErrNone if successful, otherwise one of the system-wide error codes.
1.4300 +*/
1.4301 +inline TInt RSubSessionBase::SendReceive(TInt aFunction) const
1.4302 + {return DoSendReceive(aFunction,NULL);}
1.4303 +
1.4304 +
1.4305 +
1.4306 +
1.4307 +// Class RRefBase
1.4308 +
1.4309 +/**
1.4310 +Default constructor.
1.4311 +*/
1.4312 +inline RRefBase::RRefBase()
1.4313 + : iPtr(NULL)
1.4314 + {}
1.4315 +
1.4316 +
1.4317 +
1.4318 +/**
1.4319 +Copy constructor.
1.4320 +
1.4321 +@param aRef A reference to the object to be copied.
1.4322 +*/
1.4323 +inline RRefBase::RRefBase(const RRefBase &aRef)
1.4324 + {Copy(aRef);}
1.4325 +
1.4326 +
1.4327 +
1.4328 +
1.4329 +// Class RRef
1.4330 +
1.4331 +
1.4332 +/**
1.4333 +Default constructor.
1.4334 +*/
1.4335 +template <class T>
1.4336 +inline RRef<T>::RRef()
1.4337 + {}
1.4338 +
1.4339 +
1.4340 +
1.4341 +/**
1.4342 +Copy constructor.
1.4343 +
1.4344 +The constructor frees any existing contained object, and takes ownership of
1.4345 +the object owned by anObject.
1.4346 +
1.4347 +@param anObject A reference to another 'reference' object.
1.4348 + On return from this constructor, anObject may be safely
1.4349 + orphaned if it lives on the program stack.
1.4350 +*/
1.4351 +template <class T>
1.4352 +inline RRef<T>::RRef(const RRef<T> &anObject)
1.4353 + {Copy(anObject);}
1.4354 +
1.4355 +
1.4356 +
1.4357 +
1.4358 +/**
1.4359 +Assignment operator.
1.4360 +
1.4361 +The constructor frees any existing contained object, and takes ownership of
1.4362 +the object owned by anObject.
1.4363 +
1.4364 +@param anObject A reference to another 'reference' object.
1.4365 + On return from this constructor, anObject may be safely
1.4366 + orphaned if it lives on the program stack.
1.4367 +*/
1.4368 +template <class T>
1.4369 +inline void RRef<T>::operator=(const RRef<T> &anObject)
1.4370 + {Copy(anObject);}
1.4371 +
1.4372 +
1.4373 +
1.4374 +
1.4375 +/**
1.4376 +Gets a pointer to the contained object.
1.4377 +
1.4378 +@return A pointer to the contained object
1.4379 +*/
1.4380 +template <class T>
1.4381 +inline T *RRef<T>::operator->()
1.4382 + {return((T *)iPtr);}
1.4383 +
1.4384 +
1.4385 +
1.4386 +
1.4387 +/**
1.4388 +Gets a pointer to the contained object.
1.4389 +
1.4390 +@return A pointer to the contained object
1.4391 +*/
1.4392 +template <class T>
1.4393 +inline RRef<T>::operator T*()
1.4394 + {return((T *)iPtr);}
1.4395 +
1.4396 +
1.4397 +
1.4398 +
1.4399 +/**
1.4400 +Creates a copy of the specified object, which is to be contained by
1.4401 +this reference object.
1.4402 +
1.4403 +The amount of memory set aside to contain the object is defined by the size
1.4404 +of the object
1.4405 +
1.4406 +@param anObject The object to be packaged up by this reference object.
1.4407 +*/
1.4408 +template <class T>
1.4409 +void RRef<T>::Alloc(const T &anObject)
1.4410 + {DoAlloc(&anObject,sizeof(T));}
1.4411 +
1.4412 +
1.4413 +
1.4414 +
1.4415 +/**
1.4416 +Creates a copy of the specified object, which is to be contained by
1.4417 +this reference object.
1.4418 +
1.4419 +The amount of memory set aside to contain the object is defined by aSize.
1.4420 +
1.4421 +@param anObject The object to be packaged up by this reference object.
1.4422 +@param aSize The amount of memory to be set aside to contain the object.
1.4423 + You must make sure that this is big enough.
1.4424 +*/
1.4425 +template <class T>
1.4426 +void RRef<T>::Alloc(const T &anObject,TInt aSize)
1.4427 + {DoAlloc(&anObject,aSize);}
1.4428 +
1.4429 +
1.4430 +
1.4431 +
1.4432 +/**
1.4433 +Creates a copy of the specified object, which is to be contained by
1.4434 +this reference object, and leaves on failure.
1.4435 +
1.4436 +The amount of memory set aside to contain the object is defined by the size
1.4437 +of the object
1.4438 +
1.4439 +@param anObject The object to be packaged up by this reference object.
1.4440 +*/
1.4441 +template <class T>
1.4442 +void RRef<T>::AllocL(const T &anObject)
1.4443 + {DoAllocL(&anObject,sizeof(T));}
1.4444 +
1.4445 +
1.4446 +
1.4447 +
1.4448 +/**
1.4449 +Creates a copy of the specified object, which is to be contained by
1.4450 +this reference object, and leaves on failure.
1.4451 +
1.4452 +The amount of memory set aside to contain the object is defined by aSize.
1.4453 +
1.4454 +@param anObject The object to be packaged up by this reference object.
1.4455 +@param aSize The amount of memory to be set aside to contain the object.
1.4456 + You must make sure that this is big enough.
1.4457 +*/
1.4458 +template <class T>
1.4459 +void RRef<T>::AllocL(const T &anObject,TInt aSize)
1.4460 + {DoAllocL(&anObject,aSize);}
1.4461 +
1.4462 +
1.4463 +
1.4464 +
1.4465 +// Class TRegion
1.4466 +inline TBool TRegion::CheckError() const
1.4467 +/**
1.4468 +Tests whether the region's error flag is set.
1.4469 +
1.4470 +The error flag may be set:
1.4471 +
1.4472 +1. when an attempt to allocate more memory for the region fails
1.4473 +
1.4474 +2. if an attempt is made to expand a fixed size region beyond its allocated
1.4475 + size
1.4476 +
1.4477 +3. if ForceError() has been called.
1.4478 +
1.4479 +Use Clear() to unset the error flag, clear the region and free all allocated
1.4480 +memory.
1.4481 +
1.4482 +@return True, if the error flag is set; false, otherwise.
1.4483 +
1.4484 +@see TRegion::ForceError
1.4485 +@see TRegion::Clear
1.4486 +*/
1.4487 + {return(iError);}
1.4488 +
1.4489 +
1.4490 +
1.4491 +
1.4492 +inline TInt TRegion::Count() const
1.4493 +/**
1.4494 +Gets the number of rectangles in this region.
1.4495 +
1.4496 +@return The number of rectangles.
1.4497 +*/
1.4498 + {return(iCount);}
1.4499 +
1.4500 +
1.4501 +
1.4502 +
1.4503 +inline const TRect *TRegion::RectangleList() const
1.4504 +/**
1.4505 +Gets a pointer to the array of rectangles defining this region.
1.4506 +
1.4507 +@return Pointer to the array of rectangles. Note that array is a standard
1.4508 + C++ array, i.e. a concatenated set of TRect objects. Use Count() to
1.4509 + get the number of rectangles.
1.4510 +
1.4511 +@see TRegion::Count
1.4512 +*/
1.4513 + {return(((TRegion *)this)->RectangleListW());}
1.4514 +
1.4515 +
1.4516 +
1.4517 +
1.4518 +inline TRegion::TRegion()
1.4519 + {}
1.4520 +
1.4521 +
1.4522 +
1.4523 +
1.4524 +// Class RRegion
1.4525 +inline TInt RRegion::CheckSpare() const
1.4526 +/**
1.4527 +Gets the number of free memory slots in the region.
1.4528 +
1.4529 +This is the number of slots which have been allocated, minus the number in
1.4530 +use.
1.4531 +
1.4532 +@return The number of free memory slots in the region.
1.4533 +*/
1.4534 + {return(iAllocedRects-iCount);}
1.4535 +
1.4536 +
1.4537 +
1.4538 +
1.4539 +// Class TRegionFix
1.4540 +template <TInt S>
1.4541 +inline TRegionFix<S>::TRegionFix() : TRegion(-S)
1.4542 +/**
1.4543 +Constructs a default fixed size region.
1.4544 +*/
1.4545 + {}
1.4546 +
1.4547 +
1.4548 +
1.4549 +
1.4550 +template <TInt S>
1.4551 +inline TRegionFix<S>::TRegionFix(const TRect &aRect) : TRegion(-S)
1.4552 +/**
1.4553 +Constructs a fixed size region with a TRect.
1.4554 +
1.4555 +@param aRect Rectangle to be added to the newly constructed region.
1.4556 +*/
1.4557 + {AddRect(aRect);}
1.4558 +
1.4559 +
1.4560 +
1.4561 +
1.4562 +template <TInt S>
1.4563 +inline TRegionFix<S>::TRegionFix(const TRegionFix<S> &aRegion)
1.4564 +/**
1.4565 +Copy constructor.
1.4566 +
1.4567 +@param aRegion The TRegionFix object to be copied.
1.4568 +*/
1.4569 + {*this=aRegion;}
1.4570 +
1.4571 +
1.4572 +
1.4573 +
1.4574 +template <TInt S>
1.4575 +inline RRegionBuf<S>::RRegionBuf() : RRegion(-S&(~ERRegionBuf),S)
1.4576 +/**
1.4577 +Constructs a default object.
1.4578 +
1.4579 +The granularity is the value of the template parameter.
1.4580 +*/
1.4581 + {}
1.4582 +
1.4583 +
1.4584 +
1.4585 +template <TInt S>
1.4586 +inline RRegionBuf<S>::RRegionBuf(const RRegion &aRegion)
1.4587 +/**
1.4588 +Constructs this object from the specified RRegion.
1.4589 +
1.4590 +@param aRegion The region to assign to this RRegionBuf.
1.4591 +*/
1.4592 + {*this=aRegion;}
1.4593 +
1.4594 +
1.4595 +
1.4596 +
1.4597 +template <TInt S>
1.4598 +inline RRegionBuf<S>::RRegionBuf(const TRect &aRect) : RRegion(-S&(~ERRegionBuf),S)
1.4599 +/**
1.4600 +Constructs an RRegionBuf with a TRect.
1.4601 +
1.4602 +Its granularity is initialised to the value contained in the template argument.
1.4603 +The resulting region consists of the specified single rectangle.
1.4604 +
1.4605 +@param aRect The single rectangle with which to initialise the region.
1.4606 +*/
1.4607 + {AddRect(aRect);}
1.4608 +
1.4609 +
1.4610 +
1.4611 +
1.4612 +template <TInt S>
1.4613 +inline RRegionBuf<S>::RRegionBuf(const RRegionBuf<S> &aRegion)
1.4614 +/**
1.4615 +Copy constructs from an existing RRegionBuf object.
1.4616 +
1.4617 +@param aRegion The RRegionBuf to be copied.
1.4618 +*/
1.4619 + {*this=aRegion;}
1.4620 +
1.4621 +
1.4622 +
1.4623 +
1.4624 +// enum TTimerLockSpec
1.4625 +inline TTimerLockSpec &operator++(TTimerLockSpec &aLock)
1.4626 + {
1.4627 + return aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
1.4628 + }
1.4629 +inline TTimerLockSpec operator++(TTimerLockSpec &aLock, TInt)
1.4630 + {
1.4631 + TTimerLockSpec l=aLock;
1.4632 + aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
1.4633 + return l;
1.4634 + }
1.4635 +
1.4636 +
1.4637 +
1.4638 +
1.4639 +// Class TCheckedUid
1.4640 +inline const TUidType& TCheckedUid::UidType() const
1.4641 +/**
1.4642 +Gets the Uid type contained in this object.
1.4643 +
1.4644 +@return The Uid type.
1.4645 +*/
1.4646 + {return(iType);}
1.4647 +
1.4648 +
1.4649 +
1.4650 +
1.4651 +// Array deletion support, uses CBase deletion (virtual d'tor) for all C-classes
1.4652 +template <class T>
1.4653 +/** @internalComponent
1.4654 +*/
1.4655 +void _DeleteArray(T** aBegin,T** aEnd)
1.4656 + {for (;;) if (aBegin<aEnd) delete *aBegin++; else return;}
1.4657 +
1.4658 +template <class T>
1.4659 +/** @internalComponent
1.4660 +*/
1.4661 +struct _ArrayUtil
1.4662 + {
1.4663 + static inline void Delete(T* aBegin,T* aEnd,CBase*)
1.4664 + {::_DeleteArray((CBase**)aBegin,(CBase**)aEnd);}
1.4665 + static inline void Delete(T* aBegin,T* aEnd,TAny*)
1.4666 + {::_DeleteArray(aBegin,aEnd);}
1.4667 + static inline void Delete(T* aArray,TInt aCount)
1.4668 + {Delete(aArray,aArray+aCount,*aArray);}
1.4669 + };
1.4670 +
1.4671 +
1.4672 +
1.4673 +
1.4674 +#ifndef __TOOLS__
1.4675 +// Template class TFixedArray
1.4676 +IMPORT_C void PanicTFixedArray();
1.4677 +
1.4678 +
1.4679 +
1.4680 +
1.4681 +template <class T,TInt S>
1.4682 +inline TFixedArray<T,S>::TFixedArray()
1.4683 +/**
1.4684 +Default constructor.
1.4685 +
1.4686 +Constructs an uninitialised C++ array.
1.4687 +*/
1.4688 + {}
1.4689 +
1.4690 +
1.4691 +
1.4692 +
1.4693 +template <class T,TInt S>
1.4694 +inline void TFixedArray<T,S>::Copy(const T* aList,TInt aLength)
1.4695 +/**
1.4696 +Copies the specified set of contiguous objects into the C++ array.
1.4697 +
1.4698 +The copy operation starts at the beginning of the array, replacing
1.4699 +any existing data.
1.4700 +
1.4701 +@param aList A pointer to a set of contiguous objects.
1.4702 +@param aLength The number of contiguous objects to be copied. This value must
1.4703 + not be negative and must not be greater than the size of the
1.4704 + array as defined by the integer template parameter.
1.4705 +
1.4706 +@panic USER 133, in a debug build only, if aLength is negative or is greater
1.4707 + than the size of the array as defined by the integer template parameter.
1.4708 +*/
1.4709 + {__ASSERT_DEBUG(TUint(aLength)<=TUint(S),PanicTFixedArray());Mem::Copy(iRep,aList,aLength*sizeof(T));}
1.4710 +
1.4711 +
1.4712 +
1.4713 +
1.4714 +template <class T,TInt S>
1.4715 +inline TFixedArray<T,S>::TFixedArray(const T* aList,TInt aLength)
1.4716 +/**
1.4717 +Constructs a C++ array initialised with the specified objects.
1.4718 +
1.4719 +@param aList A pointer to a set of contiguous objects.
1.4720 +@param aLength The number of contiguous objects to be copied. This value must
1.4721 + not be negative and must not be greater than the size of the
1.4722 + array as defined by the integer template parameter.
1.4723 +
1.4724 +@panic USER 133, in a debug build only, if aLength is negative or is greater
1.4725 + than the size of the array as defined by the integer template parameter.
1.4726 +*/
1.4727 + {Copy(aList,aLength);}
1.4728 +
1.4729 +
1.4730 +
1.4731 +
1.4732 +template <class T,TInt S>
1.4733 +inline void TFixedArray<T,S>::Reset()
1.4734 +/**
1.4735 +Fills every element of the array with binary zeroes.
1.4736 +*/
1.4737 + {Mem::FillZ(iRep,sizeof(iRep));}
1.4738 +
1.4739 +
1.4740 +
1.4741 +
1.4742 +template <class T,TInt S>
1.4743 +inline TInt TFixedArray<T,S>::Count() const
1.4744 +/**
1.4745 +Gets the size of the array.
1.4746 +
1.4747 +For any instance of this class, the array size
1.4748 +is fixed and has the same value as the integer template parameter.
1.4749 +
1.4750 +@return The size of the array.
1.4751 +*/
1.4752 + {return S;}
1.4753 +
1.4754 +
1.4755 +
1.4756 +
1.4757 +template <class T,TInt S>
1.4758 +inline TInt TFixedArray<T,S>::Length() const
1.4759 +/**
1.4760 +Gets the size of an array element, in bytes.
1.4761 +
1.4762 +@return The size of an array element, in bytes.
1.4763 +*/
1.4764 + {return sizeof(T);}
1.4765 +
1.4766 +
1.4767 +
1.4768 +
1.4769 +template <class T,TInt S>
1.4770 +inline TBool TFixedArray<T,S>::InRange(TInt aIndex)
1.4771 + {return TUint(aIndex)<S;}
1.4772 +
1.4773 +
1.4774 +
1.4775 +
1.4776 +template <class T,TInt S>
1.4777 +inline T& TFixedArray<T,S>::operator[](TInt aIndex)
1.4778 +/**
1.4779 +Gets a reference to the specified element within the C++ array.
1.4780 +
1.4781 +@param aIndex The position of the element within the array. This is an offset value;
1.4782 + a zero value refers to the first element in the array. This value must be
1.4783 + greater than or equal to zero and less than the size of the array.
1.4784 +
1.4785 +@return A reference to an element of the array.
1.4786 +
1.4787 +@panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
1.4788 + of the array as defined by the integer template parameter.
1.4789 +*/
1.4790 + {__ASSERT_DEBUG(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
1.4791 +
1.4792 +
1.4793 +
1.4794 +
1.4795 +template <class T,TInt S>
1.4796 +inline const T& TFixedArray<T,S>::operator[](TInt aIndex) const
1.4797 +/**
1.4798 +Gets a const reference to the specified element within the C++ array.
1.4799 +
1.4800 +@param aIndex The position of the element within the array. This is an offset value;
1.4801 + a zero value refers to the first element in the array. This value must be
1.4802 + greater than or equal to zero and less than the size of the array.
1.4803 +
1.4804 +@return A const reference to an element of the array; the element cannot be
1.4805 + changed through this reference.
1.4806 +
1.4807 +@panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
1.4808 + of the array as defined by the integer template parameter.
1.4809 +*/
1.4810 + {return CONST_CAST(ThisClass&,*this)[aIndex];}
1.4811 +
1.4812 +
1.4813 +
1.4814 +
1.4815 +template <class T,TInt S>
1.4816 +inline T& TFixedArray<T,S>::At(TInt aIndex)
1.4817 +/**
1.4818 +Gets a reference to the specified element within the C++ array.
1.4819 +
1.4820 +@param aIndex The position of the element within the array. This is an offset value;
1.4821 + a zero value refers to the first element in the array. This value must be
1.4822 + greater than or equal to zero and less than the size of the array.
1.4823 +
1.4824 +@return A reference to an element of the array.
1.4825 +
1.4826 +@panic USER 133, if aIndex is negative or greater than or equal to the size
1.4827 + of the array as defined by the integer template parameter.
1.4828 +*/
1.4829 + {__ASSERT_ALWAYS(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
1.4830 +
1.4831 +
1.4832 +
1.4833 +
1.4834 +template <class T,TInt S>
1.4835 +inline const T& TFixedArray<T,S>::At(TInt aIndex) const
1.4836 +/**
1.4837 +Gets a const reference to the specified element within the C++ array.
1.4838 +
1.4839 +@param aIndex The position of the element within the array. This is an offset value;
1.4840 + a zero value refers to the first element in the array. This value must be
1.4841 + greater than or equal to zero and less than the size of the array.
1.4842 +
1.4843 +@return A const reference to an element of the array; the element cannot be
1.4844 + changed through this reference.
1.4845 +
1.4846 +@panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
1.4847 + of the array as defined by the integer template parameter.
1.4848 +*/
1.4849 + {return CONST_CAST(ThisClass&,*this).At(aIndex);}
1.4850 +
1.4851 +
1.4852 +
1.4853 +
1.4854 +template <class T,TInt S>
1.4855 +inline T* TFixedArray<T,S>::Begin()
1.4856 +/**
1.4857 +Gets a pointer to the first element of the array.
1.4858 +
1.4859 +@return A pointer to the first element of the array.
1.4860 +*/
1.4861 + {return &iRep[0];}
1.4862 +
1.4863 +
1.4864 +
1.4865 +
1.4866 +template <class T,TInt S>
1.4867 +inline T* TFixedArray<T,S>::End()
1.4868 +/**
1.4869 +Gets a pointer to the first byte following the end of the array.
1.4870 +
1.4871 +@return A pointer to the first byte following the end of the array.
1.4872 +*/
1.4873 + {return &iRep[S];}
1.4874 +
1.4875 +
1.4876 +
1.4877 +
1.4878 +template <class T,TInt S>
1.4879 +inline const T* TFixedArray<T,S>::Begin() const
1.4880 +/**
1.4881 +Gets a pointer to the first element of the array.
1.4882 +
1.4883 +@return A pointer to a const element of the array.
1.4884 +*/
1.4885 + {return &iRep[0];}
1.4886 +
1.4887 +
1.4888 +
1.4889 +
1.4890 +template <class T,TInt S>
1.4891 +inline const T* TFixedArray<T,S>::End() const
1.4892 +/**
1.4893 +Gets a pointer to the first byte following the end of the array.
1.4894 +
1.4895 +@return A pointer to the const first byte following the end of the array.
1.4896 +*/
1.4897 + {return &iRep[S];}
1.4898 +
1.4899 +
1.4900 +
1.4901 +
1.4902 +template <class T,TInt S>
1.4903 +inline TInt TFixedArray<T,S>::CountFunctionR(const CBase*)
1.4904 + {return S;}
1.4905 +
1.4906 +
1.4907 +
1.4908 +
1.4909 +template <class T,TInt S>
1.4910 +inline const TAny* TFixedArray<T,S>::AtFunctionR(const CBase* aThis,TInt aIndex)
1.4911 + {return &REINTERPRET_CAST(const ThisClass&,*aThis)[aIndex];}
1.4912 +
1.4913 +
1.4914 +
1.4915 +
1.4916 +template <class T,TInt S>
1.4917 +inline TArray<T> TFixedArray<T,S>::Array() const
1.4918 +/**
1.4919 +Creates and returns a generic array for this C++ array.
1.4920 +
1.4921 +@return A generic array for this C++ array.
1.4922 +*/
1.4923 + {return TArray<T>(CountFunctionR,AtFunctionR,REINTERPRET_CAST(const CBase*,this));}
1.4924 +
1.4925 +
1.4926 +
1.4927 +
1.4928 +template <class T,TInt S>
1.4929 +inline void TFixedArray<T,S>::DeleteAll()
1.4930 +/**
1.4931 +Invokes the delete operator on every member of the array.
1.4932 +
1.4933 +The function can only be used for arrays of pointers to CBase derived objects.
1.4934 +
1.4935 +If the array is to be used after a call to this function, it is good practice
1.4936 +to call TFixedArray<class T,TInt S>::Reset() to set all array elements to
1.4937 +NULL.
1.4938 +*/
1.4939 + {_ArrayUtil<T>::Delete(iRep,S);}
1.4940 +#endif
1.4941 +
1.4942 +
1.4943 +
1.4944 +
1.4945 +// class User
1.4946 +
1.4947 +inline RHeap* User::SwitchHeap(RAllocator* aHeap)
1.4948 +/**
1.4949 +Changes the current thread's heap.
1.4950 +
1.4951 +@param aHeap A pointer to the new heap handle.
1.4952 +
1.4953 +@return A pointer to the old heap handle.
1.4954 +*/
1.4955 + { return (RHeap*)SwitchAllocator(aHeap); }
1.4956 +
1.4957 +
1.4958 +
1.4959 +
1.4960 +inline RHeap& User::Heap()
1.4961 +/**
1.4962 +Gets a reference to the handle to the current thread's heap.
1.4963 +
1.4964 +@return A reference to the handle to the current thread's heap.
1.4965 +*/
1.4966 + { return (RHeap&)Allocator(); }
1.4967 +
1.4968 +
1.4969 +
1.4970 +
1.4971 +#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.4972 +
1.4973 +inline TBool User::CreatorHasCapability(TCapability aCapability, const char* aDiagnostic)
1.4974 + {
1.4975 + return DoCreatorHasCapability(aCapability, aDiagnostic);
1.4976 + }
1.4977 +
1.4978 +inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic)
1.4979 + {
1.4980 + return DoCreatorHasCapability(aCapability1, aCapability2, aDiagnostic);
1.4981 + }
1.4982 +
1.4983 +#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.4984 +
1.4985 +// Only available to NULL arguments
1.4986 +inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/)
1.4987 + {
1.4988 + return DoCreatorHasCapability(aCapability);
1.4989 + }
1.4990 +
1.4991 +inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/)
1.4992 + {
1.4993 + return DoCreatorHasCapability(aCapability1, aCapability2);
1.4994 + }
1.4995 +
1.4996 +#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
1.4997 +// For things using KSuppressPlatSecDiagnostic
1.4998 +inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
1.4999 + {
1.5000 + return DoCreatorHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
1.5001 + }
1.5002 +
1.5003 +inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
1.5004 + {
1.5005 + return DoCreatorHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
1.5006 + }
1.5007 +
1.5008 +#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
1.5009 +
1.5010 +#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.5011 +
1.5012 +/** Sets this TSecurityInfo to the security attributes of this process. */
1.5013 +inline void TSecurityInfo::SetToCurrentInfo()
1.5014 + { new (this) TSecurityInfo(RProcess()); }
1.5015 +
1.5016 +/** Constructs a TSecurityInfo using the security attributes of aProcess */
1.5017 +inline void TSecurityInfo::Set(RProcess aProcess)
1.5018 + { new (this) TSecurityInfo(aProcess); }
1.5019 +
1.5020 +/** Constructs a TSecurityInfo using the security attributes of the process
1.5021 +owning aThread
1.5022 +*/
1.5023 +inline void TSecurityInfo::Set(RThread aThread)
1.5024 + { new (this) TSecurityInfo(aThread); }
1.5025 +
1.5026 +/** Constructs a TSecurityInfo using the security attributes of the process
1.5027 +which sent the message aMsgPtr */
1.5028 +inline void TSecurityInfo::Set(RMessagePtr2 aMsgPtr)
1.5029 + { new (this) TSecurityInfo(aMsgPtr); }
1.5030 +
1.5031 +#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.5032 +
1.5033 +/** Checks this policy against the platform security attributes of aProcess.
1.5034 +
1.5035 + When a check fails the action taken is determined by the system wide Platform Security
1.5036 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5037 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5038 + check failed.
1.5039 +
1.5040 +@param aProcess The RProcess object to check against this TSecurityPolicy.
1.5041 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5042 + that may be issued if the policy check fails.
1.5043 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5044 + which enables it to be easily removed from the system.
1.5045 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5046 +platform security attributes of aProcess, EFalse otherwise.
1.5047 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5048 +*/
1.5049 +inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
1.5050 + {
1.5051 + return DoCheckPolicy(aProcess, aDiagnostic);
1.5052 + }
1.5053 +
1.5054 +/** Checks this policy against the platform security attributes of the process
1.5055 +owning aThread.
1.5056 +
1.5057 + When a check fails the action taken is determined by the system wide Platform Security
1.5058 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5059 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5060 + check failed.
1.5061 +
1.5062 +@param aThread The thread whose owning process' platform security attributes
1.5063 +are to be checked against this TSecurityPolicy.
1.5064 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5065 + that may be issued if the policy check fails.
1.5066 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5067 + which enables it to be easily removed from the system.
1.5068 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5069 +platform security parameters of the owning process of aThread, EFalse otherwise.
1.5070 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5071 +*/
1.5072 +inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
1.5073 + {
1.5074 + return DoCheckPolicy(aThread, aDiagnostic);
1.5075 + }
1.5076 +
1.5077 +/** Checks this policy against the platform security attributes of the process which sent
1.5078 +the given message.
1.5079 +
1.5080 + When a check fails the action taken is determined by the system wide Platform Security
1.5081 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5082 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5083 + check failed.
1.5084 +
1.5085 +@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
1.5086 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5087 + that may be issued if the policy check fails.
1.5088 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5089 + which enables it to be easily removed from the system.
1.5090 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5091 +platform security attributes of aMsg, EFalse otherwise.
1.5092 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5093 +*/
1.5094 +inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
1.5095 + {
1.5096 + return DoCheckPolicy(aMsgPtr, aDiagnostic);
1.5097 + }
1.5098 +
1.5099 +/** Checks this policy against the platform security attributes of the process which sent
1.5100 +the given message.
1.5101 +
1.5102 + When a check fails the action taken is determined by the system wide Platform Security
1.5103 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5104 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5105 + check failed.
1.5106 +
1.5107 +@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
1.5108 +@param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
1.5109 + it finds to be missing.
1.5110 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5111 + that may be issued if the policy check fails.
1.5112 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5113 + which enables it to be easily removed from the system.
1.5114 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5115 +platform security attributes of aMsg, EFalse otherwise.
1.5116 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5117 +
1.5118 +@internalComponent
1.5119 +*/
1.5120 +inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
1.5121 + {
1.5122 + return DoCheckPolicy(aMsgPtr, aMissing, aDiagnostic);
1.5123 + }
1.5124 +
1.5125 +/** Checks this policy against the platform security attributes of this process' creator.
1.5126 +
1.5127 + When a check fails the action taken is determined by the system wide Platform Security
1.5128 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5129 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5130 + check failed.
1.5131 +
1.5132 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5133 + that may be issued if the policy check fails.
1.5134 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5135 + which enables it to be easily removed from the system.
1.5136 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5137 +platform security attributes of this process' creator, EFalse otherwise.
1.5138 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5139 +*/
1.5140 +inline TBool TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
1.5141 + {
1.5142 + return DoCheckPolicyCreator(aDiagnostic);
1.5143 + }
1.5144 +
1.5145 +/**
1.5146 +@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
1.5147 +*/
1.5148 +inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
1.5149 + {
1.5150 + return (&(*this))->CheckPolicy(aProcess, aDiagnostic);
1.5151 + }
1.5152 +
1.5153 +/**
1.5154 +@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
1.5155 +*/
1.5156 +inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
1.5157 + {
1.5158 + return (&(*this))->CheckPolicy(aThread, aDiagnostic);
1.5159 + }
1.5160 +
1.5161 +/**
1.5162 +@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
1.5163 +*/
1.5164 +inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
1.5165 + {
1.5166 + return (&(*this))->CheckPolicy(aMsgPtr, aDiagnostic);
1.5167 + }
1.5168 +
1.5169 +/**
1.5170 +@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
1.5171 +@internalComponent
1.5172 +*/
1.5173 +inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
1.5174 + {
1.5175 + return (&(*this))->CheckPolicy(aMsgPtr, aMissing, aDiagnostic);
1.5176 + }
1.5177 +
1.5178 +/**
1.5179 +@see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
1.5180 +*/
1.5181 +inline TBool TStaticSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
1.5182 + {
1.5183 + return (&(*this))->CheckPolicyCreator(aDiagnostic);
1.5184 + }
1.5185 +
1.5186 +#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.5187 +
1.5188 +/** Checks this policy against the platform security attributes of aProcess.
1.5189 +
1.5190 + When a check fails the action taken is determined by the system wide Platform Security
1.5191 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5192 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5193 + check failed.
1.5194 +
1.5195 +@param aProcess The RProcess object to check against this TSecurityPolicy.
1.5196 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5197 + that may be issued if the policy check fails.
1.5198 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5199 + which enables it to be easily removed from the system.
1.5200 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5201 +platform security attributes of aProcess, EFalse otherwise.
1.5202 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5203 +*/
1.5204 +inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
1.5205 + {
1.5206 + return DoCheckPolicy(aProcess);
1.5207 + }
1.5208 +
1.5209 +/** Checks this policy against the platform security attributes of the process
1.5210 +owning aThread.
1.5211 +
1.5212 + When a check fails the action taken is determined by the system wide Platform Security
1.5213 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5214 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5215 + check failed.
1.5216 +
1.5217 +@param aThread The thread whose owning process' platform security attributes
1.5218 +are to be checked against this TSecurityPolicy.
1.5219 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5220 + that may be issued if the policy check fails.
1.5221 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5222 + which enables it to be easily removed from the system.
1.5223 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5224 +platform security parameters of the owning process of aThread, EFalse otherwise.
1.5225 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5226 +*/
1.5227 +inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
1.5228 + {
1.5229 + return DoCheckPolicy(aThread);
1.5230 + }
1.5231 +
1.5232 +/** Checks this policy against the platform security attributes of the process which sent
1.5233 +the given message.
1.5234 +
1.5235 + When a check fails the action taken is determined by the system wide Platform Security
1.5236 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5237 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5238 + check failed.
1.5239 +
1.5240 +@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
1.5241 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5242 + that may be issued if the policy check fails.
1.5243 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5244 + which enables it to be easily removed from the system.
1.5245 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5246 +platform security attributes of aMsg, EFalse otherwise.
1.5247 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5248 +*/
1.5249 +inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
1.5250 + {
1.5251 + return DoCheckPolicy(aMsgPtr);
1.5252 + }
1.5253 +
1.5254 +/** Checks this policy against the platform security attributes of the process which sent
1.5255 +the given message.
1.5256 +
1.5257 + When a check fails the action taken is determined by the system wide Platform Security
1.5258 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5259 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5260 + check failed.
1.5261 +
1.5262 +@param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
1.5263 +@param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
1.5264 + it finds to be missing.
1.5265 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5266 + that may be issued if the policy check fails.
1.5267 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5268 + which enables it to be easily removed from the system.
1.5269 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5270 +platform security attributes of aMsg, EFalse otherwise.
1.5271 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5272 +
1.5273 +@internalComponent
1.5274 +*/
1.5275 +inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
1.5276 + {
1.5277 + return DoCheckPolicy(aMsgPtr, aMissing);
1.5278 + }
1.5279 +
1.5280 +/** Checks this policy against the platform security attributes of this process' creator.
1.5281 +
1.5282 + When a check fails the action taken is determined by the system wide Platform Security
1.5283 + configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
1.5284 + If PlatSecEnforcement is OFF, then this function will return ETrue even though the
1.5285 + check failed.
1.5286 +
1.5287 +@param aDiagnostic A string that will be emitted along with any diagnostic message
1.5288 + that may be issued if the policy check fails.
1.5289 + This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
1.5290 + which enables it to be easily removed from the system.
1.5291 +@return ETrue if all the requirements of this TSecurityPolicy are met by the
1.5292 +platform security attributes of this process' creator, EFalse otherwise.
1.5293 +@panic USER 190 if 'this' is an invalid SSecurityInfo object
1.5294 +*/
1.5295 +inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
1.5296 + {
1.5297 + return DoCheckPolicyCreator();
1.5298 + }
1.5299 +
1.5300 +#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
1.5301 +inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5302 + {
1.5303 + return DoCheckPolicy(aProcess, KSuppressPlatSecDiagnosticMagicValue);
1.5304 + }
1.5305 +
1.5306 +inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5307 + {
1.5308 + return DoCheckPolicy(aThread, KSuppressPlatSecDiagnosticMagicValue);
1.5309 + }
1.5310 +
1.5311 +inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5312 + {
1.5313 + return DoCheckPolicy(aMsgPtr, KSuppressPlatSecDiagnosticMagicValue);
1.5314 + }
1.5315 +
1.5316 +inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5317 + {
1.5318 + return DoCheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnosticMagicValue);
1.5319 + }
1.5320 +
1.5321 +inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5322 + {
1.5323 + return DoCheckPolicyCreator(KSuppressPlatSecDiagnosticMagicValue);
1.5324 + }
1.5325 +#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
1.5326 +
1.5327 +/**
1.5328 +@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
1.5329 +*/
1.5330 +inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
1.5331 + {
1.5332 + return (&(*this))->CheckPolicy(aProcess);
1.5333 + }
1.5334 +
1.5335 +/**
1.5336 +@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
1.5337 +*/
1.5338 +inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
1.5339 + {
1.5340 + return (&(*this))->CheckPolicy(aThread);
1.5341 + }
1.5342 +
1.5343 +/**
1.5344 +@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
1.5345 +*/
1.5346 +inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
1.5347 + {
1.5348 + return (&(*this))->CheckPolicy(aMsgPtr);
1.5349 + }
1.5350 +
1.5351 +/**
1.5352 +@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
1.5353 +@internalComponent
1.5354 +*/
1.5355 +inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
1.5356 + {
1.5357 + return (&(*this))->CheckPolicy(aMsgPtr, aMissing);
1.5358 + }
1.5359 +
1.5360 +/**
1.5361 +@see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
1.5362 +*/
1.5363 +inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
1.5364 + {
1.5365 + return (&(*this))->CheckPolicyCreator();
1.5366 + }
1.5367 +
1.5368 +#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
1.5369 +/**
1.5370 +@see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
1.5371 +*/
1.5372 +inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5373 + {
1.5374 + return (&(*this))->CheckPolicy(aProcess, KSuppressPlatSecDiagnostic);
1.5375 + }
1.5376 +
1.5377 +/**
1.5378 +@see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
1.5379 +*/
1.5380 +inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5381 + {
1.5382 + return (&(*this))->CheckPolicy(aThread, KSuppressPlatSecDiagnostic);
1.5383 + }
1.5384 +
1.5385 +/**
1.5386 +@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
1.5387 +*/
1.5388 +inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5389 + {
1.5390 + return (&(*this))->CheckPolicy(aMsgPtr, KSuppressPlatSecDiagnostic);
1.5391 + }
1.5392 +
1.5393 +/**
1.5394 +@see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
1.5395 +@internalComponent
1.5396 +*/
1.5397 +inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5398 + {
1.5399 + return (&(*this))->CheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnostic);
1.5400 + }
1.5401 +
1.5402 +/**
1.5403 +@see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
1.5404 +*/
1.5405 +inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.5406 + {
1.5407 + return (&(*this))->CheckPolicyCreator(KSuppressPlatSecDiagnostic);
1.5408 + }
1.5409 +#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
1.5410 +
1.5411 +#endif //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.5412 +
1.5413 +
1.5414 +
1.5415 +#ifndef __KERNEL_MODE__
1.5416 +
1.5417 +/**
1.5418 +Appends an object pointer onto the array.
1.5419 +
1.5420 +The function leaves with one of the system wide error codes, if the operation fails.
1.5421 +
1.5422 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5423 +
1.5424 +@param anEntry The object pointer to be appended.
1.5425 +*/
1.5426 +template <class T>
1.5427 +inline void RPointerArray<T>::AppendL(const T* anEntry)
1.5428 + { User::LeaveIfError(Append(anEntry));}
1.5429 +
1.5430 +
1.5431 +/**
1.5432 +Inserts an object pointer into the array at the specified position.
1.5433 +
1.5434 +The function leaves with one of the system wide error codes, if
1.5435 +the operation fails.
1.5436 +
1.5437 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5438 +
1.5439 +@param anEntry The object pointer to be inserted.
1.5440 +@param aPos The position within the array where the object pointer is to be
1.5441 + inserted. The position is relative to zero, i.e. zero implies
1.5442 + that a pointer is inserted at the beginning of the array.
1.5443 +
1.5444 +@panic USER 131, if aPos is negative, or is greater than the number of object
1.5445 + pointers currently in the array.
1.5446 +*/
1.5447 +template <class T>
1.5448 +inline void RPointerArray<T>::InsertL(const T* anEntry, TInt aPos)
1.5449 + { User::LeaveIfError(Insert(anEntry,aPos)); }
1.5450 +
1.5451 +
1.5452 +/**
1.5453 +Finds the first object pointer in the array which matches the specified object
1.5454 +pointer, using a sequential search.
1.5455 +
1.5456 +Matching is based on the comparison of pointers.
1.5457 +
1.5458 +The find operation always starts at the low index end of the array. There
1.5459 +is no assumption about the order of objects in the array.
1.5460 +
1.5461 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5462 +
1.5463 +@param anEntry The object pointer to be found.
1.5464 +@return The index of the first matching object pointer within the array.
1.5465 +@leave KErrNotFound, if no matching object pointer can be found.
1.5466 +*/
1.5467 +template <class T>
1.5468 +inline TInt RPointerArray<T>::FindL(const T* anEntry) const
1.5469 + { return User::LeaveIfError(Find(anEntry));}
1.5470 +
1.5471 +
1.5472 +/**
1.5473 +Finds the first object pointer in the array whose object matches the specified
1.5474 +object, using a sequential search and a matching algorithm.
1.5475 +
1.5476 +The algorithm for determining whether two class T objects match is provided
1.5477 +by a function supplied by the caller.
1.5478 +
1.5479 +The find operation always starts at the low index end of the array. There
1.5480 +is no assumption about the order of objects in the array.
1.5481 +
1.5482 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5483 +
1.5484 +@param anEntry The object pointer to be found.
1.5485 +@param anIdentity A package encapsulating the function which determines whether
1.5486 + two class T objects match.
1.5487 +
1.5488 +@return The index of the first matching object pointer within the array.
1.5489 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5490 +*/
1.5491 +template <class T>
1.5492 +inline TInt RPointerArray<T>::FindL(const T* anEntry, TIdentityRelation<T> anIdentity) const
1.5493 + { return User::LeaveIfError(Find(anEntry, anIdentity));}
1.5494 +
1.5495 +
1.5496 +/**
1.5497 +Finds the last object pointer in the array which matches the specified object
1.5498 +pointer, using a sequential search.
1.5499 +
1.5500 +Matching is based on the comparison of pointers.
1.5501 +
1.5502 +The find operation always starts at the high index end of the array. There
1.5503 +is no assumption about the order of objects in the array.
1.5504 +
1.5505 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5506 +
1.5507 +@param anEntry The object pointer to be found.
1.5508 +@return The index of the last matching object pointer within the array.
1.5509 +@leave KErrNotFound, if no matching object pointer can be found.
1.5510 +*/
1.5511 +template <class T>
1.5512 +inline TInt RPointerArray<T>::FindReverseL(const T* anEntry) const
1.5513 + { return User::LeaveIfError(FindReverse(anEntry));}
1.5514 +
1.5515 +
1.5516 +/**
1.5517 +Finds the last object pointer in the array whose object matches the specified
1.5518 +object, using a sequential search and a matching algorithm.
1.5519 +
1.5520 +The algorithm for determining whether two class T objects match is provided
1.5521 +by a function supplied by the caller.
1.5522 +
1.5523 +The find operation always starts at the high index end of the array. There
1.5524 +is no assumption about the order of objects in the array.
1.5525 +
1.5526 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5527 +
1.5528 +@param anEntry The object pointer to be found.
1.5529 +@param anIdentity A package encapsulating the function which determines whether
1.5530 + two class T objects match.
1.5531 +
1.5532 +@return The index of the last matching object pointer within the array.
1.5533 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5534 +*/
1.5535 +template <class T>
1.5536 +inline TInt RPointerArray<T>::FindReverseL(const T* anEntry, TIdentityRelation<T> anIdentity) const
1.5537 + { return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
1.5538 +
1.5539 +
1.5540 +/**
1.5541 +Finds the object pointer in the array that matches the specified object
1.5542 +pointer, using a binary search technique.
1.5543 +
1.5544 +The function assumes that object pointers in the array are in address order.
1.5545 +
1.5546 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5547 +
1.5548 +@param anEntry The object pointer to be found.
1.5549 +
1.5550 +@return The index of the matching object pointer within the array
1.5551 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5552 +*/
1.5553 +template <class T>
1.5554 +inline TInt RPointerArray<T>::FindInAddressOrderL(const T* anEntry) const
1.5555 + { return User::LeaveIfError(FindInAddressOrder(anEntry));}
1.5556 +
1.5557 +
1.5558 +/**
1.5559 +Finds the object pointer in the array whose object matches the specified
1.5560 +object, using a binary search technique and an ordering algorithm.
1.5561 +
1.5562 +The function assumes that existing object pointers in the array are ordered
1.5563 +so that the objects themselves are in object order as determined by an algorithm
1.5564 +supplied by the caller and packaged as a TLinearOrder<T>.
1.5565 +
1.5566 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5567 +
1.5568 +@param anEntry The object pointer to be found.
1.5569 +@param anOrder A package encapsulating the function which determines the order
1.5570 + of two class T objects.
1.5571 +
1.5572 +@return The index of the matching object pointer within the array.
1.5573 +
1.5574 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5575 +*/
1.5576 +template <class T>
1.5577 +inline TInt RPointerArray<T>::FindInOrderL(const T* anEntry, TLinearOrder<T> anOrder) const
1.5578 + { return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
1.5579 +
1.5580 +
1.5581 +/**
1.5582 +Finds the object pointer in the array that matches the specified object
1.5583 +pointer, using a binary search technique.
1.5584 +
1.5585 +The function assumes that object pointers in the array are in address order.
1.5586 +
1.5587 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5588 +
1.5589 +@param anEntry The object pointer to be found.
1.5590 +@param anIndex A reference to a TInt into which the
1.5591 + function puts an index value: If the function does not leave,
1.5592 + this is the index of the matching object pointer within the
1.5593 + array. If the function leaves with KErrNotFound, this is the
1.5594 + index of the first object pointer within the array which
1.5595 + logically follows after anEntry.
1.5596 +
1.5597 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5598 +*/
1.5599 +template <class T>
1.5600 +inline void RPointerArray<T>::FindInAddressOrderL(const T* anEntry, TInt& anIndex) const
1.5601 + { User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
1.5602 +
1.5603 +
1.5604 +/**
1.5605 +Finds the object pointer in the array whose object matches the specified
1.5606 +object, using a binary search technique and an ordering algorithm.
1.5607 +
1.5608 +The function assumes that existing object pointers in the array are ordered
1.5609 +so that the objects themselves are in object order as determined by an
1.5610 +algorithm supplied by the caller and packaged as a TLinearOrder<T>.
1.5611 +
1.5612 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5613 +
1.5614 +@param anEntry The object pointer to be found.
1.5615 +@param anIndex A TInt supplied by the caller. On return, contains an
1.5616 + index value:
1.5617 + If the function does not leave, this is the index of the
1.5618 + matching object pointer within the array.
1.5619 + If the function leaves with KErrNotFound, this is the index of
1.5620 + the first object pointer in the array whose object is bigger
1.5621 + than the entry being searched for - if no objects pointed to in
1.5622 + the array are bigger, then the index value is the same as the
1.5623 + total number of object pointers in the array.
1.5624 +
1.5625 +@param anOrder A package encapsulating the function which determines the order
1.5626 + of two class T objects.
1.5627 +
1.5628 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5629 +*/
1.5630 +template <class T>
1.5631 +inline void RPointerArray<T>::FindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
1.5632 + { User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder)); }
1.5633 +
1.5634 +
1.5635 +/**
1.5636 +Finds the object pointer in the array that matches the specified object
1.5637 +pointer, using a binary search technique.
1.5638 +
1.5639 +Where there is more than one matching element, it finds the first, the last
1.5640 +or any matching element as specified by the value of aMode.
1.5641 +
1.5642 +The function assumes that object pointers in the array are in address order.
1.5643 +
1.5644 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5645 +
1.5646 +@param anEntry The object pointer to be found.
1.5647 +@param aMode Specifies whether to find the first match, the last match or
1.5648 + any match, as defined by one of the TArrayFindMode enum values.
1.5649 +
1.5650 +@return If there is a matching element, the array index of a matching element - what
1.5651 + the index refers to depends on the value of aMode:
1.5652 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.5653 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.5654 + if this is EArrayFindMode_Last, then the index refers to first element that follows the
1.5655 + last matching element - if the last matching element is also the last element of the array,
1.5656 + then the index value is the same as the total number of elements in the array.
1.5657 +
1.5658 +@leave KErrNotFound if no matching entry exists.
1.5659 +
1.5660 +@see TArrayFindMode
1.5661 +*/
1.5662 +template <class T>
1.5663 +inline TInt RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt aMode) const
1.5664 + { return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
1.5665 +
1.5666 +
1.5667 +/**
1.5668 +Finds the object pointer in the array whose object matches the specified
1.5669 +object, using a binary search technique and an ordering algorithm.
1.5670 +
1.5671 +In the case that there is more than one matching element finds the first, last
1.5672 +or any match as specified by the value of aMode.
1.5673 +
1.5674 +The function assumes that existing object pointers in the array are ordered
1.5675 +so that the objects themselves are in object order as determined by an algorithm
1.5676 +supplied by the caller and packaged as a TLinearOrder<T> type.
1.5677 +
1.5678 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5679 +
1.5680 +@param anEntry The object pointer to be found.
1.5681 +@param anOrder A package encapsulating the function which determines the order
1.5682 + of two class T objects.
1.5683 +@param aMode Specifies whether to find the first match, the last match or any match,
1.5684 + as defined by one of the TArrayFindMode enum values.
1.5685 +
1.5686 +@return If there is a matching element, the array index of a matching
1.5687 + element - what the index refers to depends on the value of aMode:
1.5688 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.5689 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.5690 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.5691 + the last matching element - if the last matching element is also the last element of the array, then
1.5692 + the index value is the same as the total number of elements in the array.
1.5693 +
1.5694 +@leave KErrNotFound if no matching entry exists.
1.5695 +
1.5696 +@see TArrayFindMode
1.5697 +*/
1.5698 +template <class T>
1.5699 +inline TInt RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const
1.5700 + { return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
1.5701 +
1.5702 +
1.5703 +/**
1.5704 +Finds the object pointer in the array that matches the specified object
1.5705 +pointer, using a binary search technique.
1.5706 +
1.5707 +Where there is more than one matching element, it finds the first, the last or
1.5708 +any matching element as specified by the value of aMode.
1.5709 +
1.5710 +The function assumes that object pointers in the array are in address order.
1.5711 +
1.5712 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5713 +
1.5714 +@param anEntry The object pointer to be found.
1.5715 +@param anIndex A TInt type supplied by the caller. On return, it contains an index
1.5716 + value depending on whether a match is found and on the value of aMode.
1.5717 + If there is no matching element in the array, then this is the index
1.5718 + of the first element in the array that is bigger than the element being
1.5719 + searched for - if no elements in the array are bigger, then the index
1.5720 + value is the same as the total number of elements in the array.
1.5721 + If there is a matching element, then what the index refers to depends
1.5722 + on the value of aMode:
1.5723 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.5724 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.5725 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.5726 + the last matching element - if the last matching element is also the last element
1.5727 + of the array, then the index value is the same as the total number of elements in the array.
1.5728 +
1.5729 +@param aMode Specifies whether to find the first match, the last match or any match, as defined by
1.5730 + one of the TArrayFindMode enum values.
1.5731 +
1.5732 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5733 +
1.5734 +@see TArrayFindMode
1.5735 +*/
1.5736 +template <class T>
1.5737 +inline void RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt& anIndex, TInt aMode) const
1.5738 + { User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
1.5739 +
1.5740 +
1.5741 +/**
1.5742 +Finds the object pointer in the array whose object matches the specified
1.5743 +object, using a binary search technique and an ordering algorithm.
1.5744 +
1.5745 +Where there is more than one matching element, it finds the first, the last or any
1.5746 +matching element as specified by the value of aMode.
1.5747 +
1.5748 +The function assumes that existing object pointers in the array are ordered
1.5749 +so that the objects themselves are in object order as determined by an
1.5750 +algorithm supplied by the caller and packaged as a TLinearOrder<T>.
1.5751 +
1.5752 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5753 +
1.5754 +@param anEntry The object pointer to be found.
1.5755 +@param anIndex A TInt type supplied by the caller. On return, it contains an index
1.5756 + value depending on whether a match is found and on the value of aMode.
1.5757 + If there is no matching element in the array, then this is
1.5758 + the index of the first element in the array that is bigger than
1.5759 + the element being searched for - if no elements in the array are bigger,
1.5760 + then the index value is the same as the total number of elements in the array.
1.5761 + If there is a matching element, then what the index refers to depends
1.5762 + on the value of aMode:
1.5763 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.5764 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.5765 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.5766 + the last matching element - if the last matching element is also the last element of
1.5767 + the array, then the index value is the same as the total number of elements in the array.
1.5768 +
1.5769 +@param anOrder A package encapsulating the function which determines the order
1.5770 + of two class T objects.
1.5771 +@param aMode Specifies whether to find the first match, the last match or any match, as defined by
1.5772 + one of the TArrayFindModeenum values.
1.5773 +
1.5774 +@leave KErrNotFound, if no suitable object pointer can be found.
1.5775 +
1.5776 +@see TArrayFindMode
1.5777 +*/
1.5778 +template <class T>
1.5779 +inline void RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
1.5780 + { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode)); }
1.5781 +
1.5782 +
1.5783 +/**
1.5784 +Inserts an object pointer into the array in address order.
1.5785 +
1.5786 +No duplicate entries are permitted.
1.5787 +The function assumes that existing object pointers within the array are in
1.5788 +address order.
1.5789 +
1.5790 +The function leaves with one of the system wide error codes, if the operation fails.
1.5791 +
1.5792 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5793 +
1.5794 +@param anEntry The object pointer to be inserted.
1.5795 +*/
1.5796 +template <class T>
1.5797 +inline void RPointerArray<T>::InsertInAddressOrderL(const T* anEntry)
1.5798 + { User::LeaveIfError(InsertInAddressOrder(anEntry)); }
1.5799 +
1.5800 +
1.5801 +/**
1.5802 +Inserts an object pointer into the array so that the object itself is in object
1.5803 +order.
1.5804 +
1.5805 +The algorithm for determining the order of two class T objects is provided
1.5806 +by a function supplied by the caller.
1.5807 +
1.5808 +No duplicate entries are permitted.
1.5809 +
1.5810 +The function assumes that the array is ordered so that the referenced objects
1.5811 +are in object order.
1.5812 +
1.5813 +The function leaves with one of the system wide error codes, if the operation fails.
1.5814 +
1.5815 +Note that the array remains unchanged following an attempt to insert a duplicate
1.5816 +entry.
1.5817 +
1.5818 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5819 +
1.5820 +@param anEntry The object pointer to be inserted.
1.5821 +@param anOrder A package encapsulating the function which determines the order
1.5822 + of two class T objects.
1.5823 +*/
1.5824 +template <class T>
1.5825 +inline void RPointerArray<T>::InsertInOrderL(const T* anEntry, TLinearOrder<T> anOrder)
1.5826 + { User::LeaveIfError(InsertInOrder(anEntry, anOrder)); }
1.5827 +
1.5828 +
1.5829 +/**
1.5830 +Inserts an object pointer into the array in address order, allowing duplicates.
1.5831 +
1.5832 +If the new object pointer is a duplicate of an existing object pointer in
1.5833 +the array, then the new pointer is inserted after the existing one. If more
1.5834 +than one duplicate object pointer already exists in the array, then any new
1.5835 +duplicate pointer is inserted after the last one.
1.5836 +
1.5837 +The function assumes that existing object pointers within the array are in
1.5838 +address order.
1.5839 +
1.5840 +The function leaves with one of the system wide error codes, if the operation fails.
1.5841 +
1.5842 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5843 +
1.5844 +@param anEntry The object pointer to be inserted.
1.5845 +*/
1.5846 +template <class T>
1.5847 +inline void RPointerArray<T>::InsertInAddressOrderAllowRepeatsL(const T* anEntry)
1.5848 + { User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
1.5849 +
1.5850 +
1.5851 +/**
1.5852 +Inserts an object pointer into the array so that the object itself is in object
1.5853 +order, allowing duplicates
1.5854 +
1.5855 +The algorithm for determining the order of two class T objects is provided
1.5856 +by a function supplied by the caller.
1.5857 +
1.5858 +If the specified object is a duplicate of an existing object, then the new
1.5859 +pointer is inserted after the pointer to the existing object. If more than
1.5860 +one duplicate object already exists, then the new pointer is inserted after
1.5861 +the pointer to the last one.
1.5862 +
1.5863 +The function leaves with one of the system wide error codes, if the operation fails.
1.5864 +
1.5865 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5866 +
1.5867 +@param anEntry The object pointer to be inserted.
1.5868 +@param anOrder A package encapsulating the function which determines the order
1.5869 + of two class T objects.
1.5870 +*/
1.5871 +template <class T>
1.5872 +inline void RPointerArray<T>::InsertInOrderAllowRepeatsL(const T* anEntry, TLinearOrder<T> anOrder)
1.5873 + { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder)); }
1.5874 +
1.5875 +
1.5876 +
1.5877 +/**
1.5878 +Reserves space for the specified number of elements.
1.5879 +
1.5880 +After a call to this function, the memory allocated to the array is sufficient
1.5881 +to hold the number of object pointers specified. Adding new object pointers to the array
1.5882 +does not result in a re-allocation of memory until the the total number of
1.5883 +pointers exceeds the specified count.
1.5884 +
1.5885 +@param aCount The number of object pointers for which space should be reserved
1.5886 +@leave KErrNoMemory If the requested amount of memory could not be allocated
1.5887 +*/
1.5888 +template <class T>
1.5889 +inline void RPointerArray<T>::ReserveL(TInt aCount)
1.5890 + { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
1.5891 +
1.5892 +
1.5893 +
1.5894 +// Specialization for RPointerArray<TAny>
1.5895 +
1.5896 +/**
1.5897 +Appends an pointer onto the array.
1.5898 +
1.5899 +The function leaves with one of the system wide error codes, if the operation fails.
1.5900 +
1.5901 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5902 +
1.5903 +@param anEntry The pointer to be appended.
1.5904 +*/
1.5905 +inline void RPointerArray<TAny>::AppendL(const TAny* anEntry)
1.5906 + { User::LeaveIfError(Append(anEntry));}
1.5907 +
1.5908 +
1.5909 +/**
1.5910 +Inserts an pointer into the array at the specified position.
1.5911 +
1.5912 +The function leaves with one of the system wide error codes, if
1.5913 +the operation fails.
1.5914 +
1.5915 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5916 +
1.5917 +@param anEntry The pointer to be inserted.
1.5918 +@param aPos The position within the array where the pointer is to be
1.5919 + inserted. The position is relative to zero, i.e. zero implies
1.5920 + that a pointer is inserted at the beginning of the array.
1.5921 +
1.5922 +@panic USER 131, if aPos is negative, or is greater than the number of object
1.5923 + pointers currently in the array.
1.5924 +*/
1.5925 +inline void RPointerArray<TAny>::InsertL(const TAny* anEntry, TInt aPos)
1.5926 + { User::LeaveIfError(Insert(anEntry,aPos)); }
1.5927 +
1.5928 +
1.5929 +/**
1.5930 +Finds the first pointer in the array which matches the specified pointer, using
1.5931 +a sequential search.
1.5932 +
1.5933 +Matching is based on the comparison of pointers.
1.5934 +
1.5935 +The find operation always starts at the low index end of the array. There
1.5936 +is no assumption about the order of objects in the array.
1.5937 +
1.5938 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5939 +
1.5940 +@param anEntry The pointer to be found.
1.5941 +@return The index of the first matching pointer within the array.
1.5942 +@leave KErrNotFound, if no matching pointer can be found.
1.5943 +*/
1.5944 +inline TInt RPointerArray<TAny>::FindL(const TAny* anEntry) const
1.5945 + { return User::LeaveIfError(Find(anEntry));}
1.5946 +
1.5947 +
1.5948 +/**
1.5949 +Finds the last pointer in the array which matches the specified pointer, using
1.5950 +a sequential search.
1.5951 +
1.5952 +Matching is based on the comparison of pointers.
1.5953 +
1.5954 +The find operation always starts at the high index end of the array. There
1.5955 +is no assumption about the order of objects in the array.
1.5956 +
1.5957 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5958 +
1.5959 +@param anEntry The pointer to be found.
1.5960 +@return The index of the last matching pointer within the array.
1.5961 +@leave KErrNotFound, if no matching pointer can be found.
1.5962 +*/
1.5963 +inline TInt RPointerArray<TAny>::FindReverseL(const TAny* anEntry) const
1.5964 + { return User::LeaveIfError(FindReverse(anEntry));}
1.5965 +
1.5966 +
1.5967 +/**
1.5968 +Finds the pointer in the array that matches the specified pointer, using a
1.5969 +binary search technique.
1.5970 +
1.5971 +The function assumes that pointers in the array are in address order.
1.5972 +
1.5973 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5974 +
1.5975 +@param anEntry The pointer to be found.
1.5976 +
1.5977 +@return The index of the matching pointer within the array
1.5978 +@leave KErrNotFound, if no suitable pointer can be found.
1.5979 +*/
1.5980 +inline TInt RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry) const
1.5981 + { return User::LeaveIfError(FindInAddressOrder(anEntry));}
1.5982 +
1.5983 +
1.5984 +/**
1.5985 +Finds the pointer in the array that matches the specified pointer, using a
1.5986 +binary search technique.
1.5987 +
1.5988 +The function assumes that pointers in the array are in address order.
1.5989 +
1.5990 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.5991 +
1.5992 +@param anEntry The pointer to be found.
1.5993 +@param anIndex A reference to a TInt into which the
1.5994 + function puts an index value: If the function does not leave,
1.5995 + this is the index of the matching pointer within the array. If the
1.5996 + function leaves with KErrNotFound, this is the index of the last
1.5997 + pointer within the array which logically precedes
1.5998 + anEntry.
1.5999 +
1.6000 +@leave KErrNotFound, if no suitable pointer can be found.
1.6001 +*/
1.6002 +inline void RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry, TInt& anIndex) const
1.6003 + { User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
1.6004 +
1.6005 +
1.6006 +/**
1.6007 +Finds the pointer in the array that matches the specified pointer, using a
1.6008 +binary search technique.
1.6009 +
1.6010 +Where there is more than one matching element, it finds the first, the last
1.6011 +or any matching element as specified by the value of aMode.
1.6012 +
1.6013 +The function assumes that pointers in the array are in address order.
1.6014 +
1.6015 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6016 +
1.6017 +@param anEntry The pointer to be found.
1.6018 +@param aMode Specifies whether to find the first match, the last match or
1.6019 + any match, as defined by one of the TArrayFindMode enum values.
1.6020 +
1.6021 +@return If there is a matching element, the array index of a matching element - what
1.6022 + the index refers to depends on the value of aMode:
1.6023 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6024 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6025 + if this is EArrayFindMode_Last, then the index refers to first element that follows the
1.6026 + last matching element - if the last matching element is also the last element of the array,
1.6027 + then the index value is the same as the total number of elements in the array.
1.6028 +
1.6029 +@leave KErrNotFound if no matching entry exists.
1.6030 +
1.6031 +@see TArrayFindMode
1.6032 +*/
1.6033 +inline TInt RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt aMode) const
1.6034 + { return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
1.6035 +
1.6036 +
1.6037 +/**
1.6038 +Finds the pointer in the array that matches the specified pointer, using a
1.6039 +binary search technique.
1.6040 +
1.6041 +Where there is more than one matching element, it finds the first, the last or
1.6042 +any matching element as specified by the value of aMode.
1.6043 +
1.6044 +The function assumes that pointers in the array are in address order.
1.6045 +
1.6046 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6047 +
1.6048 +@param anEntry The pointer to be found.
1.6049 +@param anIndex A TInt type supplied by the caller. On return, it contains an index
1.6050 + value depending on whether a match is found and on the value of aMode.
1.6051 + If there is no matching element in the array, then this is the index
1.6052 + of the first element in the array that is bigger than the element being
1.6053 + searched for - if no elements in the array are bigger, then the index
1.6054 + value is the same as the total number of elements in the array.
1.6055 + If there is a matching element, then what the index refers to depends
1.6056 + on the value of aMode:
1.6057 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6058 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6059 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6060 + the last matching element - if the last matching element is also the last element
1.6061 + of the array, then the index value is the same as the total number of elements in the array.
1.6062 +
1.6063 +@param aMode Specifies whether to find the first match, the last match or any match, as defined by
1.6064 + one of the TArrayFindMode enum values.
1.6065 +
1.6066 +@leave KErrNotFound, if no suitable pointer can be found.
1.6067 +
1.6068 +@see TArrayFindMode
1.6069 +*/
1.6070 +inline void RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt& anIndex, TInt aMode) const
1.6071 + { User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
1.6072 +
1.6073 +
1.6074 +/**
1.6075 +Inserts an pointer into the array in address order.
1.6076 +
1.6077 +No duplicate entries are permitted. The function assumes that existing pointers
1.6078 +within the array are in address order.
1.6079 +
1.6080 +The function leaves with one of the system wide error codes, if the operation fails.
1.6081 +
1.6082 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6083 +
1.6084 +@param anEntry The pointer to be inserted.
1.6085 +*/
1.6086 +inline void RPointerArray<TAny>::InsertInAddressOrderL(const TAny* anEntry)
1.6087 + { User::LeaveIfError(InsertInAddressOrder(anEntry)); }
1.6088 +
1.6089 +
1.6090 +/**
1.6091 +Inserts an pointer into the array in address order, allowing duplicates.
1.6092 +
1.6093 +If the new pointer is a duplicate of an existing pointer in the array, then the
1.6094 +new pointer is inserted after the existing one. If more than one duplicate
1.6095 +pointer already exists in the array, then any new duplicate pointer is inserted
1.6096 +after the last one.
1.6097 +
1.6098 +The function assumes that existing pointers within the array are in address
1.6099 +order.
1.6100 +
1.6101 +The function leaves with one of the system wide error codes, if the operation fails.
1.6102 +
1.6103 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6104 +
1.6105 +@param anEntry The pointer to be inserted.
1.6106 +*/
1.6107 +inline void RPointerArray<TAny>::InsertInAddressOrderAllowRepeatsL(const TAny* anEntry)
1.6108 + { User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
1.6109 +
1.6110 +
1.6111 +/**
1.6112 +Apends an object onto the array.
1.6113 +
1.6114 +The function leaves with one of the system wide error codes, if the operation fails.
1.6115 +
1.6116 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6117 +
1.6118 +@param anEntry A reference to the object of type class T to be appended.
1.6119 +*/
1.6120 +template <class T>
1.6121 +inline void RArray<T>::AppendL(const T& anEntry)
1.6122 + { User::LeaveIfError(Append(anEntry));}
1.6123 +
1.6124 +
1.6125 +/**
1.6126 +Inserts an object into the array at a specified position.
1.6127 +
1.6128 +The function leaves with one of the system wide error codes, if the operation fails.
1.6129 +
1.6130 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6131 +
1.6132 +@param anEntry The class T object to be inserted.
1.6133 +@param aPos The position within the array where the object is to
1.6134 + be inserted. The position is relative to zero, i.e. zero
1.6135 + implies that an object is inserted at the beginning of
1.6136 + the array.
1.6137 +
1.6138 +@panic USER 131, if aPos is negative or is greater than the number of objects
1.6139 + currently in the array.
1.6140 +*/
1.6141 +template <class T>
1.6142 +inline void RArray<T>::InsertL(const T& anEntry, TInt aPos)
1.6143 + { User::LeaveIfError(Insert(anEntry, aPos));}
1.6144 +
1.6145 +
1.6146 +/**
1.6147 +Finds the first object in the array which matches the specified object using
1.6148 +a sequential search.
1.6149 +
1.6150 +Matching is based on the comparison of a TInt value at the key offset position
1.6151 +within the objects.
1.6152 +
1.6153 +The find operation always starts at the low index end of the array. There
1.6154 +is no assumption about the order of objects in the array.
1.6155 +
1.6156 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6157 +
1.6158 +@param anEntry A reference to an object of type class T to be used for matching.
1.6159 +
1.6160 +@return The index of the first matching object within the array.
1.6161 +@leave KErrNotFound, if no matching object can be found.
1.6162 +*/
1.6163 +template <class T>
1.6164 +inline TInt RArray<T>::FindL(const T& anEntry) const
1.6165 + { return User::LeaveIfError(Find(anEntry));}
1.6166 +
1.6167 +
1.6168 +/**
1.6169 +Finds the first object in the array which matches the specified object using
1.6170 +a sequential search and a matching algorithm.
1.6171 +
1.6172 +The algorithm for determining whether two class T type objects match is provided
1.6173 +by a function supplied by the caller.
1.6174 +
1.6175 +The find operation always starts at the low index end of the array. There
1.6176 +is no assumption about the order of objects in the array.
1.6177 +
1.6178 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6179 +
1.6180 +@param anEntry A reference to an object of type class T to be used
1.6181 + for matching.
1.6182 +@param anIdentity A package encapsulating the function which determines whether
1.6183 + two class T type objects match.
1.6184 +
1.6185 +@return The index of the first matching object within the array.
1.6186 +@leave KErrNotFound, if no matching object can be found.
1.6187 +*/
1.6188 +template <class T>
1.6189 +inline TInt RArray<T>::FindL(const T& anEntry, TIdentityRelation<T> anIdentity) const
1.6190 + { return User::LeaveIfError(Find(anEntry, anIdentity));}
1.6191 +
1.6192 +
1.6193 +/**
1.6194 +Finds the last object in the array which matches the specified object using
1.6195 +a sequential search.
1.6196 +
1.6197 +Matching is based on the comparison of a TInt value at the key offset position
1.6198 +within the objects.
1.6199 +
1.6200 +The find operation always starts at the high index end of the array. There
1.6201 +is no assumption about the order of objects in the array.
1.6202 +
1.6203 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6204 +
1.6205 +@param anEntry A reference to an object of type class T to be used for matching.
1.6206 +
1.6207 +@return The index of the last matching object within the array.
1.6208 +@leave KErrNotFound, if no matching object can be found.
1.6209 +*/
1.6210 +template <class T>
1.6211 +inline TInt RArray<T>::FindReverseL(const T& anEntry) const
1.6212 + { return User::LeaveIfError(FindReverse(anEntry));}
1.6213 +
1.6214 +
1.6215 +/**
1.6216 +Finds the last object in the array which matches the specified object using
1.6217 +a sequential search and a matching algorithm.
1.6218 +
1.6219 +The algorithm for determining whether two class T type objects match is provided
1.6220 +by a function supplied by the caller.
1.6221 +
1.6222 +The find operation always starts at the high index end of the array. There
1.6223 +is no assumption about the order of objects in the array.
1.6224 +
1.6225 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6226 +
1.6227 +@param anEntry A reference to an object of type class T to be used
1.6228 + for matching.
1.6229 +@param anIdentity A package encapsulating the function which determines whether
1.6230 + two class T type objects match.
1.6231 +
1.6232 +@return The index of the last matching object within the array.
1.6233 +@leave KErrNotFound, if no matching object can be found.
1.6234 +*/
1.6235 +template <class T>
1.6236 +inline TInt RArray<T>::FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) const
1.6237 + { return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
1.6238 +
1.6239 +
1.6240 +/**
1.6241 +Finds the object in the array which matches the specified object using a binary
1.6242 +search technique.
1.6243 +
1.6244 +The function assumes that existing objects within the array are in signed
1.6245 +key order.
1.6246 +
1.6247 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6248 +
1.6249 +@param anEntry A reference to an object of type class T to be used for matching.
1.6250 +
1.6251 +@return The index of the matching object within the array.
1.6252 +@leave KErrNotFound, if no matching object can be found.
1.6253 +*/
1.6254 +template <class T>
1.6255 +inline TInt RArray<T>::FindInSignedKeyOrderL(const T& anEntry) const
1.6256 + { return User::LeaveIfError(FindInSignedKeyOrder(anEntry));}
1.6257 +
1.6258 +
1.6259 +/**
1.6260 +Finds the object in the array which matches the specified object using a binary
1.6261 +search technique.
1.6262 +
1.6263 +The function assumes that existing objects within the array are in unsigned
1.6264 +key order.
1.6265 +
1.6266 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6267 +
1.6268 +@param anEntry A reference to an object of type class T to be used for matching.
1.6269 +
1.6270 +@return The index of the matching object within the array.
1.6271 +@leave KErrNotFound, if no matching object can be found.
1.6272 +*/
1.6273 +template <class T>
1.6274 +inline TInt RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry) const
1.6275 + { return User::LeaveIfError(FindInUnsignedKeyOrder(anEntry));}
1.6276 +
1.6277 +
1.6278 +/**
1.6279 +Finds the object in the array which matches the specified object using a binary
1.6280 +search technique and an ordering algorithm.
1.6281 +
1.6282 +The function assumes that existing objects within the array are in object
1.6283 +order as determined by an algorithm supplied by the caller and packaged as
1.6284 +a TLinearOrder<T>.
1.6285 +
1.6286 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6287 +
1.6288 +@param anEntry A reference to an object of type class T to be used for matching.
1.6289 +@param anOrder A package encapsulating the function which determines the order
1.6290 + of two class T objects.
1.6291 +
1.6292 +@return The index of the matching object within the array.
1.6293 +@leave KErrNotFound if no matching object can be found.
1.6294 +*/
1.6295 +template <class T>
1.6296 +inline TInt RArray<T>::FindInOrderL(const T& anEntry, TLinearOrder<T> anOrder) const
1.6297 +{ return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
1.6298 +
1.6299 +
1.6300 +/**
1.6301 +Finds the object in the array which matches the specified object using a binary
1.6302 +search technique.
1.6303 +
1.6304 +The function assumes that existing objects within the array are in signed
1.6305 +key order.
1.6306 +
1.6307 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6308 +
1.6309 +@param anEntry A reference to an object of type class T to be used for matching.
1.6310 +@param anIndex On return contains an index value of the matching object within the array.
1.6311 + If the function leaves with KErrNotFound,this is the index of the
1.6312 + first element in the array whose key is bigger than the key of the
1.6313 + element being sought. If there are no elements in the array with
1.6314 + a bigger key, then the index value is the same as the total
1.6315 + number of elements in the array.
1.6316 +@leave KErrNotFound, if no matching object can be found.
1.6317 +*/
1.6318 +template <class T>
1.6319 +inline void RArray<T>::FindInSignedKeyOrderL(const T& anEntry, TInt& anIndex) const
1.6320 + { User::LeaveIfError(FindInSignedKeyOrder(anEntry, anIndex));}
1.6321 +
1.6322 +
1.6323 +/**
1.6324 +Finds the object in the array which matches the specified object using a binary
1.6325 +search technique.
1.6326 +
1.6327 +The function assumes that existing objects within the array are in unsigned
1.6328 +key order.
1.6329 +
1.6330 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6331 +
1.6332 +@param anEntry A reference to an object of type class T to be used for matching.
1.6333 +@param anIndex On return contains an index value of the matching object within the array.
1.6334 + If the function leaves with KErrNotFound, this is the index of the
1.6335 + first element in the array whose key is bigger than the key of the
1.6336 + element being sought. If there are no elements in the array with
1.6337 + a bigger key, then the index value is the same as the total
1.6338 + number of elements in the array.
1.6339 +@leave KErrNotFound, if no matching object can be found.
1.6340 +*/
1.6341 +template <class T>
1.6342 +inline void RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex) const
1.6343 + { User::LeaveIfError(FindInUnsignedKeyOrder(anEntry, anIndex));}
1.6344 +
1.6345 +
1.6346 +/**
1.6347 +Finds the object in the array which matches the specified object using a binary
1.6348 +search technique and an ordering algorithm.
1.6349 +
1.6350 +The function assumes that existing objects within the array are in object
1.6351 +order as determined by an algorithm supplied by the caller and packaged as
1.6352 +a TLinearOrder<T>.
1.6353 +
1.6354 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6355 +
1.6356 +@param anEntry A reference to an object of type class T to be used for matching.
1.6357 +@param anIndex On return contains the index value of the matching object within the array
1.6358 + If the function leaves with KErrNotFound, this is the index of
1.6359 + the first element in the array that is bigger than the element
1.6360 + being searched for - if no elements in the array are bigger,
1.6361 + then the index value is the same as the total number of elements
1.6362 + in the array.
1.6363 +@param anOrder A package encapsulating the function which determines the order
1.6364 + of two class T objects.
1.6365 +
1.6366 +@leave KErrNotFound if no matching object can be found.
1.6367 +*/
1.6368 +template <class T>
1.6369 +inline void RArray<T>::FindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
1.6370 + { User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder));}
1.6371 +
1.6372 +
1.6373 +/**
1.6374 +Finds the object in the array which matches the specified object using a binary
1.6375 +search technique.
1.6376 +
1.6377 +The element ordering is determined by a signed 32-bit word
1.6378 +(the key) embedded in each array element. In the case that there is more than
1.6379 +one matching element, finds the first, last or any match as specified.
1.6380 +
1.6381 +The function assumes that existing objects within the array are in signed
1.6382 +key order.
1.6383 +
1.6384 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6385 +
1.6386 +@param anEntry A reference to an object of type class T to be used for matching.
1.6387 +@param aMode Specifies whether to find the first match, the last match or
1.6388 + any match, as defined by one of the TArrayFindMode enum values.
1.6389 +
1.6390 +@return The array index of a matching element - what the index refers to
1.6391 + depends on the value of aMode:
1.6392 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6393 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6394 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6395 + the last matching element - if the last matching element is also the last element of
1.6396 + the array, then the index value is the same as the total number of elements in the array.
1.6397 +@leave KErrNotFound if no matching entry exists.
1.6398 +
1.6399 +@see TArrayFindMode
1.6400 +*/
1.6401 +template <class T>
1.6402 +inline TInt RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt aMode) const
1.6403 +{ return User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, aMode));}
1.6404 +
1.6405 +
1.6406 +/**
1.6407 +Finds the object in the array which matches the specified object using a binary
1.6408 +search technique.
1.6409 +
1.6410 +The element ordering is determined by an unsigned 32-bit word
1.6411 +(the key) embedded in each array element. In the case that there is more than
1.6412 +one matching element, finds the first, last or any match as specified.
1.6413 +
1.6414 +The function assumes that existing objects within the array are in unsigned
1.6415 +key order.
1.6416 +
1.6417 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6418 +
1.6419 +@param anEntry A reference to an object of type class T to be used for matching.
1.6420 +@param aMode Specifies whether to find the first match, the last match or any
1.6421 + match, as defined by one of the TArrayFindMode enum values.
1.6422 +
1.6423 +@return The array index of a matching element - what the index refers to
1.6424 + depends on the value of aMode:
1.6425 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6426 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6427 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6428 + the last matching element - if the last matching element is also the last element
1.6429 + of the array, then the index value is the same as the total number of elements in the array.
1.6430 +
1.6431 +@leave KErrNotFound if no matching entry exists.
1.6432 +
1.6433 +@see TArrayFindMode
1.6434 +*/
1.6435 +template <class T>
1.6436 +inline TInt RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt aMode) const
1.6437 + { return User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, aMode));}
1.6438 +
1.6439 +
1.6440 +/**
1.6441 +Finds the object in the array which matches the specified object using a binary
1.6442 +search technique and an ordering algorithm.
1.6443 +
1.6444 +Where there is more than one matching element, it finds the first, the last or
1.6445 +any matching element as specified by the value of aMode.
1.6446 +
1.6447 +The function assumes that existing objects within the array are in object
1.6448 +order as determined by an algorithm supplied by the caller and packaged as
1.6449 +a TLinearOrder<T> type.
1.6450 +
1.6451 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6452 +
1.6453 +@param anEntry A reference to an object of type class T to be used for matching.
1.6454 +@param anOrder A package encapsulating the function which determines the order
1.6455 + of two class T objects.
1.6456 +@param aMode Specifies whether to find the first match, the last match or any match,
1.6457 + as defined by one of the TArrayFindMode enum values.
1.6458 +
1.6459 +@return The array index of a matching element - what the index refers to
1.6460 + depends on the value of aMode:
1.6461 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6462 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6463 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6464 + the last matching element - if the last matching element is also the last element
1.6465 + of the array, then the index value is the same as the total number of elements in the array.
1.6466 +
1.6467 +@leave KErrNotFound if no matching entry exists.
1.6468 +
1.6469 +@see TArrayFindMode
1.6470 +*/
1.6471 +template <class T>
1.6472 +inline TInt RArray<T>::SpecificFindInOrderL(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const
1.6473 +{ return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
1.6474 +
1.6475 +
1.6476 +/**
1.6477 +Finds the object in the array which matches the specified object using a binary
1.6478 +search technique.
1.6479 +
1.6480 +The element ordering is determined by a signed 32-bit word
1.6481 +(the key) embedded in each array element. In the case that there is more than
1.6482 +one matching element, finds the first, last or any match as specified.
1.6483 +
1.6484 +The function assumes that existing objects within the array are in signed
1.6485 +key order.
1.6486 +
1.6487 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6488 +
1.6489 +@param anEntry A reference to an object of type class T to be used for matching.
1.6490 +@param anIndex A TInt type supplied by the caller. On return, it contains an
1.6491 + index value depending on whether a match is found and on the
1.6492 + value of aMode. If there is no matching element in the array,
1.6493 + then this is the index of the first element in the array that
1.6494 + is bigger than the element being searched for - if no elements
1.6495 + in the array are bigger, then the index value is the same as
1.6496 + the total number of elements in the array.
1.6497 + If there is a matching element, then what the index refers to
1.6498 + depends on the value of aMode:
1.6499 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6500 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6501 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6502 + the last matching element - if the last matching element is also the last element
1.6503 + of the array, then the index value is the same as the total number of elements
1.6504 + in the array.
1.6505 +@param aMode Specifies whether to find the first match, the last match or any match,
1.6506 + as defined by one of the TArrayFindMode enum values.
1.6507 +
1.6508 +@leave KErrNotFound if no matching entry exists.
1.6509 +
1.6510 +@see TArrayFindMode
1.6511 +*/
1.6512 +template <class T>
1.6513 +inline void RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
1.6514 + { User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, anIndex, aMode));}
1.6515 +
1.6516 +
1.6517 +/**
1.6518 +Finds the object in the array which matches the specified object using a binary
1.6519 +search technique.
1.6520 +
1.6521 +The element ordering is determined by an unsigned 32-bit word
1.6522 +(the key) embedded in each array element. In the case that there is more than
1.6523 +one matching element, finds the first, last or any match as specified.
1.6524 +
1.6525 +The function assumes that existing objects within the array are in unsigned
1.6526 +key order.
1.6527 +
1.6528 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6529 +
1.6530 +@param anEntry A reference to an object of type class T to be used for matching.
1.6531 +@param anIndex A TInt type supplied by the caller. On return, it contains an
1.6532 + index value depending on whether a match is found and on the
1.6533 + value of aMode. If there is no matching element in the array,
1.6534 + then this is the index of the first element in the array that
1.6535 + is bigger than the element being searched for - if no elements
1.6536 + in the array are bigger, then the index value is the same as
1.6537 + the total number of elements in the array. If there is a matching
1.6538 + element, then what the index refers to depends on the value of aMode:
1.6539 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6540 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6541 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6542 + the last matching element - if the last matching element is also the last element
1.6543 + of the array, then the index value is the same as the total number of elements in the array.
1.6544 +@param aMode Specifies whether to find the first match, the last match or any match,
1.6545 + as defined by one of the TArrayFindMode enum values.
1.6546 +
1.6547 +@leave KErrNotFound if no matching entry exists.
1.6548 +
1.6549 +@see TArrayFindMode
1.6550 +*/
1.6551 +template <class T>
1.6552 +inline void RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
1.6553 + { User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, anIndex, aMode));}
1.6554 +
1.6555 +
1.6556 +/**
1.6557 +Finds the object in the array which matches the specified object using a binary
1.6558 +search technique and a specified ordering algorithm.
1.6559 +
1.6560 +Where there is more than one matching element, it finds the first, the last or
1.6561 +any matching element as specified by the value of aMode.
1.6562 +
1.6563 +The function assumes that existing objects within the array are in object
1.6564 +order as determined by an algorithm supplied by the caller and packaged as
1.6565 +a TLinearOrder<T> type.
1.6566 +
1.6567 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6568 +
1.6569 +@param anEntry A reference to an object of type class T to be used for matching.
1.6570 +@param anIndex A TInt type supplied by the caller. On return, it contains an
1.6571 + index value depending on whether a match is found and on the value
1.6572 + of aMode. If there is no matching element in the array, then this is
1.6573 + the index of the first element in the array that is bigger than the
1.6574 + element being searched for - if no elements in the array are bigger,
1.6575 + then the index value is the same as the total number of elements
1.6576 + in the array. If there is a matching element, then what the index
1.6577 + refers to depends on the value of aMode:
1.6578 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6579 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6580 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6581 + the last matching element - if the last matching element is also the last element
1.6582 + of the array, then the index value is the same as the total number of elements in the array.
1.6583 +
1.6584 +@param anOrder A package encapsulating the function which determines the order
1.6585 + of two class T objects.
1.6586 +@param aMode Specifies whether to find the first match, the last match or any match,
1.6587 + as defined by one of the TArrayFindMode enum values.
1.6588 +
1.6589 +@leave KErrNotFound if no matching entry exists.
1.6590 +
1.6591 +@see TArrayFindMode
1.6592 +*/
1.6593 +template <class T>
1.6594 +inline void RArray<T>::SpecificFindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
1.6595 + { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode));}
1.6596 +
1.6597 +
1.6598 +/**
1.6599 +Inserts an object into the array in ascending signed key order.
1.6600 +
1.6601 +The order of two class T type objects is based on comparing a TInt value
1.6602 +located at the key offset position within the class T object.
1.6603 +
1.6604 +No duplicate entries are permitted.
1.6605 +
1.6606 +The function leaves with one of the system wide error codes, if the operation fails.
1.6607 +
1.6608 +Note that the array remains unchanged following an attempt to insert a duplicate entry.
1.6609 +
1.6610 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6611 +
1.6612 +@param anEntry A reference to the object of type class T to be inserted.
1.6613 +*/
1.6614 +template <class T>
1.6615 +inline void RArray<T>::InsertInSignedKeyOrderL(const T& anEntry)
1.6616 + { User::LeaveIfError(InsertInSignedKeyOrder(anEntry));}
1.6617 +
1.6618 +
1.6619 +/**
1.6620 +Inserts an object into the array in ascending unsigned key order, not allowing
1.6621 +duplicate entries.
1.6622 +
1.6623 +The order of two class T type objects is based on comparing a TUint value
1.6624 +located at the key offset position within the class T object.
1.6625 +
1.6626 +The function leaves with one of the system wide error codes, if the operation fails.
1.6627 +
1.6628 +Note that the array remains unchanged following an attempt to insert a duplicate entry.
1.6629 +
1.6630 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6631 +
1.6632 +@param anEntry A reference to the object of type class T to be inserted.
1.6633 +*/
1.6634 +template <class T>
1.6635 +inline void RArray<T>::InsertInUnsignedKeyOrderL(const T& anEntry)
1.6636 + { User::LeaveIfError(InsertInUnsignedKeyOrder(anEntry));}
1.6637 +
1.6638 +
1.6639 +/**
1.6640 +Inserts an object of into the array in object order.
1.6641 +
1.6642 +The algorithm for determining the order of two class T type objects is provided
1.6643 +by a function supplied by the caller.
1.6644 +
1.6645 +No duplicate entries are permitted.
1.6646 +
1.6647 +The function assumes that existing objects within the array are in object
1.6648 +order.
1.6649 +
1.6650 +The function leaves with one of the system wide error codes, if the operation fails.
1.6651 +
1.6652 +Note that the array remains unchanged following an attempt to insert a duplicate entry.
1.6653 +
1.6654 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6655 +
1.6656 +@param anEntry A reference to the object of type class T to be inserted.
1.6657 +@param anOrder A package encapsulating the function which determines the order
1.6658 + of two class T objects.
1.6659 +*/
1.6660 +template <class T>
1.6661 +inline void RArray<T>::InsertInOrderL(const T& anEntry, TLinearOrder<T> anOrder)
1.6662 + { User::LeaveIfError(InsertInOrder(anEntry, anOrder));}
1.6663 +
1.6664 +
1.6665 +/**
1.6666 +Inserts an object into the array in ascending signed key order,
1.6667 +allowing duplicates.
1.6668 +
1.6669 +The order of two class T type objects is based on comparing a TInt value
1.6670 +located at the key offset position within the class T object.
1.6671 +
1.6672 +If anEntry is a duplicate of an existing object in the array, then the new
1.6673 +object is inserted after the existing object. If more than one duplicate object
1.6674 +already exists in the array, then any new duplicate object is inserted after
1.6675 +the last one.
1.6676 +
1.6677 +The function leaves with one of the system wide error codes, if the operation fails.
1.6678 +
1.6679 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6680 +
1.6681 +@param anEntry A reference to the object of type class T to be inserted.
1.6682 +*/
1.6683 +template <class T>
1.6684 +inline void RArray<T>::InsertInSignedKeyOrderAllowRepeatsL(const T& anEntry)
1.6685 + { User::LeaveIfError(InsertInSignedKeyOrderAllowRepeats(anEntry));}
1.6686 +
1.6687 +
1.6688 +/**
1.6689 +Inserts an object into the array in ascending unsigned key order, allowing
1.6690 +duplicates.
1.6691 +
1.6692 +The order of two class T type objects is based on comparing a TUint value
1.6693 +located at the key offset position within the class T object.
1.6694 +
1.6695 +If anEntry is a duplicate of an existing object in the array, then the new
1.6696 +object is inserted after the existing object. If more than one duplicate object
1.6697 +already exists in the array, then any new duplicate object is inserted after
1.6698 +the last one.
1.6699 +
1.6700 +The function leaves with one of the system wide error codes, if the operation fails.
1.6701 +
1.6702 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6703 +
1.6704 +@param anEntry A reference to the object of type class T to be inserted.
1.6705 +*/
1.6706 +template <class T>
1.6707 +inline void RArray<T>::InsertInUnsignedKeyOrderAllowRepeatsL(const T& anEntry)
1.6708 + { User::LeaveIfError(InsertInUnsignedKeyOrderAllowRepeats(anEntry));}
1.6709 +
1.6710 +
1.6711 +/**
1.6712 +Inserts an object into the array in object order, allowing duplicates.
1.6713 +
1.6714 +The algorithm for determining the order of two class T type objects is provided
1.6715 +by a function supplied by the caller.
1.6716 +
1.6717 +If anEntry is a duplicate of an existing object in the array, then the new
1.6718 +object is inserted after the existing object. If more than one duplicate object
1.6719 +already exists in the array, then anEntry is inserted after the last one.
1.6720 +
1.6721 +The function assumes that existing objects within the array are in object
1.6722 +order.
1.6723 +
1.6724 +The function leaves with one of the system wide error codes, if the operation fails.
1.6725 +
1.6726 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6727 +
1.6728 +@param anEntry A reference to the object of type class T to be inserted.
1.6729 +@param anOrder A package encapsulating the function which determines the order
1.6730 + of two class T objects.
1.6731 +*/
1.6732 +template <class T>
1.6733 +inline void RArray<T>::InsertInOrderAllowRepeatsL(const T& anEntry, TLinearOrder<T> anOrder)
1.6734 + { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder));}
1.6735 +
1.6736 +
1.6737 +
1.6738 +/**
1.6739 +Reserves space for the specified number of elements.
1.6740 +
1.6741 +After a call to this function, the memory allocated to the array is sufficient
1.6742 +to hold the number of objects specified. Adding new objects to the array
1.6743 +does not result in a re-allocation of memory until the the total number of
1.6744 +objects exceeds the specified count.
1.6745 +
1.6746 +@param aCount The number of objects for which space should be reserved
1.6747 +@leave KErrNoMemory If the requested amount of memory could not be allocated
1.6748 +*/
1.6749 +template <class T>
1.6750 +inline void RArray<T>::ReserveL(TInt aCount)
1.6751 + { User::LeaveIfError(RArrayBase::DoReserve(aCount)); }
1.6752 +
1.6753 +
1.6754 +
1.6755 +
1.6756 +/**
1.6757 +Appends a signed integer onto the array.
1.6758 +
1.6759 +The function leaves with one of the system wide error codes, if the operation fails.
1.6760 +
1.6761 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6762 +
1.6763 +@param anEntry The signed integer to be appended.
1.6764 +*/
1.6765 +inline void RArray<TInt>::AppendL(TInt anEntry)
1.6766 + { User::LeaveIfError(Append(anEntry));}
1.6767 +
1.6768 +
1.6769 +/**
1.6770 +Inserts a signed integer into the array at the specified position.
1.6771 +
1.6772 +The function leaves with one of the system wide error codes, if the operation fails.
1.6773 +
1.6774 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6775 +
1.6776 +@param anEntry The signed integer to be inserted.
1.6777 +@param aPos The position within the array where the signed integer is to be
1.6778 + inserted. The position is relative to zero, i.e. zero implies
1.6779 + that an entry is inserted at the beginning of the array.
1.6780 +
1.6781 +@panic USER 131, if aPos is negative, or is greater than the number of entries
1.6782 + currently in the array.
1.6783 +*/
1.6784 +inline void RArray<TInt>::InsertL(TInt anEntry, TInt aPos)
1.6785 + { User::LeaveIfError(Insert(anEntry, aPos));}
1.6786 +
1.6787 +
1.6788 +/**
1.6789 +Finds the first signed integer in the array which matches the specified signed
1.6790 +integer using a sequential search.
1.6791 +
1.6792 +The find operation always starts at the low index end of the array. There
1.6793 +is no assumption about the order of entries in the array.
1.6794 +
1.6795 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6796 +
1.6797 +@param anEntry The signed integer to be found.
1.6798 +
1.6799 +@return The index of the first matching signed integer within the array.
1.6800 +@leave KErrNotFound, if no matching entry can be found.
1.6801 +*/
1.6802 +inline TInt RArray<TInt>::FindL(TInt anEntry) const
1.6803 + { return User::LeaveIfError(Find(anEntry));}
1.6804 +
1.6805 +
1.6806 +/**
1.6807 +Finds the last signed integer in the array which matches the specified signed
1.6808 +integer using a sequential search.
1.6809 +
1.6810 +The find operation always starts at the high index end of the array. There
1.6811 +is no assumption about the order of entries in the array.
1.6812 +
1.6813 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6814 +
1.6815 +@param anEntry The signed integer to be found.
1.6816 +
1.6817 +@return The index of the last matching signed integer within the array.
1.6818 +@leave KErrNotFound, if no matching entry can be found.
1.6819 +*/
1.6820 +inline TInt RArray<TInt>::FindReverseL(TInt anEntry) const
1.6821 + { return User::LeaveIfError(FindReverse(anEntry));}
1.6822 +
1.6823 +
1.6824 +/**
1.6825 +Finds the signed integer in the array that matches the specified signed integer
1.6826 +using a binary search technique.
1.6827 +
1.6828 +The function assumes that the array is in signed integer order.
1.6829 +
1.6830 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6831 +
1.6832 +@param anEntry The signed integer to be found.
1.6833 +
1.6834 +@return The index of the matching signed integer within the array.
1.6835 +@leave KErrNotFound, if no match can be found.
1.6836 +*/
1.6837 +inline TInt RArray<TInt>::FindInOrderL(TInt anEntry) const
1.6838 + { return User::LeaveIfError(FindInOrder(anEntry));}
1.6839 +
1.6840 +
1.6841 +/**
1.6842 +Finds the signed integer in the array that matches the specified signed integer
1.6843 +using a binary search technique.
1.6844 +
1.6845 +The function assumes that the array is in signed integer order.
1.6846 +
1.6847 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6848 +
1.6849 +@param anEntry The signed integer to be found.
1.6850 +@param anIndex A reference to a signed integer into which the
1.6851 + function puts an index value: If the function returns ,
1.6852 + this is the index of the matching signed integer within the
1.6853 + array. If the function leaves with KErrNotFound, this is the
1.6854 + index of the first signed integer within the array that is
1.6855 + bigger than the signed integer being searched for - if no
1.6856 + signed integers within the array are bigger, then the index
1.6857 + value is the same as the total number of signed integers
1.6858 + within the array.
1.6859 +@leave KErrNotFound if no match can be found.
1.6860 +*/
1.6861 +inline void RArray<TInt>::FindInOrderL(TInt anEntry, TInt& anIndex) const
1.6862 + { User::LeaveIfError(FindInOrder(anEntry, anIndex));}
1.6863 +
1.6864 +
1.6865 +/**
1.6866 +Finds the signed integer in the array that matches the specified signed integer
1.6867 +using a binary search technique.
1.6868 +
1.6869 +Where there is more than one matching element, it finds the first, last or any
1.6870 +matching element as specified by the value of aMode.
1.6871 +
1.6872 +The function assumes that the array is in signed integer order.
1.6873 +
1.6874 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6875 +
1.6876 +@param anEntry The signed integer to be found.
1.6877 +@param aMode Specifies whether to find the first match, the last match or
1.6878 + any match, as defined by one of the TArrayFindMode enum values.
1.6879 +
1.6880 +@return The array index of a matching element - what the index refers to
1.6881 + depends on the value of aMode:
1.6882 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6883 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6884 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6885 + the last matching element - if the last matching element is also the last element
1.6886 + of the array, then the index value is the same as the total number of elements in the array.
1.6887 +
1.6888 +@leave KErrNotFound if no matching entry exists.
1.6889 +
1.6890 +@see TArrayFindMode
1.6891 +*/
1.6892 +inline TInt RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt aMode) const
1.6893 + { return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
1.6894 +
1.6895 +
1.6896 +/**
1.6897 +Finds the signed integer in the array that matches the specified signed integer
1.6898 +using a binary search technique.
1.6899 +
1.6900 +Where there is more than one matching element, it finds the first, last or any
1.6901 +matching element as specified by the value of aMode.
1.6902 +
1.6903 +The function assumes that the array is in signed integer order.
1.6904 +
1.6905 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6906 +
1.6907 +@param anEntry The signed integer to be found.
1.6908 +@param anIndex A TInt type supplied by the caller. On return, it contains an
1.6909 + index value depending on whether a match is found and on the value of aMode.
1.6910 + If there is no matching element in the array, then this is
1.6911 + the index of the first element in the array that is bigger
1.6912 + than the element being searched for - if no elements in the
1.6913 + array are bigger, then the index value is the same as the total
1.6914 + number of elements in the array. If there is a matching element,
1.6915 + then what the index refers to depends on the value of aMode:
1.6916 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.6917 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.6918 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.6919 + the last matching element - if the last matching element is also the last element
1.6920 + of the array, then the index value is the same as the total number of elements in the array.
1.6921 +
1.6922 +@param aMode Specifies whether to find the first match, the last match or any match, as defined
1.6923 + by one of the TArrayFindMode enum values.
1.6924 +
1.6925 +@leave KErrNotFound if no matching entry exists.
1.6926 +
1.6927 +@see TArrayFindMode
1.6928 +*/
1.6929 +inline void RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt& anIndex, TInt aMode) const
1.6930 + { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
1.6931 +
1.6932 +
1.6933 +/**
1.6934 +Inserts a signed integer into the array in signed integer order.
1.6935 +
1.6936 +No duplicate entries are permitted.
1.6937 +
1.6938 +The function assumes that existing entries within the array are in signed
1.6939 +integer order.
1.6940 +
1.6941 +The function leaves with one of the system wide error codes, if the operation fails.
1.6942 +
1.6943 +Note that the array remains unchanged following an attempt to insert a duplicate entry.
1.6944 +
1.6945 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6946 +
1.6947 +@param anEntry The signed integer to be inserted.
1.6948 +*/
1.6949 +inline void RArray<TInt>::InsertInOrderL(TInt anEntry)
1.6950 + { User::LeaveIfError(InsertInOrder(anEntry));}
1.6951 +
1.6952 +
1.6953 +/**
1.6954 +Inserts a signed integer into the array in signed integer order,
1.6955 +allowing duplicates.
1.6956 +
1.6957 +If anEntry is a duplicate of an existing entry in the array, then the new
1.6958 +signed integer is inserted after the existing one. If more than one duplicate
1.6959 +entry already exists in the array, then any new duplicate signed integer is
1.6960 +inserted after the last one.
1.6961 +
1.6962 +The function assumes that existing entries within the array are in signed
1.6963 +integer order.
1.6964 +
1.6965 +The function leaves with one of the system wide error codes, if the operation fails.
1.6966 +
1.6967 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6968 +
1.6969 +@param anEntry The signed integer to be inserted.
1.6970 +*/
1.6971 +inline void RArray<TInt>::InsertInOrderAllowRepeatsL(TInt anEntry)
1.6972 + { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
1.6973 +
1.6974 +
1.6975 +
1.6976 +/**
1.6977 +Reserves space for the specified number of elements.
1.6978 +
1.6979 +After a call to this function, the memory allocated to the array is sufficient
1.6980 +to hold the number of integers specified. Adding new integers to the array
1.6981 +does not result in a re-allocation of memory until the the total number of
1.6982 +integers exceeds the specified count.
1.6983 +
1.6984 +@param aCount The number of integers for which space should be reserved
1.6985 +@leave KErrNoMemory If the requested amount of memory could not be allocated
1.6986 +*/
1.6987 +inline void RArray<TInt>::ReserveL(TInt aCount)
1.6988 + { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
1.6989 +
1.6990 +
1.6991 +
1.6992 +
1.6993 +/**
1.6994 +Appends an unsigned integer onto the array.
1.6995 +
1.6996 +The function leaves with one of the system wide error codes, if the operation fails.
1.6997 +
1.6998 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.6999 +
1.7000 +@param anEntry The unsigned integer to be appended.
1.7001 +*/
1.7002 +inline void RArray<TUint>::AppendL(TUint anEntry)
1.7003 + { User::LeaveIfError(Append(anEntry));}
1.7004 +
1.7005 +
1.7006 +/**
1.7007 +Inserts an unsigned integer into the array at the specified position.
1.7008 +
1.7009 +The function leaves with one of the system wide error codes, if the operation fails.
1.7010 +
1.7011 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7012 +
1.7013 +@param anEntry The unsigned integer to be inserted.
1.7014 +@param aPos The position within the array where the unsigned integer is to
1.7015 + be inserted. The position is relative to zero, i.e. zero
1.7016 + implies that an entry is inserted at the beginning of
1.7017 + the array.
1.7018 +
1.7019 +@panic USER 131, if aPos is negative, or is greater than the number of entries
1.7020 + currently in the array.
1.7021 +*/
1.7022 +inline void RArray<TUint>::InsertL(TUint anEntry, TInt aPos)
1.7023 + { User::LeaveIfError(Insert(anEntry, aPos));}
1.7024 +
1.7025 +
1.7026 +/**
1.7027 +Finds the first unsigned integer in the array which matches the specified
1.7028 +value, using a sequential search.
1.7029 +
1.7030 +The find operation always starts at the low index end of the array. There
1.7031 +is no assumption about the order of entries in the array.
1.7032 +
1.7033 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7034 +
1.7035 +@param anEntry The unsigned integer to be found.
1.7036 +@return The index of the first matching unsigned integer within the array.
1.7037 +@leave KErrNotFound, if no matching entry can be found.
1.7038 +*/
1.7039 +inline TInt RArray<TUint>::FindL(TUint anEntry) const
1.7040 + { return User::LeaveIfError(Find(anEntry));}
1.7041 +
1.7042 +
1.7043 +/**
1.7044 +Finds the last unsigned integer in the array which matches the specified
1.7045 +value, using a sequential search.
1.7046 +
1.7047 +The find operation always starts at the high index end of the array. There
1.7048 +is no assumption about the order of entries in the array.
1.7049 +
1.7050 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7051 +
1.7052 +@param anEntry The unsigned integer to be found.
1.7053 +@return The index of the last matching unsigned integer within the array.
1.7054 +@leave KErrNotFound, if no matching entry can be found.
1.7055 +*/
1.7056 +inline TInt RArray<TUint>::FindReverseL(TUint anEntry) const
1.7057 + { return User::LeaveIfError(FindReverse(anEntry));}
1.7058 +
1.7059 +
1.7060 +/**
1.7061 +Finds the unsigned integer in the array which matches the specified value,
1.7062 +using a binary search technique.
1.7063 +
1.7064 +The functions assume that existing entries within the array are in unsigned
1.7065 +integer order.
1.7066 +
1.7067 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7068 +
1.7069 +@param anEntry The unsigned integer to be found.
1.7070 +
1.7071 +@return The index of the matching unsigned integer within the array;
1.7072 +@leave KErrNotFound, if no matching entry can be found.
1.7073 +*/
1.7074 +inline TInt RArray<TUint>::FindInOrderL(TUint anEntry) const
1.7075 + { return User::LeaveIfError(FindInOrder(anEntry));}
1.7076 +
1.7077 +
1.7078 +/**
1.7079 +Finds the unsigned integer in the array which matches the specified value,
1.7080 +using a binary search technique.
1.7081 +
1.7082 +If the index cannot be found, the function returns the index of the last
1.7083 +unsigned integer within the array which logically precedes anEntry.
1.7084 +The functions assume that existing entries within the array are in unsigned
1.7085 +integer order.
1.7086 +
1.7087 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7088 +
1.7089 +@param anEntry The unsigned integer to be found.
1.7090 +@param anIndex A TInt supplied by the caller. On return, contains an index
1.7091 + value of the matching unsigned integer within the array.
1.7092 + If the function leaves with KErrNotFound, this is the index of the
1.7093 + first unsigned integer within the array that is bigger than the
1.7094 + unsigned integer being searched for - if no unsigned integers within
1.7095 + the array are bigger, then the index value is the same as the
1.7096 + total number of unsigned integers within the array.
1.7097 +
1.7098 +@leave KErrNotFound, if no matching entry can be found.
1.7099 +*/
1.7100 +inline void RArray<TUint>::FindInOrderL(TUint anEntry, TInt& anIndex) const
1.7101 + { User::LeaveIfError(FindInOrder(anEntry, anIndex));}
1.7102 +
1.7103 +
1.7104 +/**
1.7105 +Finds the unsigned integer in the array that matches the specified unsigned integer
1.7106 +using a binary search technique.
1.7107 +
1.7108 +In the case that there is more than one matching element, finds the first, last or any
1.7109 +match as specified.
1.7110 +
1.7111 +The function assumes that the array is in unsigned integer order.
1.7112 +
1.7113 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7114 +
1.7115 +@param anEntry The unsigned integer to be found.
1.7116 +@param aMode Specifies whether to find the first match, the last match or
1.7117 + any match, as defined by one of the TArrayFindMode enum values.
1.7118 +
1.7119 +@return The array index of a matching element - what the index refers to depends
1.7120 + on the value of aMode:
1.7121 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.7122 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.7123 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.7124 + the last matching element - if the last matching element is also the last element
1.7125 + of the array, then the index value is the same as the total number of elements in the array.
1.7126 +
1.7127 +@leave KErrNotFound if no matching entry exists.
1.7128 +
1.7129 +@see TArrayFindMode
1.7130 +*/
1.7131 +inline TInt RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt aMode) const
1.7132 + { return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
1.7133 +
1.7134 +
1.7135 +/**
1.7136 +Finds the unsigned integer in the array that matches the specified unsigned integer
1.7137 +using a binary search technique.
1.7138 +
1.7139 +Where there is more than one matching element, it finds the first, last or
1.7140 +any matching element as specified by the value of aMode.
1.7141 +
1.7142 +The function assumes that the array is in unsigned integer order.
1.7143 +
1.7144 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7145 +
1.7146 +@param anEntry The unsigned integer to be found.
1.7147 +@param anIndex A TInt type supplied by the caller. On return, it contains an index
1.7148 + value depending on whether a match is found and on the value of aMode.
1.7149 + If there is no matching element in the array, then this is the
1.7150 + index of the first element in the array that is bigger than the element
1.7151 + being searched for - if no elements in the array are bigger, then
1.7152 + the index value is the same as the total number of elements in the array.
1.7153 + If there is a matching element, then what the index refers to depends on
1.7154 + the value of aMode:
1.7155 + if this is EArrayFindMode_First, then the index refers to the first matching element;
1.7156 + if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
1.7157 + if this is EArrayFindMode_Last, then the index refers to first element that follows
1.7158 + the last matching element - if the last matching element is also the last element of the array,
1.7159 + then the index value is the same as the total number of elements in the array.
1.7160 +
1.7161 +@param aMode Specifies whether to find the first match, the last match or any match, as defined by
1.7162 + one of the TArrayFindMode enum values.
1.7163 +@leave KErrNotFound if no matching entry exists.
1.7164 +
1.7165 +@see TArrayFindMode
1.7166 +*/
1.7167 +inline void RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt& anIndex, TInt aMode) const
1.7168 + { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
1.7169 +
1.7170 +
1.7171 +/**
1.7172 +Inserts an unsigned integer into the array in unsigned integer order.
1.7173 +
1.7174 +No duplicate entries are permitted.
1.7175 +
1.7176 +The function assumes that existing entries within the array are in unsigned
1.7177 +integer order.
1.7178 +
1.7179 +The function leaves with one of the system wide error codes, if the operation fails.
1.7180 +
1.7181 +Note that the array remains unchanged following an attempt to insert a duplicate entry.
1.7182 +
1.7183 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7184 +
1.7185 +@param anEntry The unsigned integer to be inserted.
1.7186 +*/
1.7187 +inline void RArray<TUint>::InsertInOrderL(TUint anEntry)
1.7188 + { User::LeaveIfError(InsertInOrder(anEntry));}
1.7189 +
1.7190 +
1.7191 +/**
1.7192 +Inserts an unsigned integer into the array in unsigned integer order, allowing
1.7193 +duplicates.
1.7194 +
1.7195 +If the new integer is a duplicate of an existing entry in the array, then
1.7196 +the new unsigned integer is inserted after the existing one. If more than
1.7197 +one duplicate entry already exists in the array, then any new duplicate
1.7198 +unsigned integer is inserted after the last one.
1.7199 +
1.7200 +The function assumes that existing entries within the array are in unsigned
1.7201 +integer order.
1.7202 +
1.7203 +The function leaves with one of the system wide error codes, if the operation fails.
1.7204 +
1.7205 +NOTE: This function is NOT AVAILABLE to code running on the kernel side.
1.7206 +
1.7207 +@param anEntry The unsigned integer to be inserted.
1.7208 +*/
1.7209 +inline void RArray<TUint>::InsertInOrderAllowRepeatsL(TUint anEntry)
1.7210 + { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
1.7211 +
1.7212 +
1.7213 +
1.7214 +/**
1.7215 +Reserves space for the specified number of elements.
1.7216 +
1.7217 +After a call to this function, the memory allocated to the array is sufficient
1.7218 +to hold the number of integers specified. Adding new integers to the array
1.7219 +does not result in a re-allocation of memory until the the total number of
1.7220 +integers exceeds the specified count.
1.7221 +
1.7222 +@param aCount The number of integers for which space should be reserved
1.7223 +@leave KErrNoMemory If the requested amount of memory could not be allocated
1.7224 +*/
1.7225 +inline void RArray<TUint>::ReserveL(TInt aCount)
1.7226 + { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
1.7227 +
1.7228 +
1.7229 +
1.7230 +
1.7231 +/**
1.7232 +Sets the priority of the client's process.
1.7233 +
1.7234 +@param aPriority The priority value.
1.7235 +*/
1.7236 +inline void RMessagePtr2::SetProcessPriorityL(TProcessPriority aPriority) const
1.7237 + { User::LeaveIfError(SetProcessPriority(aPriority));}
1.7238 +
1.7239 +
1.7240 +/**
1.7241 +Opens a handle on the client thread.
1.7242 +
1.7243 +@param aClient On successful return, the handle to the client thread.
1.7244 +@param aOwnerType An enumeration whose enumerators define the ownership of
1.7245 + the handle. If not explicitly specified,
1.7246 + EOwnerProcess is taken as default.
1.7247 +*/
1.7248 +inline void RMessagePtr2::ClientL(RThread& aClient, TOwnerType aOwnerType) const
1.7249 + { User::LeaveIfError(Client(aClient, aOwnerType));}
1.7250 +
1.7251 +
1.7252 +#ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.7253 +
1.7254 +inline TBool RMessagePtr2::HasCapability(TCapability aCapability, const char* aDiagnostic) const
1.7255 + {
1.7256 + return DoHasCapability(aCapability, aDiagnostic);
1.7257 + }
1.7258 +
1.7259 +inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, const char* aDiagnosticMessage) const
1.7260 + {
1.7261 + if (!HasCapability(aCapability, aDiagnosticMessage))
1.7262 + {
1.7263 + User::Leave(KErrPermissionDenied);
1.7264 + }
1.7265 + }
1.7266 +
1.7267 +inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
1.7268 + {
1.7269 + return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
1.7270 + }
1.7271 +
1.7272 +inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, const char* aDiagnosticMessage) const
1.7273 + {
1.7274 + if (!HasCapability(aCapability1, aCapability2, aDiagnosticMessage))
1.7275 + {
1.7276 + User::Leave(KErrPermissionDenied);
1.7277 + }
1.7278 + }
1.7279 +
1.7280 +#else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.7281 +
1.7282 +// Only available to NULL arguments
1.7283 +inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
1.7284 + {
1.7285 + return DoHasCapability(aCapability);
1.7286 + }
1.7287 +
1.7288 +inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnosticMessage*/) const
1.7289 + {
1.7290 + if (!DoHasCapability(aCapability))
1.7291 + {
1.7292 + User::Leave(KErrPermissionDenied);
1.7293 + }
1.7294 + }
1.7295 +
1.7296 +inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
1.7297 + {
1.7298 + return DoHasCapability(aCapability1, aCapability2);
1.7299 + }
1.7300 +
1.7301 +inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnosticMessage*/) const
1.7302 + {
1.7303 + if (!DoHasCapability(aCapability1, aCapability2))
1.7304 + {
1.7305 + User::Leave(KErrPermissionDenied);
1.7306 + }
1.7307 + }
1.7308 +
1.7309 +#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
1.7310 +// For things using KSuppressPlatSecDiagnostic
1.7311 +inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.7312 + {
1.7313 + return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
1.7314 + }
1.7315 +
1.7316 +inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.7317 + {
1.7318 + if (!DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue))
1.7319 + {
1.7320 + User::Leave(KErrPermissionDenied);
1.7321 + }
1.7322 + }
1.7323 +
1.7324 +inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.7325 + {
1.7326 + return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
1.7327 + }
1.7328 +
1.7329 +inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
1.7330 + {
1.7331 + if (!DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue))
1.7332 + {
1.7333 + User::Leave(KErrPermissionDenied);
1.7334 + }
1.7335 + }
1.7336 +#endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
1.7337 +
1.7338 +#endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
1.7339 +
1.7340 +inline TInt RThread::RenameMe(const TDesC& aName)
1.7341 + { return User::RenameThread(aName); }
1.7342 +inline TInt RProcess::RenameMe(const TDesC& aName)
1.7343 + { return User::RenameProcess(aName); }
1.7344 +
1.7345 +
1.7346 +#endif // !__KERNEL_MODE__
1.7347 +
1.7348 +#ifdef __SUPPORT_CPP_EXCEPTIONS__
1.7349 +// The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
1.7350 +// The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
1.7351 +// when we move to supporting Standard C++.
1.7352 +#if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__)
1.7353 +
1.7354 +#if defined(__VC32__) && !defined(_CRTIMP_PURE)
1.7355 +
1.7356 + // Declare MS EH runtime functions
1.7357 + bool __uncaught_exception(void);
1.7358 +
1.7359 +#if _MSC_VER >= 1200
1.7360 + __declspec(noreturn) void terminate(void);
1.7361 + __declspec(noreturn) void unexpected(void);
1.7362 +#else
1.7363 + void terminate(void);
1.7364 + void unexpected(void);
1.7365 +#endif
1.7366 +
1.7367 + typedef void (*terminate_handler)();
1.7368 + terminate_handler set_terminate(terminate_handler h) throw();
1.7369 + typedef void (*unexpected_handler)();
1.7370 + unexpected_handler set_unexpected(unexpected_handler h) throw();
1.7371 +
1.7372 +namespace std {
1.7373 +#ifdef __MSVCDOTNET__
1.7374 + inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
1.7375 +#else // !__MSVCDOTNET__
1.7376 + // MS KB242192: BUG: uncaught_exception() Always Returns False
1.7377 + inline bool uncaught_exception(void) { return false; }
1.7378 +#endif //__MSVCDOTNET__
1.7379 + inline void terminate(void) { ::terminate(); }
1.7380 + inline void unexpected(void) { ::unexpected(); }
1.7381 + inline terminate_handler set_terminate(terminate_handler h) throw() { return ::set_terminate(h); }
1.7382 + inline unexpected_handler set_unexpected(unexpected_handler h) throw() { return ::set_unexpected(h); }
1.7383 +}
1.7384 +
1.7385 +#endif // extract from MSVC headers
1.7386 +
1.7387 +#ifdef __CW32__
1.7388 +
1.7389 + extern "C" bool __uncaught_exception(void);
1.7390 +
1.7391 +namespace std {
1.7392 +#if __MWERKS__ > 0x3200
1.7393 + inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
1.7394 +#else
1.7395 + // no uncaught_exception() implementation on CW 2.4.7
1.7396 + inline bool uncaught_exception(void) { return false; }
1.7397 +#endif
1.7398 +}
1.7399 +
1.7400 +#endif // extract from CW headers
1.7401 +
1.7402 +#endif // <exception> header guard
1.7403 +
1.7404 +#endif //__SUPPORT_CPP_EXCEPTIONS__