1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\e32std.inl
18 // Global leaving operator new
19 inline TAny* operator new(TUint aSize, TLeave)
20 {return User::AllocL(aSize);}
21 inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize)
22 {return User::AllocL(aSize + aExtraSize);}
23 #if !defined(__VC32__) || defined (__MSVCDOTNET__)
24 inline TAny* operator new[](TUint aSize, TLeave)
25 {return User::AllocL(aSize);}
32 inline TUint8* Mem::Copy(TAny* aTrg, const TAny* aSrc, TInt aLength)
34 Copies data from a source location to a target location and returns a pointer
35 to the end of the copied data.
37 The source and target areas can overlap.
39 The copy operation is optimised so that if both source and target locations
40 are aligned on a word boundary, the operation performs the copy on a word
43 @param aTrg A pointer to the target location for the copy operation.
44 @param aSrc A pointer to the source location for the copy operation.
45 @param aLength The number of bytes to be copied. This value must not
48 @return A pointer to a location aLength bytes beyond aTrg (i.e. the location
51 @panic USER 90 In debug builds only, if aLength is negative.
53 { return (TUint8*)memmove(aTrg, aSrc, aLength) + aLength; }
58 inline TUint8* Mem::Move(TAny* aTrg, const TAny* aSrc, TInt aLength)
60 Moves a block of data from a source location to a target location and returns
61 a pointer to the end of the moved data.
63 The source and target areas can overlap.
65 Both source and target locations must be aligned on a word boundary.
66 The specified length must also be a multiple of 4.
68 @param aTrg A pointer to the target location for the move operation. This
69 pointer must be word aligned.
70 @param aSrc A pointer to the source location for the move operation. This
71 pointer must be word aligned.
72 @param aLength The number of bytes to be copied. This value must be a multiple
75 @return A pointer to a location aLength bytes beyond aTrg (i.e. the location
78 @panic USER 93 In debug builds only, if aTrg is not word aligned.
79 @panic USER 92 In debug builds only, if aSrc is not word aligned.
80 @panic USER 91 In debug builds only, if aLength is not a multiple of 4.
82 { return (TUint8*)wordmove(aTrg, aSrc, aLength) + aLength; }
87 inline void Mem::Fill(TAny* aTrg, TInt aLength, TChar aChar)
89 Fills a specified block of data with a specified character, replacing
92 The function assumes that the fill character is a non-Unicode character.
94 @param aTrg A pointer to the location where filling is to start.
95 @param aLength The number of bytes to be filled. This value must not
97 @param aChar The fill character.
99 @panic USER 95 In debug builds only, if aLength is negative.
101 { memset(aTrg, (TInt)(aChar.operator TUint()), aLength); }
106 inline void Mem::FillZ(TAny* aTrg,TInt aLength)
108 Fills a specified block of data with binary zeroes (i.e. 0x00), replacing any
111 @param aTrg A pointer to the location where filling is to start.
112 @param aLength The number of bytes to be filled. This value must not
115 @panic USER 95 In debug builds only, if aLength is negative.
117 { memclr(aTrg, aLength); }
123 inline TInt Mem::Compare(const TUint8* aLeft, TInt aLeftL, const TUint8* aRight, TInt aRightL)
125 Compares a block of data at one specified location with a block of data at
126 another specified location.
128 The comparison proceeds on a byte for byte basis, the result of the comparison
129 is based on the difference of the first bytes to disagree.
131 The data at the two locations are equal if they have the same length and content.
132 Where the lengths are different and the shorter section of data is the same
133 as the first part of the longer section of data, the shorter is considered
134 to be less than the longer.
136 @param aLeft A pointer to the first (or left) block of 8 bit data
138 @param aLeftL The length of the first (or left) block of data to be compared,
139 i.e. the number of bytes.
140 @param aRight A pointer to the second (or right) block of 8 bit data to be
142 @param aRightL The length of the second (or right) block of data to be compared
143 i.e. the number of bytes.
145 @return Positive, if the first (or left) block of data is greater than the
146 second (or right) block of data.
147 Negative, if the first (or left) block of data is less than the
148 second (or right) block of data.
149 Zero, if both the first (or left) and second (or right) blocks of data
150 have the same length and the same content.
152 { return memcompare(aLeft, aLeftL, aRight, aRightL); }
159 inline TInt RHeap::SetBrk(TInt aBrk)
160 { return ((RChunk*)&iChunkHandle)->Adjust(aBrk); }
166 #ifndef __KERNEL_MODE__
167 inline void TChar::SetChar(TUint aChar)
173 inline void TChar::Fold()
175 Converts the character to a form which can be used in tolerant comparisons
176 without control over the operations performed.
178 Tolerant comparisons are those which ignore character differences like case
181 This function can be used when searching for a string in a text file or a
182 file in a directory. Folding performs the following conversions: converts
183 to lowercase, strips accents, converts all digits representing the values
184 0..9 to the ordinary digit characters '0'..'9', converts all spaces (standard,
185 non-break, fixed-width, ideographic, etc.) to the ordinary space character
186 (0x0020), converts Japanese characters in the hiragana syllabary to katakana,
187 and converts East Asian halfwidth and fullwidth variants to their ordinary
188 forms. You can choose to perform any subset of these operations by using the
189 other function overload.
193 {iChar=User::Fold(iChar);}
198 inline void TChar::LowerCase()
200 Converts the character to its lowercase form.
202 Characters lacking a lowercase form are unchanged.
206 {iChar=User::LowerCase(iChar);}
211 inline void TChar::UpperCase()
213 Converts the character to its uppercase form.
215 Characters lacking an uppercase form are unchanged.
219 {iChar=User::UpperCase(iChar);}
225 inline void TChar::Fold(TInt aFlags)
227 Converts the character to a form which can be used in tolerant comparisons
228 allowing selection of the specific fold operations to be performed.
230 @param aFlags Flags which define the operations to be performed. The values
231 are defined in the enum beginning with EFoldCase.
233 @see TChar::EFoldCase
236 {iChar=User::Fold(iChar,aFlags);}
241 inline void TChar::TitleCase()
243 Converts the character to its titlecase form.
245 The titlecase form of a character is identical to its uppercase form unless
246 a specific titlecase form exists. Characters lacking a titlecase form are
249 {iChar=User::TitleCase(iChar);}
255 inline TBool TChar::Eos() const
257 Tests whether the character is the C/C++ end-of-string character - 0.
259 @return True, if the character is 0; false, otherwise.
268 inline TCallBack::TCallBack()
272 Sets the function pointer to Null.
279 inline TCallBack::TCallBack(TInt (*aFunction)(TAny *aPtr))
280 : iFunction(aFunction),iPtr(NULL)
282 Constructs the callback object with the specified callback function.
284 @param aFunction A pointer to the callback function. It takes an argument of
285 type TAny* and returns a TInt.
286 It must be either a static member of a class or a function
287 which is not a member of any class.
294 inline TCallBack::TCallBack(TInt (*aFunction)(TAny *aPtr),TAny *aPtr)
295 : iFunction(aFunction),iPtr(aPtr)
297 Constructs the callback object with the specified callback function and
298 a pointer to any object.
300 @param aFunction A pointer to the callback function. It takes an argument of
301 type TAny* and returns a TInt.
302 It must be either a static member of a class or a function
303 which is not a member of any class.
304 @param aPtr A pointer which is always passed to the callback function.
312 Calls the callback function.
314 @return The value returned by the callback function. The meaning of this value
315 depends entirely on the context in which the callback function
317 For example, when used with the CIdle class, a false (zero) value
318 indicates that the callback function should not be called again.
319 As another example, when used with the CPeriodic class, the return
320 value is ignored and is irrelevant in that context.
325 inline TInt TCallBack::CallBack() const
326 { return (iFunction ? (*iFunction)(iPtr) : 0); }
333 inline TSglQue<T>::TSglQue()
335 Constructs an empty list header and sets the offset value of the link object
338 In practice, never assume that the offset of the link object from the start
339 of a list element is zero, even if the link object is declared as the first
340 data member in the list element class.
342 If this default constructor is used, then call the SetOffset() function of
343 the base class to ensure that the offset value is set correctly.
345 @see TSglQueBase::SetOffset
353 inline TSglQue<T>::TSglQue(TInt aOffset)
354 : TSglQueBase(aOffset)
356 Constructs an empty list header and sets the offset of the link object to the
359 @param aOffset The offset of the link object from the start of a list element.
360 The macro _FOFF can be used to calculate this value.
362 @panic USER 75, if aOffset is not divisible by four.
372 inline void TSglQue<T>::AddFirst(T &aRef)
374 Inserts the specified list element at the front of the singly linked list.
376 If the list is not empty, the specified element becomes the first in the list.
377 What was previously the first element becomes the second in the list.
379 @param aRef The list element to be inserted at the front of the singly linked
388 inline void TSglQue<T>::AddLast(T &aRef)
390 Inserts the specified list element at the back of the singly linked list.
392 If the list is not empty, the specified element becomes the last in the list.
393 What was previously the last element becomes the next to last element in the
396 @param aRef The list element to be inserted at the back of the singly linked
405 inline TBool TSglQue<T>::IsFirst(const T *aPtr) const
407 Tests whether the specified element is the first in the singly linked list.
409 @param aPtr A pointer to the element whose position in the list is to be
412 @return True, if the element is the first in the list; false, otherwise.
414 {return(PtrAdd(aPtr,iOffset)==(T *)iHead);}
420 inline TBool TSglQue<T>::IsLast(const T *aPtr) const
422 Tests whether the specified element is the last in the singly linked list.
424 @param aPtr A pointer to the element whose position in the list is
427 @return True, if the element is the last in the list; false, otherwise.
429 {return(PtrAdd(aPtr,iOffset)==(T *)iLast);}
435 inline T *TSglQue<T>::First() const
437 Gets a pointer to the first list element in the singly linked list.
439 @return A pointer to the first list element in the singly linked list. If
440 the list is empty, this pointer is not necessarily NULL and must not
441 be assumed to point to a valid object.
443 {return(PtrSub((T *)iHead,iOffset));}
449 inline T *TSglQue<T>::Last() const
451 Gets a pointer to the last list element in the singly linked list.
453 @return A pointer to the last list element in the singly linked list. If the
454 list is empty, this pointer is not necessarily NULL and must not be
455 assumed to point to a valid object.
457 {return(PtrSub((T *)iLast,iOffset));}
463 inline void TSglQue<T>::Remove(T &aRef)
465 Removes the specified element from the singly linked list.
467 The singly linked list must not be empty.
469 @param aRef A list element to be removed from the singly linked list.
471 @panic USER 76, if the element to be removed is not in the list
480 inline TDblQue<T>::TDblQue()
482 Constructs an empty list header and sets the offset value of the link object
485 In practice, never assume that the offset of the link object from the start
486 of a list element is zero, even if the link object is declared as the first
487 data member in the list element class.
489 If this default constructor is used, then call the SetOffset() function of
490 the base class to ensure that the offset value is set correctly.
492 @see TDblQueBase::SetOffset()
500 inline TDblQue<T>::TDblQue(TInt aOffset)
501 : TDblQueBase(aOffset)
503 Constructs an empty list header and sets the offset of the link object to the
506 @param aOffset The offset of the link object from the start of a list element.
507 The macro _FOFF can be used to calculate this value.
509 @panic USER 78. if aOffset is not divisble by 4.
519 inline void TDblQue<T>::AddFirst(T &aRef)
521 Inserts the specified list element at the front of the doubly linked list.
523 If the list is not empty, the specified element becomes the first in the list.
524 What was previously the first element becomes the second in the list.
526 @param aRef The list element to be inserted at the front of the doubly linked
535 inline void TDblQue<T>::AddLast(T &aRef)
537 Inserts the specified list element at the back of the doubly linked list.
539 If the list is not empty, the specified element becomes the last in the list.
540 What was previously the last element becomes the next to last element in the
543 @param aRef The list element to be inserted at the back of the doubly linked
552 inline TBool TDblQue<T>::IsHead(const T *aPtr) const
554 Tests whether the end of a list has been reached.
556 A doubly linked list is circular; in following the chain of elements in a
557 list (e.g. using the iterator operator++ or operator--), the chain eventually
558 reaches the end of the list and aPtr corresponds to the header (although it
559 will not point to a valid T object).
561 @param aPtr The pointer value to be checked.
563 @return True, if the end of the list has been reached. False, if the end of
564 the list has not been reached; aPtr points to an element in the list.
566 {return(PtrAdd(aPtr,iOffset)==(T *)&iHead);}
572 inline TBool TDblQue<T>::IsFirst(const T *aPtr) const
574 Tests whether the specified element is the first in the doubly linked list.
576 @param aPtr A pointer to the element whose position in the list is to be checked.
578 @return True, if the element is the first in the list; false, otherwise.
580 {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iNext);}
586 inline TBool TDblQue<T>::IsLast(const T *aPtr) const
588 Tests whether the specified element is the last in the doubly linked list.
590 @param aPtr A pointer to the element whose position in the list is to be checked.
592 @return True, if the element is the last in the list; false, otherwise.
594 {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iPrev);}
600 inline T *TDblQue<T>::First() const
602 Gets a pointer to the first list element in the doubly linked list.
604 @return A pointer to the first list element in the doubly linked list. If
605 the list is empty, this pointer is not necessarily NULL and must not
606 be assumed to point to a valid object.
612 return(PtrSub((T *)iHead.iNext,iOffset));
619 inline T *TDblQue<T>::Last() const
621 Gets a pointer to the last list element in the doubly linked list.
623 @return A pointer to the last list element in the doubly linked list. If the
624 list is empty, this pointer is not necessarily NULL and must not be assumed
625 to point to a valid object.
631 return(PtrSub((T *)iHead.iPrev,iOffset));
639 inline TPriQue<T>::TPriQue()
643 Constructs an empty list header and sets the offset value of the link
646 In practice, never assume that the offset of the link object from the start
647 of a list element is zero, even if the link object is declared as the first
648 data member in the list element class.
650 If this default constructor is used, then call the SetOffset() function of
651 the base class to ensure that the offset value is set correctly.
653 @see TDblQueBase::SetOffset
661 inline TPriQue<T>::TPriQue(TInt aOffset)
662 : TDblQueBase(aOffset)
664 Constructs an empty list header and sets the offset of the link object
665 to the specified value.
667 @param aOffset The offset of the link object from the start of a list element.
668 The macro _FOFF can be used to calculate this value.
670 @panic USER 78 if aOffset is not divisible by four.
678 inline void TPriQue<T>::Add(T &aRef)
680 Inserts the specified list element in descending priority order.
682 If there is an existing list element with the same priority, then the new
683 element is added after the existing element.
685 @param aRef The list element to be inserted.
687 {DoAddPriority(&aRef);}
693 inline TBool TPriQue<T>::IsHead(const T *aPtr) const
695 Tests whether the end of a list has been reached.
697 A doubly linked list is circular; in following the chain of elements in a list
698 (e.g. using the iterator operator++ or operator--), the chain eventually
699 reaches the end of the list and aPtr corresponds to the header (although it
700 will not point to a valid T object).
702 @param aPtr The pointer value to be checked.
704 @return True, if the end of the list has been reached. False, if the end of the
705 list has not been reached; aPtr points to an element in the list.
707 {return(PtrAdd(aPtr,iOffset)==(T *)&iHead);}
713 inline TBool TPriQue<T>::IsFirst(const T *aPtr) const
715 Tests whether the specified element is the first in the linked list.
717 @param aPtr A pointer to the element whose position in the list is to
720 @return True, if the element is the first in the list; false, otherwise.
722 {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iNext);}
728 inline TBool TPriQue<T>::IsLast(const T *aPtr) const
730 Tests whether the specified element is the last in the linked list.
732 @param aPtr A pointer to the element whose position in the list is to
735 @return True, if the element is the last in the list; false, otherwise.
737 {return(PtrAdd(aPtr,iOffset)==(T *)iHead.iPrev);}
743 inline T *TPriQue<T>::First() const
745 Gets a pointer to the first list element in the linked list.
747 @return A pointer to the first list element in the linked list.
748 If the list is empty, this pointer is not necessarily NULL and must
749 not be assumed to point to a valid object.
751 {return(PtrSub((T *)iHead.iNext,iOffset));}
757 inline T *TPriQue<T>::Last() const
759 Gets a pointer to the last list element in the linked list.
761 @return A pointer to the last list element in the linked list.
762 If the list is empty, this pointer is not necessarily NULL and must
763 not be assumed to point to a valid object.
765 {return(PtrSub((T *)iHead.iPrev,iOffset));}
772 inline TDeltaQue<T>::TDeltaQue()
774 Constructs an empty list header and sets the offset value of the link object
777 In practice, never assume that the offset of the link object from the start
778 of a list element is zero, even if the link object is declared as the first
779 data member in the list element class.
781 If this default constructor is used, then call the TDblQueBase::SetOffset()
782 function in the base class to ensure that the offset value is set correctly.
784 TDeltaQueBase::iFirstDelta is set to NULL.
786 @see TDblQueBase::SetOffset
794 inline TDeltaQue<T>::TDeltaQue(TInt aOffset)
795 : TDeltaQueBase(aOffset)
797 Constructs an empty list header and sets the offset of the link object to the
800 TDeltaQueBase::iFirstDelta is set to NULL.
802 @param aOffset The offset of the link object from the start of a list element.
803 The macro _FOFF can be used to calculate this value.
805 @panic USER 78, if aOffset is not divisible by four.
815 inline void TDeltaQue<T>::Add(T &aRef,TInt aDelta)
817 Adds the specified list element, having the specified 'distance' from the
818 nominal zero point, into the list.
820 The element is added into the list, the adjacent delta values adjusted, and
821 a suitable delta value assigned to the new element, so that the new element
822 is at the specified 'distance' from the nominal zero point.
824 @param aRef The list element to be inserted.
825 @param aDelta The 'distance' from the nominal zero point.
827 {DoAddDelta(&aRef,aDelta);}
833 inline void TDeltaQue<T>::Remove(T &aRef)
835 Removes the specified list element from the linked list.
837 The delta value of the element following the removed element is adjusted
838 so that its 'distance' from the nominal zero point remains the same.
840 @param aRef The list element to be removed.
848 inline T *TDeltaQue<T>::RemoveFirst()
850 Removes the first list element from the linked list if its delta value is zero
853 @return A pointer to the element removed from the linked list. This is NULL,
854 if the first element has a positive delta value.
856 {return((T *) DoRemoveFirst());}
863 inline TSglQueIter<T>::TSglQueIter(TSglQueBase &aQue)
864 : TSglQueIterBase(aQue)
866 Constructs the iterator for the specified singly linked list.
868 The iterator can be constructed whether or not the list contains any elements.
870 If the list does contain elements, the iterator pointer is set to the first one.
872 If the list has no elements, the iterator pointer is not set and the conversion
873 operator T*() and the post increment operator ++ subsequently return NULL.
874 Once elements have been added to the list, use either the
875 TSglQueIter::Set() function or the TSglQueIterBase::SetToFirst() function to set the
878 @param aQue A reference to a singly linked list header.
880 @see TSglQueIter::Set
881 @see TSglQueIterBase::SetToFirst
889 inline void TSglQueIter<T>::Set(T &aLink)
891 Sets the iterator to point to a specific element in the list.
893 This function can be used to alter the pointer at any time during the iterator's
894 existence. The referenced element must be in the list, otherwise the result
897 @param aLink A reference to the element from where iteration is to continue.
905 inline TSglQueIter<T>::operator T *()
907 Gets a pointer to the iterator’s current element.
909 The operator is normally used implicitly; e.g. some member functions of the
910 list header class TSglQue require a pointer to an element (of type class T)
911 as a parameter, but in practice an iterator is often passed instead.
912 This operator performs the necessary conversion.
914 {return((T *)DoCurrent());}
920 inline T *TSglQueIter<T>::operator++(TInt)
922 Gets a pointer to the iterator's current element and then sets the iterator
923 to point to the next element.
925 Repeated use of this operator allows successive elements to be accessed.
927 @return A pointer to the current list element, if the iterator points to an
928 element. NULL, if the iterator does not point to an element; i.e. the
929 iterator pointer has reached the end of the list.
931 {return((T *)DoPostInc());}
938 inline TDblQueIter<T>::TDblQueIter(TDblQueBase &aQue)
939 : TDblQueIterBase(aQue)
941 Constructs the iterator for the specified doubly linked list
943 The iterator can be constructed whether or not the list contains any elements.
945 If the list does contain elements, the iterator pointer is set to the first one.
947 If the list has no elements, the iterator pointer is not set and the conversion
948 operator T*(), the post increment operator++() and the post decrement operator
949 --() subsequently return NULL. Once elements have been added to the list, use
950 either the TDblQueIter::Set() function, the TDblQueIterBase::SetToFirst()
951 function or the TDblQueIterBase::SetToLast() function to set the iterator
954 @param aQue A reference to a doubly linked list header.
956 @see TDblQueIter::Set
957 @see TDblQueIterBase::SetToFirst
958 @see TDblQueIterBase::SetToLast
966 inline void TDblQueIter<T>::Set(T &aLink)
968 Sets the iterator to point to a specific element in the list.
970 This function can be used to alter the pointer at any time during
971 the iterator's existence. The referenced element must be in the list,
972 otherwise the result is undefined.
974 @param aLink A reference to the element from where iteration is to continue.
982 inline TDblQueIter<T>::operator T *()
984 Gets a pointer to the iterator’s current element.
986 The operator is normally used implicitly; e.g. some member functions of the
987 list header class TDblQue require a pointer to an element (of type class T)
988 as a parameter but in practice, an iterator is often passed instead.
989 This operator performs the necessary conversion.
991 @return A pointer to the current element, if the iterator points to an element
992 in the list. NULL, if the iterator does not point to an element;
993 i.e. the iterator pointer has previously reached the end of the list
994 (see operator++) or the start of the list (see operator--) or
997 {return((T *) DoCurrent());}
1003 inline T *TDblQueIter<T>::operator++(TInt)
1005 Gets a pointer to the iterator's current element and then sets the iterator
1006 to point to the next element.
1008 Repeated use of this operator allows successive
1009 elements to be accessed in the forwards direction.
1011 @return A pointer to the current list element, if the iterator points to an
1012 element. NULL, if the iterator does not point to an element;
1013 i.e. the iterator pointer has reached the end of the list.
1015 {return((T *) DoPostInc());}
1021 inline T *TDblQueIter<T>::operator--(TInt)
1023 Gets a pointer to the iterator's current element and then sets the iterator
1024 to point to the previous element.
1026 Repeated use of this operator allows successive
1027 elements to be accessed in the backwards direction.
1029 @return A pointer to the current element, if the iterator points to an element.
1030 NULL, if the iterator does not point to an element; i.e. the iterator
1031 pointer has reached the beginning of the list.
1033 {return((T *) DoPostDec());}
1039 inline void TKey::SetPtr(const TAny *aPtr)
1041 Sets the pointer to a sample element whose key is to be used for comparison.
1043 The element can be in an existing array or it can be located anywhere in
1046 The At() member function supplied by a derived class must return a pointer
1047 to this sample element's key when passed an index value of KIndexPtr.
1049 SetPtr() must be called before calling User::BinarySearch() because this algorithm
1050 uses the key of this sample element as the basis for searching the array.
1052 @param aPtr A pointer to a sample element.
1060 inline TCharF::TCharF(TUint aChar)
1061 : TChar(User::Fold(aChar))
1063 Constructs this 'fold character' object and initialises it with the specified
1066 @param aChar The initialisation value.
1073 inline TCharF::TCharF(const TChar& aChar)
1074 : TChar(User::Fold(aChar))
1076 Constructs this 'fold character' object and initialises it with the value of
1077 the TChar object aChar.
1079 @param aChar The character object to use as the initialisation value.
1086 inline TCharF& TCharF::operator=(TUint aChar)
1088 Assigns an unsigned integer value to the 'fold character' object.
1090 @param aChar The value to assign.
1092 @return A reference to this 'fold character' object.
1094 {SetChar(User::Fold(aChar));return(*this);}
1099 inline TCharF& TCharF::operator=(const TChar& aChar)
1101 Assigns the specified character object to this 'fold character' object.
1103 @param aChar The character object to assign.
1105 @return A reference to this 'fold character' object.
1107 {SetChar(User::Fold(aChar));return(*this);}
1113 inline TCharLC::TCharLC(TUint aChar)
1114 : TChar(User::LowerCase(aChar))
1116 Constructs this 'character to lower case' object and initialises it with the
1119 @param aChar The initialisation value.
1127 inline TCharLC::TCharLC(const TChar& aChar)
1128 : TChar(User::LowerCase(aChar))
1130 Constructs this 'character to lower case' object and initialises it with the
1131 value of the TChar object aChar.
1133 @param aChar The character object to use as the initialisation value.
1140 inline TCharLC& TCharLC::operator=(TUint aChar)
1142 Assigns an unsigned integer value to the 'character to lower case' object.
1144 @param aChar The value to assign.
1146 @return A reference to this 'character to lower case' object.
1148 {SetChar(User::LowerCase(aChar));return(*this);}
1153 inline TCharLC& TCharLC::operator=(const TChar& aChar)
1155 Assigns the specified character object to this 'character to lower case'
1158 @param aChar The character object to assign.
1160 @return A reference to this 'character to lower case' object.
1162 {SetChar(User::LowerCase(aChar));return(*this);}
1168 inline TCharUC::TCharUC(TUint aChar)
1169 : TChar(User::UpperCase(aChar))
1171 Constructs this 'character to upper case' object and initialises it with the
1174 @param aChar The initialisation value.
1181 inline TCharUC::TCharUC(const TChar& aChar)
1182 : TChar(User::UpperCase(aChar))
1184 Constructs this 'character to upper case' object and initialises it with the
1185 value of the TChar object aChar.
1187 @param aChar The character object to use as the initialisation value.
1194 inline TCharUC& TCharUC::operator=(TUint aChar)
1196 Assigns an unsigned integer value to the 'character to upper case' object.
1198 @param aChar The value to assign.
1200 @return A reference to this 'character to upper case' object.
1202 {SetChar(User::UpperCase(aChar));return(*this);}
1207 inline TCharUC& TCharUC::operator=(const TChar& aChar)
1209 Assigns the specified character object to this 'character to upper case'
1212 @param aChar The character object to assign.
1214 @return A reference to this 'character to upper case' object.
1216 {SetChar(User::UpperCase(aChar));return(*this);}
1222 inline TDateTime::TDateTime()
1231 Constructs an uninitialised TDateTime object.
1238 inline TInt TDateTime::Year() const
1240 Gets the year component of the date/time.
1242 A negative value indicates a BC date.
1251 inline TMonth TDateTime::Month() const
1253 Gets the month component of the date/time.
1255 @return The month. EJanuary to EDecember. Offset from zero, so add one before
1256 displaying the month number.
1263 inline TInt TDateTime::Day() const
1265 Gets the day component of the date/time.
1267 @return The day. Offset from zero, so add one before displaying the day number.
1274 inline TInt TDateTime::Hour() const
1276 Gets the hour component of the date/time.
1285 inline TInt TDateTime::Minute() const
1287 Gets the minute component of the date/time.
1296 inline TInt TDateTime::Second() const
1298 Gets the second component of the date/time.
1307 inline TInt TDateTime::MicroSecond() const
1309 Gets the microsecond component of the date/time.
1311 @return The microsecond.
1313 {return(iMicroSecond);}
1315 // Class TTimeIntervalMicroSeconds
1320 inline TTimeIntervalMicroSeconds::TTimeIntervalMicroSeconds()
1322 Default constructor.
1324 Constructs an uninitialised object.
1331 inline TTimeIntervalMicroSeconds::TTimeIntervalMicroSeconds(const TInt64& aInterval)
1332 : iInterval(aInterval)
1334 Constructs the object with the specified 64-bit interval value.
1336 @param aInterval The 64-bit interval value with which the object is to be
1344 inline TTimeIntervalMicroSeconds& TTimeIntervalMicroSeconds::operator=(const TInt64& aInterval)
1346 Assigns a 64-bit integer value to this object.
1348 @param aInterval The 64-bit integer interval value to be assigned.
1350 @return A reference to this object.
1352 {iInterval=aInterval;return(*this);}
1357 inline TBool TTimeIntervalMicroSeconds::operator==(const TTimeIntervalMicroSeconds& aInterval) const
1359 Tests whether this TTimeIntervalMicroSeconds object is equal to the
1360 specified TTimeIntervalMicroSeconds object.
1362 @param aInterval The time interval to be compared with this time interval.
1364 @return True if the two time intervals are equal. False otherwise.
1366 {return(iInterval==aInterval.iInterval);}
1371 inline TBool TTimeIntervalMicroSeconds::operator!=(const TTimeIntervalMicroSeconds& aInterval) const
1373 Tests whether this TTimeIntervalMicroSeconds object is not equal to the
1374 specified TTimeIntervalMicroSeconds object.
1376 @param aInterval The time interval to be compared with this time interval.
1378 @return True if the two time intervals are not equal. False otherwise.
1380 {return(iInterval!=aInterval.iInterval);}
1385 inline TBool TTimeIntervalMicroSeconds::operator>=(const TTimeIntervalMicroSeconds& aInterval) const
1387 Tests whether this TTimeIntervalMicroSeconds object is greater than or equal to the
1388 specified TTimeIntervalMicroSeconds object.
1390 @param aInterval The time interval to be compared with this time interval.
1392 @return True if this time interval is greater than or equal to the specified
1393 time interval. False otherwise.
1395 {return(iInterval>=aInterval.iInterval);}
1400 inline TBool TTimeIntervalMicroSeconds::operator<=(const TTimeIntervalMicroSeconds& aInterval) const
1402 Tests whether this TTimeIntervalMicroSeconds object is less than or equal to the
1403 specified TTimeIntervalMicroSeconds object.
1405 @param aInterval The time interval to be compared with this time interval.
1407 @return True if this time interval is less than or equal to the specified
1408 time interval. False otherwise.
1410 {return(iInterval<=aInterval.iInterval);}
1415 inline TBool TTimeIntervalMicroSeconds::operator>(const TTimeIntervalMicroSeconds& aInterval) const
1417 Tests whether this TTimeIntervalMicroSeconds object is greater than the
1418 specified TTimeIntervalMicroSeconds object.
1420 @param aInterval The time interval to be compared with this time interval.
1422 @return True if this time interval is greater than the specified
1423 time interval. False otherwise.
1425 {return(iInterval>aInterval.iInterval);}
1430 inline TBool TTimeIntervalMicroSeconds::operator<(const TTimeIntervalMicroSeconds& aInterval) const
1432 Tests whether this TTimeIntervalMicroSeconds object is less than the
1433 specified TTimeIntervalMicroSeconds object.
1435 @param aInterval The time interval to be compared with this time interval.
1437 @return True if this time interval is less than the specified
1438 time interval. False otherwise.
1440 {return(iInterval<aInterval.iInterval);}
1445 inline const TInt64& TTimeIntervalMicroSeconds::Int64() const
1447 Gets the time interval as a 64-bit integer value.
1449 @return This 64-bit integer time interval value.
1451 {return(iInterval);}
1456 // Class TTimeIntervalBase
1457 inline TTimeIntervalBase::TTimeIntervalBase()
1459 Default constructor.
1466 inline TTimeIntervalBase::TTimeIntervalBase(TInt aInterval)
1467 : iInterval(aInterval)
1469 Constructor taking an interval value.
1471 @param aInterval The interval value.
1478 inline TBool TTimeIntervalBase::operator==(TTimeIntervalBase aInterval) const
1480 Tests whether this time interval is the same as the specified time interval.
1482 @param aInterval The time interval to be compared with this time interval.
1484 @return True if the two time intervals are equal. False otherwise.
1486 {return(iInterval==aInterval.iInterval);}
1491 inline TBool TTimeIntervalBase::operator!=(TTimeIntervalBase aInterval) const
1493 Tests whether this time interval is not the same as the specified
1496 @param aInterval The time interval to be compared with this time interval.
1498 @return True if the two time intervals differ. False otherwise.
1500 {return(iInterval!=aInterval.iInterval);}
1505 inline TBool TTimeIntervalBase::operator>=(TTimeIntervalBase aInterval) const
1507 Tests whether this time interval is greater than or equal to the
1508 specified time interval.
1510 @param aInterval The time interval to be compared with this time interval.
1512 @return True if this time interval is greater than or equal to the specified
1513 time interval. False otherwise.
1515 {return(iInterval>=aInterval.iInterval);}
1520 inline TBool TTimeIntervalBase::operator<=(TTimeIntervalBase aInterval) const
1522 Tests whether this time interval is less than or equal to the
1523 specified time interval.
1525 @param aInterval The time interval to be compared with this time interval.
1527 @return True if this time interval is less than or equal to the specified
1528 time interval. False otherwise.
1530 {return(iInterval<=aInterval.iInterval);}
1535 inline TBool TTimeIntervalBase::operator>(TTimeIntervalBase aInterval) const
1537 Tests whether this time interval is greater than the specified time interval.
1539 @param aInterval The time interval to be compared with this time interval.
1541 @return True if this time interval is greater than the specified
1542 time interval. False otherwise.
1544 {return(iInterval>aInterval.iInterval);}
1549 inline TBool TTimeIntervalBase::operator<(TTimeIntervalBase aInterval) const
1551 Tests whether this time interval is less than the specified time interval.
1553 @param aInterval The time interval to be compared with this time interval.
1555 @return True if this time interval is less than the specified
1556 time interval. False otherwise.
1558 {return(iInterval<aInterval.iInterval);}
1563 inline TInt TTimeIntervalBase::Int() const
1565 Gets the time interval as a 32 bit integer.
1567 @return The time interval as a 32 bit integer.
1569 {return(iInterval);}
1574 // Class TTimeIntervalMicroSeconds32
1575 inline TTimeIntervalMicroSeconds32::TTimeIntervalMicroSeconds32()
1577 Default constructor.
1579 Constructs an uninitialised object.
1586 inline TTimeIntervalMicroSeconds32::TTimeIntervalMicroSeconds32(TInt aInterval)
1587 : TTimeIntervalBase(aInterval)
1589 Constructs the object with the specified interval value.
1591 @param aInterval The interval value with which the object is to be initialised.
1598 inline TTimeIntervalMicroSeconds32& TTimeIntervalMicroSeconds32::operator=(TInt aInterval)
1600 Assigns a value to this object.
1602 @param aInterval The interval value to be assigned.
1604 @return A reference to this object.
1606 {iInterval=aInterval;return(*this);}
1611 // Class TTimeIntervalSeconds
1612 inline TTimeIntervalSeconds::TTimeIntervalSeconds()
1614 Default constructor.
1616 Constructs an uninitialised object.
1623 inline TTimeIntervalSeconds::TTimeIntervalSeconds(TInt aInterval)
1624 : TTimeIntervalBase(aInterval)
1626 Constructs the object with the specified interval value.
1628 @param aInterval The interval value with which the object is to be initialised.
1635 inline TTimeIntervalSeconds& TTimeIntervalSeconds::operator=(TInt aInterval)
1637 Assigns a value to this object.
1639 @param aInterval The interval value to be assigned.
1641 @return A reference to this object.
1643 {iInterval=aInterval;return(*this);}
1648 // Class TTimeIntervalMinutes
1649 inline TTimeIntervalMinutes::TTimeIntervalMinutes()
1651 Default constructor.
1653 Constructs an uninitialised object.
1660 inline TTimeIntervalMinutes::TTimeIntervalMinutes(TInt aInterval)
1661 : TTimeIntervalBase(aInterval)
1663 Constructs the object with the specified interval value.
1665 @param aInterval The interval value with which the object is to be initialised.
1672 inline TTimeIntervalMinutes& TTimeIntervalMinutes::operator=(TInt aInterval)
1674 Assigns a value to this object.
1676 @param aInterval The interval value to be assigned.
1678 @return A reference to this object.
1680 {iInterval=aInterval;return(*this);}
1685 // Class TTimeIntervalHours
1686 inline TTimeIntervalHours::TTimeIntervalHours()
1688 Default constructor.
1690 Constructs an uninitialised object.
1693 inline TTimeIntervalHours::TTimeIntervalHours(TInt aInterval)
1694 : TTimeIntervalBase(aInterval)
1696 Constructs the object with the specified interval value.
1698 @param aInterval The interval value with which the object is to be initialised.
1705 inline TTimeIntervalHours& TTimeIntervalHours::operator=(TInt aInterval)
1707 Assigns a value to this object.
1709 @param aInterval The interval value to be assigned.
1711 @return A reference to this object.
1713 {iInterval=aInterval;return(*this);}
1718 // Class TTimeIntervalDays
1719 inline TTimeIntervalDays::TTimeIntervalDays()
1721 Default constructor.
1723 Constructs an uninitialised object.
1730 inline TTimeIntervalDays::TTimeIntervalDays(TInt aInterval)
1731 : TTimeIntervalBase(aInterval)
1733 Constructs the object with the specified interval value.
1735 @param aInterval The interval value with which the object is to be initialised.
1742 inline TTimeIntervalDays& TTimeIntervalDays::operator=(TInt aInterval)
1744 Assigns a value to this object.
1746 @param aInterval The interval value to be assigned.
1748 @return A reference to this object.
1750 {iInterval=aInterval;return(*this);}
1755 // Class TTimeIntervalMonths
1756 inline TTimeIntervalMonths::TTimeIntervalMonths()
1758 Default constructor.
1760 Constructs an uninitialised object.
1767 inline TTimeIntervalMonths::TTimeIntervalMonths(TInt aInterval)
1768 : TTimeIntervalBase(aInterval)
1770 Constructs the object with the specified interval value.
1772 @param aInterval The interval value with which the object is to be initialised.
1779 inline TTimeIntervalMonths& TTimeIntervalMonths::operator=(TInt aInterval)
1781 Assigns a value to this object.
1783 @param aInterval The interval value to be assigned.
1785 @return A reference to this object.
1787 {iInterval=aInterval;return(*this);}
1792 // Class TTimeIntervalYears
1793 inline TTimeIntervalYears::TTimeIntervalYears()
1795 Default constructor.
1797 Constructs an uninitialised object.
1804 inline TTimeIntervalYears::TTimeIntervalYears(TInt aInterval)
1805 : TTimeIntervalBase(aInterval)
1807 Constructs the object with the specified interval value.
1809 @param aInterval The interval value with which the object is to be initialised.
1816 inline TTimeIntervalYears& TTimeIntervalYears::operator=(TInt aInterval)
1818 Assigns a value to this object.
1820 @param aInterval The interval value to be assigned.
1822 @return A reference to this object.
1824 {iInterval=aInterval;return(*this);}
1830 inline TTime::TTime()
1832 Default constructor.
1834 The object is initialised to an arbitrary value.
1841 inline TTime::TTime(const TInt64& aTime)
1844 Constructs the object from a 64-bit microsecond value.
1846 @param aTime Microsecond value to which to initialise the TTime object.
1853 inline TTime &TTime::operator=(const TInt64& aTime)
1855 Assigns a value contained in a 64-bit integer to this TTime object.
1857 @param aTime Microsecond value which to assign to the TTime object.
1859 @return This TTime object.
1861 {iTime=aTime;return(*this);}
1866 inline TBool TTime::operator==(TTime aTime) const
1868 Tests whether two date/times are equal.
1870 @param aTime The time to be compared with this TTime.
1872 @return True if the two TTimes are equal. False if not.
1874 {return(iTime==aTime.iTime);}
1879 inline TBool TTime::operator!=(TTime aTime) const
1881 Tests whether two date/times are not equal.
1883 @param aTime The date/time to be compared with this TTime.
1885 @return True if the two TTimes are different. False if the same.
1887 {return(iTime!=aTime.iTime);}
1892 inline TBool TTime::operator>=(TTime aTime) const
1894 Tests whether this date/time is later than or the same as the
1895 specified date/time.
1897 @param aTime The date/time to be compared with this date/time.
1899 @return True if this date/time is later than or the same as the
1900 specified date/time. False otherwise.
1902 {return(iTime>=aTime.iTime);}
1907 inline TBool TTime::operator<=(TTime aTime) const
1909 Tests whether this date/time is earlier than or the same as the
1910 specified date/time.
1912 @param aTime The date/time to be compared with this date/time.
1914 @return True if this date/time is earlier than or the same as the
1915 specified date/time. False otherwise.
1917 {return(iTime<=aTime.iTime);}
1922 inline TBool TTime::operator>(TTime aTime) const
1924 Tests whether this date/time is later than the specified date/time.
1926 @param aTime The date/time to be compared with this date/time.
1928 @return True if this date/time is later than the specified date/time.
1931 {return(iTime>aTime.iTime);}
1936 inline TBool TTime::operator<(TTime aTime) const
1938 Tests whether this date/time is earlier than the specified date/time.
1940 @param aTime The date/time to be compared with this date/time.
1942 @return True if this date/time is earlier than the specified date/time.
1945 {return(iTime<aTime.iTime);}
1950 inline const TInt64& TTime::Int64() const
1952 Gets the 64 bit integer representation of this TTime obect.
1954 @return The 64 bit integer representation.
1962 inline TLexMark8::TLexMark8()
1965 Default constructor.
1972 inline TLexMark8::TLexMark8(const TUint8 *aString)
1980 inline TLex8::TLex8(const TUint8 *aString)
1982 Constructs the object with a pointer to a string.
1984 The extraction mark and next character members are initialised to point
1985 to the start of the string.
1987 @param aString String to be assigned.
1989 {Assign(TPtrC8(aString));}
1994 inline TLex8::TLex8(const TDesC8 &aDes)
1996 Constructs the object with a descriptor.
1998 The extraction mark and next character
1999 members are initialised to point to the start of the string.
2001 @param aDes Descriptor to be assigned by reference.
2008 inline TLex8& TLex8::operator=(const TUint8* aString)
2010 Allows strings to be assigned to a TLex8.
2012 @param aString String to be assigned to the TLex8.
2014 @return TLex8 descriptor.
2016 {Assign(TPtrC8(aString));return(*this);}
2021 inline TLex8& TLex8::operator=(const TDesC8& aBuf)
2023 Allows descriptors to be assigned to a TLex8.
2025 @param aBuf Descriptor to be assigned to the TLex8.
2027 @return TLex8 descriptor.
2029 {Assign(aBuf);return(*this);}
2034 inline TBool TLex8::Eos() const
2036 Tests whether the next character position is at the end of the string.
2038 @return True if at end of string, false otherwise.
2040 {return(iNext==iEnd);}
2045 inline void TLex8::Mark()
2047 Sets the TLex8's next character position to its extraction mark.
2054 inline void TLex8::Mark(TLexMark8& aMark) const
2056 Sets the supplied extraction mark to the TLex8's next character position.
2058 @param aMark On return, this is set to the next character position.
2065 inline void TLex8::UnGetToMark()
2067 Sets the next character position to the current extraction mark position.
2069 @panic USER 63, if the extraction mark is before the start or beyond the end
2072 {UnGetToMark(iMark);}
2077 inline void TLex8::SkipAndMark(TInt aNumber)
2079 Moves the next character position a specified number of characters.
2081 @param aNumber Number of characters to skip.
2083 @panic USER 61, if the skip moves the next character position either to before
2084 the start or beyond the end of the string.
2086 {SkipAndMark(aNumber,iMark);}
2091 inline void TLex8::SkipSpaceAndMark()
2093 Moves the next character position past any white space and copies it to the
2094 TLex8's extraction mark.
2096 Stops if at the end of the string.
2098 {SkipSpaceAndMark(iMark);}
2103 inline TInt TLex8::TokenLength() const
2105 Gets the length of the token.
2107 This is the difference between the next character
2108 position and the extraction mark.
2110 @return Length of the token.
2112 {return(iNext-iMark.iPtr);}
2117 inline TInt TLex8::MarkedOffset() const
2119 Gets the offset of the extraction mark from the start of the string.
2121 @return The offset of the extraction mark.
2123 {return(iMark.iPtr-iBuf);}
2128 inline TInt TLex8::Val(TInt &aVal)
2130 Parses the string to extract a signed integer.
2132 @param aVal On return, contains the extracted integer.
2134 @return KErrNone if successful.
2135 KErrGeneral if the next character position is initially at the end of the string
2136 or no valid characters found initially.
2137 KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
2138 If error codes KErrGeneral or KErrOverflow are returned, the object's
2139 members are left unaltered.
2141 {return(Val((TInt32&)aVal));}
2146 inline TInt TLex8::Val(TUint &aVal,TRadix aRadix)
2148 Parses the string to extract an unsigned integer, using the specified radix.
2150 @param aVal On return, contains the extracted integer.
2151 @param aRadix The radix to use when converting the number. The default radix
2152 for this function overload is decimal.
2154 @return KErrNone if successful.
2155 KErrGeneral if the next character position is initially at the end of the string
2156 or no valid characters found initially.
2157 KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
2158 If error codes KErrGeneral or KErrOverflow are returned, the object's
2159 members are left unaltered.
2161 {return(Val((TUint32&)aVal,aRadix));}
2166 inline void TLex8::Assign(const TLex8& aLex)
2168 Assigns a string to this object from another TLex8 object.
2170 @param aLex The object to be assigned.
2172 {new(this) TLex8(aLex);}
2178 inline TLexMark16::TLexMark16()
2181 Default constructor.
2188 inline TLexMark16::TLexMark16(const TUint16 *aString)
2196 inline TLex16::TLex16(const TUint16 *aString)
2198 Constructs the object with a pointer to a string.
2200 The extraction mark and next character members are initialised to point
2201 to the start of the string.
2203 @param aString String to be assigned.
2205 {Assign(TPtrC16(aString));}
2210 inline TLex16::TLex16(const TDesC16 &aDes)
2212 Constructs the object with a descriptor.
2214 The extraction mark and next character
2215 members are initialised to point to the start of the string.
2217 @param aDes Descriptor to be assigned by reference.
2223 inline TLex16& TLex16::operator=(const TUint16* aString)
2225 Allows strings to be assigned to a TLex16.
2227 @param aString String to be assigned to the TLex16.
2229 @return TLex16 descriptor.
2231 {Assign(TPtrC16(aString));return(*this);}
2236 inline TLex16& TLex16::operator=(const TDesC16& aBuf)
2238 Allows descriptors to be assigned to a TLex16.
2240 @param aBuf Descriptor to be assigned to the TLex16.
2242 @return TLex8 descriptor.
2244 {Assign(aBuf);return(*this);}
2249 inline TBool TLex16::Eos() const
2251 Tests whether the next character position is at the end of the string.
2253 @return True if at end of string, false otherwise.
2255 {return(iNext==iEnd);}
2260 inline void TLex16::Mark(TLexMark16& aMark) const
2262 Sets the supplied extraction mark to the TLex16's next character position.
2264 @param aMark On return, set to the next character position.
2271 inline void TLex16::Mark()
2273 Sets the TLex16's next character position to its extraction mark.
2280 inline void TLex16::UnGetToMark()
2282 Sets the next character position to the current extraction mark position.
2284 @panic USER 68, if the specified mark is before the start or beyond the end
2287 {UnGetToMark(iMark);}
2292 inline void TLex16::SkipAndMark(TInt aNumber)
2294 Moves the next character position a specified number of characters.
2296 @param aNumber Number of characters to skip.
2298 @panic USER 68, if the skip moves the next character position either to before
2299 the start or beyond the end of the string.
2301 {SkipAndMark(aNumber,iMark);}
2306 inline void TLex16::SkipSpaceAndMark()
2308 Moves the next character position past any white space and copies it to the
2309 TLex16's extraction mark.
2311 Stops if at the end of the string.
2313 {SkipSpaceAndMark(iMark);}
2318 inline TInt TLex16::TokenLength() const
2320 Gets the length of the token.
2322 This is the difference between the next character
2323 position and the extraction mark.
2325 @return Length of the token.
2327 {return(iNext-iMark.iPtr);}
2332 inline TInt TLex16::MarkedOffset() const
2334 Gets the offset of the extraction mark from the start of the string.
2336 @return The offset of the extraction mark.
2338 {return(iMark.iPtr-iBuf);}
2343 inline TInt TLex16::Val(TInt &aVal)
2345 Parses the string to extract a signed integer.
2347 @param aVal On return, contains the extracted integer.
2349 @return KErrNone if successful.
2350 KErrGeneral if the next character position is initially at the end of the string
2351 or no valid characters found initially.
2352 KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
2353 If error codes KErrGeneral or KErrOverflow are returned, the object's
2354 members are left unaltered.
2356 {return(Val((TInt32&)aVal));}
2361 inline TInt TLex16::Val(TUint &aVal,TRadix aRadix)
2363 Parses the string to extract an unsigned integer, using the specified radix.
2365 @param aVal On return, contains the extracted integer.
2366 @param aRadix The radix to use when converting the number. The default radix
2367 for this function overload is decimal.
2369 @return KErrNone if successful.
2370 KErrGeneral if the next character position is initially at the end of the string
2371 or no valid characters found initially.
2372 KErrOverflow if there is sign overflow, i.e. converted value greater than limit.
2373 If error codes KErrGeneral or KErrOverflow are returned, the object's
2374 members are left unaltered.
2376 {return(Val((TUint32&)aVal,aRadix));}
2381 inline void TLex16::Assign(const TLex16& aLex)
2383 Assigns a string to this object from another TLex16 object.
2385 @param aLex The object to be assigned.
2387 {new(this) TLex16(aLex);}
2393 inline TLocale::TLocale(TInt)
2396 inline TInt TLocale::CountryCode() const
2398 Gets the code which is used to select country-specific locale data.
2400 The country code is the code used as the international dialling prefix.
2401 This code is also used to identify a country by the dialling software.
2403 @return The country code.
2405 {return(iCountryCode);}
2410 inline void TLocale::SetCountryCode(TInt aCode)
2412 Sets the value which is used to select country-specific locale data.
2414 This value can be retrieved by using TLocale::CountryCode(). The country code
2415 is the code used as the international dialling prefix. This code is also used
2416 to identify a country by the dialling software.
2418 @param aCode The country code.
2420 @see TLocale::CountryCode
2422 {iCountryCode=aCode;}
2427 inline TTimeIntervalSeconds TLocale::UniversalTimeOffset() const
2429 Gets the locale's universal time offset.
2431 @return Offset in seconds from universal time. Time zones east of universal
2432 time have positive offsets. Time zones west of universal time have negative
2435 @deprecated Use User::UTCOffset to get the current offset inclusive of daylight
2436 savings time. This function returns the same value, for compatibility.
2438 {return(iUniversalTimeOffset);}
2443 inline TDateFormat TLocale::DateFormat() const
2445 Gets the date format.
2447 @return The date format.
2449 {return(iDateFormat);}
2454 inline void TLocale::SetDateFormat(TDateFormat aFormat)
2456 Sets the date format.
2458 @param aFormat The date format to be used.
2460 {iDateFormat=aFormat;}
2465 inline TTimeFormat TLocale::TimeFormat() const
2467 Gets the time format (12 or 24 hour).
2469 @return The time format.
2471 {return(iTimeFormat);}
2476 inline void TLocale::SetTimeFormat(TTimeFormat aFormat)
2478 Sets the time format (12 or 24 hour).
2480 @param aFormat The time format.
2482 {iTimeFormat=aFormat;}
2487 inline TLocalePos TLocale::CurrencySymbolPosition() const
2489 Gets the currency symbol position.
2491 For negative currency values, this position may be
2492 reversed using SetNegativeCurrencySymbolOpposite().
2494 @return The currency symbol position.
2496 @see TLocale::SetNegativeCurrencySymbolOpposite
2498 {return(iCurrencySymbolPosition);}
2503 inline void TLocale::SetCurrencySymbolPosition(TLocalePos aPos)
2505 Sets the currency symbol position.
2507 @param aPos The currency symbol position.
2509 {iCurrencySymbolPosition=aPos;}
2514 inline TBool TLocale::CurrencySpaceBetween() const
2516 Gets whether or not a space is inserted between the currency symbol and the
2519 For negative currency values, the space can be removed using SetNegativeLoseSpace().
2521 @return True if a space is inserted; false if not.
2523 @see TLocale::SetNegativeLoseSpace
2525 {return(iCurrencySpaceBetween);}
2530 inline void TLocale::SetCurrencySpaceBetween(TBool aSpace)
2532 Sets whether a space is inserted between the currency symbol and the currency
2535 @param aSpace ETrue if a space is inserted; EFalse if not.
2537 {iCurrencySpaceBetween=aSpace;}
2542 inline TInt TLocale::CurrencyDecimalPlaces() const
2544 Gets the number of decimal places to which currency values are set.
2546 @return The number of decimal places.
2548 {return(iCurrencyDecimalPlaces);}
2553 inline void TLocale::SetCurrencyDecimalPlaces(TInt aPlaces)
2555 Sets the number of decimal places to which currency values should be set.
2557 @param aPlaces The number of decimal places.
2559 {iCurrencyDecimalPlaces=aPlaces;}
2564 inline TBool TLocale::CurrencyNegativeInBrackets() const
2568 Gets whether negative currency values are enclosed in brackets rather than
2569 being preceded by a minus sign.
2571 This is deprecated, use NegativeCurrencyFormat() instead.
2573 @return True if negative currency is enclosed in brackets and has no minus
2574 sign; false if negative currency has a minus sign and is not enclosed
2577 @see TLocale::NegativeCurrencyFormat
2579 {return((TBool)iNegativeCurrencyFormat);}
2584 inline void TLocale::SetCurrencyNegativeInBrackets(TBool aBool)
2588 Sets whether negative currency values are enclosed in brackets rather than
2589 being preceded by a minus sign.
2591 This is deprecated, use SetNegativeCurrencyFormat() instead.
2593 @param aBool ETrue, if a negative currency value must be enclosed in brackets
2594 without a minus sign; EFalse, if a negative currency value is
2595 preceded by a minus sign without any enclosing brackets.
2597 @see TLocale::SetNegativeCurrencyFormat
2599 {iNegativeCurrencyFormat=(aBool)?EInBrackets:ELeadingMinusSign;}
2604 inline TBool TLocale::CurrencyTriadsAllowed() const
2606 Gets whether triads are allowed in currency values. Triads are groups of
2607 three digits separated by the thousands separator.
2609 @return True if triads are allowed; false if not.
2611 {return(iCurrencyTriadsAllowed);}
2616 inline void TLocale::SetCurrencyTriadsAllowed(TBool aBool)
2618 Sets whether triads are allowed in currency values.
2620 @param aBool ETrue if triads are allowed; EFalse if triads not allowed.
2622 {iCurrencyTriadsAllowed=aBool;}
2627 inline TChar TLocale::ThousandsSeparator() const
2629 Gets the character used to separate groups of three digits to the left of
2630 the decimal separator.
2632 A thousands separator character is only displayed in currency values if currency
2635 @return The character used as the thousands separator.
2637 {return(iThousandsSeparator);}
2642 inline void TLocale::SetThousandsSeparator(const TChar& aChar)
2644 Sets the character to be used to separate groups of three digits to the left
2645 of the decimal separator.
2647 A thousands separator character is only displayed in currency values if currency
2650 @param aChar The character to be used as the thousands separator.
2652 {iThousandsSeparator=aChar;}
2657 inline TChar TLocale::DecimalSeparator() const
2659 Gets the character used to separate a whole number from its fractional part.
2661 @return The character used as the decimal separator.
2663 {return(iDecimalSeparator);}
2668 inline void TLocale::SetDecimalSeparator(const TChar& aChar)
2670 Sets the character to be used to separate a whole number from its fractional
2673 @param aChar The character to be used as the decimal separator.
2675 {iDecimalSeparator=aChar;}
2680 inline TChar TLocale::DateSeparator(TInt aIndex) const
2682 Gets one of the four characters used to separate the day, month and year
2683 components of the date.
2685 If the four separators are represented by S0, S1, S2 and S3 and the three
2686 date components are represented by XX, YY and ZZ, then the separators are
2687 located: S0 XX S1 YY S2 ZZ S3.
2689 @param aIndex An index indicating which of the four separators is being accessed.
2690 This must be a value between zero and three inclusive.
2692 @return A date separator character as determined by the value of aIndex.
2694 {return(iDateSeparator[aIndex]);}
2699 inline void TLocale::SetDateSeparator(const TChar& aChar,TInt aIndex)
2701 Sets one of the four characters used to separate the day, month and year
2702 components of the date.
2704 If the four separators are represented by S0, S1, S2 and S3 and the three
2705 date components are represented by XX, YY and ZZ, then the separators are
2706 located: S0 XX S1 YY S2 ZZ S3.
2708 @param aChar A date separator character to be used.
2709 @param aIndex An index indicating which of the four separators is being accessed.
2710 This must be a value between zero and three inclusive.
2712 {__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxDateSeparators,User::Invariant());
2713 iDateSeparator[aIndex]=aChar;}
2718 inline TChar TLocale::TimeSeparator(TInt aIndex) const
2720 Gets one of the four characters used to separate the hour, second and minute
2721 components of the time.
2723 If the four separators are represented by S0, S1, S2 and S3 and the three
2724 time components are represented by XX, YY and ZZ, then the separators are
2725 located: S0 XX S1 YY S2 ZZ S3.
2727 @param aIndex An index indicating which of the four separators is being
2728 accessed. This must be a value between zero and three inclusive.
2730 @return A time separator character as determined by the value of aIndex.
2733 {return(iTimeSeparator[aIndex]);}
2738 inline void TLocale::SetTimeSeparator(const TChar& aChar,TInt aIndex)
2740 Sets one of the four characters used to separate the hour, minute and second
2741 components of the date.
2743 If the four separators are represented by S0, S1, S2 and S3 and the three
2744 time components are represented by XX, YY and ZZ, then the separators are
2745 located: S0 XX S1 YY S2 ZZ S3.
2747 @param aChar A time separator character to be used.
2748 @param aIndex An index indicating which of the four separators is being accessed.
2749 This must be a value between zero and three inclusive.
2751 {__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxTimeSeparators,User::Invariant());
2752 iTimeSeparator[aIndex]=aChar;}
2757 inline TLocalePos TLocale::AmPmSymbolPosition() const
2759 Gets the am/pm text position (before or after the time value).
2761 @return The am/pm text position (0 before, 1 after).
2763 {return(iAmPmSymbolPosition);}
2768 inline void TLocale::SetAmPmSymbolPosition(TLocalePos aPos)
2770 Sets the am/pm text position (before or after the time value).
2772 @param aSpace The am/pm text position (0 before, 1 after).
2774 {iAmPmSymbolPosition=aPos;}
2779 inline TBool TLocale::AmPmSpaceBetween() const
2781 Tests whether or not a space is inserted between the time and the preceding
2782 or trailing am/pm text.
2784 @return True if a space is inserted between the time and am/pm text; false
2787 {return(iAmPmSpaceBetween);}
2792 inline void TLocale::SetAmPmSpaceBetween(TBool aSpace)
2794 Sets whether a space is inserted between the time and the preceding or trailing
2797 @param aPos ETrue if a space is inserted between the time and am/pm text;
2800 {iAmPmSpaceBetween=aSpace;}
2805 inline TUint TLocale::DaylightSaving() const
2807 Gets the zones in which daylight saving is in effect.
2809 If daylight saving is in effect, one hour is added to the time.
2811 Use TLocale::QueryHomeHasDaylightSavingOn() to find out whether daylight saving
2812 is in effect for the home city. This is because the daylight saving setting
2813 for the home city may differ from that of the zone in which home is located.
2815 @return A bit mask in which the three least significant bits are defined,
2816 indicating which of the three daylight saving zones are adjusted for
2817 daylight saving. These bits represent:
2818 Northern (non-European countries in the northern hemisphere),
2819 Southern (southern hemisphere),
2822 @see TLocale::QueryHomeHasDaylightSavingOn
2823 @see TDaylightSavingZone
2825 @deprecated Use the timezone server to retrieve information on timezones and DST.
2826 This method will always indicate that DST is inactive, in order to
2827 preserve compatibility.
2829 {return(iDaylightSaving);}
2834 inline TBool TLocale::QueryHomeHasDaylightSavingOn() const
2836 Tests whether or not daylight saving is set for the home city.
2838 @return True if home daylight saving is set; false if not.
2840 @deprecated Use the timezone server to retrieve information on timezones and DST.
2841 This method will always indicate that DST is inactive, in order to
2842 preserve compatibility.
2844 {return((iHomeDaylightSavingZone|EDstHome) & iDaylightSaving);}
2849 inline TDaylightSavingZone TLocale::HomeDaylightSavingZone() const
2851 Gets the daylight saving zone in which the home city is located.
2853 @return The daylight saving zone in which the home city is located.
2855 @deprecated Use the timezone server to retrieve information on timezones and DST.
2857 {return(iHomeDaylightSavingZone);}
2862 inline TUint TLocale::WorkDays() const
2864 Gets a bit mask representing the days of the week which are considered as
2867 @return A bit mask of seven bits indicating (by being set) which days are
2868 workdays. The least significant bit corresponds to Monday, the next bit to
2871 {return(iWorkDays);}
2876 inline void TLocale::SetWorkDays(TUint aMask)
2878 Sets the days of the week which are considered as working days.
2880 @param aMask A bit mask of seven bits indicating (by being set) which days
2881 are workdays. The least significant bit corresponds to Monday, the
2882 next bit is Tuesday and so on.
2889 inline TDay TLocale::StartOfWeek() const
2891 Gets the day which is considered the first day of the week.
2893 @return The first day of the week.
2895 {return(iStartOfWeek);}
2900 inline void TLocale::SetStartOfWeek(TDay aDay)
2902 Sets the day which is considered to be the first day of the week.
2904 @param aDay The first day of the week.
2906 {iStartOfWeek=aDay;}
2911 inline TClockFormat TLocale::ClockFormat() const
2913 Gets the clock display format.
2915 @return The clock display format.
2917 {return(iClockFormat);}
2922 inline void TLocale::SetClockFormat(TClockFormat aFormat)
2924 Sets the clock display format.
2926 @param aFormat The clock display format.
2928 {iClockFormat=aFormat;}
2933 inline TUnitsFormat TLocale::UnitsGeneral() const
2935 Gets the general units of measurement.
2937 This function should be used when both short and long distances use the
2938 same units of measurement.
2940 @return General units of measurement.
2942 {return(iUnitsGeneral);}
2947 inline void TLocale::SetUnitsGeneral(TUnitsFormat aFormat)
2949 Sets the general units of measurement.
2950 This function should be used when both short and long distances use the
2951 same units of measurement.
2953 @param aFormat General units of measurement.
2955 {iUnitsGeneral=aFormat;}
2960 inline TUnitsFormat TLocale::UnitsDistanceShort() const
2962 Gets the units of measurement for short distances.
2964 Short distances are those which would normally be represented by either
2965 metres and centimetres or feet and inches.
2967 @return Units of measurement for short distances.
2969 {return(iUnitsDistanceShort);}
2974 inline void TLocale::SetUnitsDistanceShort(TUnitsFormat aFormat)
2976 Sets the units of measurement for short distances.
2978 Short distances are those which would normally be represented by either
2979 metres and centimetres or feet and inches.
2981 @param aFormat Units of measurement for short distances.
2983 {iUnitsDistanceShort=aFormat;}
2988 inline TUnitsFormat TLocale::UnitsDistanceLong() const
2990 Gets the units of measurement for long distances.
2992 Long distances are those which would normally be represented by either
2993 miles or kilometres.
2995 @return Units of measurement for long distances.
2997 {return(iUnitsDistanceLong);}
3002 inline void TLocale::SetUnitsDistanceLong(TUnitsFormat aFormat)
3004 Sets the units of measurement for long distances.
3006 Long distances are those which would normally be represented by either
3007 miles or kilometres.
3009 @param aFormat Units of measurement for long distances.
3011 {iUnitsDistanceLong=aFormat;}
3016 inline void TLocale::SetNegativeCurrencyFormat(TLocale::TNegativeCurrencyFormat aNegativeCurrencyFormat)
3018 Sets the negative currency format.
3020 @param aNegativeCurrencyFormat How negative currency values are formatted.
3022 {iNegativeCurrencyFormat = aNegativeCurrencyFormat;}
3027 inline TLocale::TNegativeCurrencyFormat TLocale::NegativeCurrencyFormat() const
3029 Gets the negative currency format.
3031 @return How negative currency values are formatted.
3033 {return(iNegativeCurrencyFormat);}
3038 inline TBool TLocale::NegativeLoseSpace() const
3040 Gets whether negative currency values lose the space between the currency
3041 symbol and the value.
3043 @return True, if negative currency values lose the space between the value
3044 and the symbol; false, if not.
3047 if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeLoseSpace)==iExtraNegativeCurrencyFormatFlags)
3056 inline void TLocale::SetNegativeLoseSpace(TBool aBool)
3058 Sets whether negative currency values lose the space between the currency symbol
3061 @param aBool ETrue to set a flag which indicates that negative currency values
3062 should lose the space between the value and the symbol. EFalse to unset it.
3066 iExtraNegativeCurrencyFormatFlags |= EFlagNegativeLoseSpace;
3068 iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeLoseSpace;
3074 inline TBool TLocale::NegativeCurrencySymbolOpposite() const
3076 Gets whether in negative currency values, the position of the currency symbol
3077 is set to be the opposite of the position used for non-negative values (before
3078 or after the value, as set by SetCurrencySymbolPosition()).
3080 @return True, if the currency symbol position for negative currency values
3081 is the opposite of the position set by SetCurrencySymbolPosition();
3084 @see TLocale::SetCurrencySymbolPosition
3087 if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeCurrencySymbolOpposite)==iExtraNegativeCurrencyFormatFlags)
3096 inline void TLocale::SetNegativeCurrencySymbolOpposite(TBool aBool)
3098 Sets whether the position of the currency symbol for negative currency values
3099 should be the opposite of the position used for non-negative values (before
3100 or after the value, as set by SetCurrencySymbolPosition()).
3102 @param aBool ETrue to set the position of the currency symbol in negative
3103 currency values to be the opposite of the position as set
3104 using SetCurrencySymbolPosition(). EFalse to leave the
3107 @see TLocale::SetCurrencySymbolPosition
3111 iExtraNegativeCurrencyFormatFlags |= EFlagNegativeCurrencySymbolOpposite;
3113 iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeCurrencySymbolOpposite;
3119 inline TLanguage TLocale::LanguageDowngrade(TInt aIndex) const
3121 Gets the language that is stored at the specified index into the customisable
3122 part of the language downgrade path.
3124 The second, third and fourth languages in the language downgrade path can
3125 be customised. These can be enquired using this function. The first language
3126 in the path is always the language of the current locale, as returned by User::Language().
3128 The languages in the downgrade path are used in turn by the BaflUtils::NearestLanguageFile()
3129 function to find the best matching language-specific version of a language-neutral
3132 The full language downgrade path can be retrieved using BaflUtils::GetDowngradePath().
3134 @param aIndex An index into the customisable part of the language downgrade
3135 path. Between zero and two inclusive.
3137 @return The language at the specified index.
3139 @see BaflUtils::NearestLanguageFile
3140 @see BaflUtils::GetDowngradePath
3143 __ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
3144 return static_cast<TLanguage>(iLanguageDowngrade[aIndex]);
3150 inline void TLocale::SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage)
3152 Sets a language in the customisable part of the language downgrade path.
3154 @param aIndex An index into the customisable part of the path at which to
3155 add the language, a value between zero and two.
3156 @param aLanguage The language to add. ELangNone is considered to be the last
3157 language in the path, no more will be searched, so can be used
3158 to specify that no language downgrade is required.
3160 @see BaflUtils::NearestLanguageFile
3161 @see BaflUtils::GetDowngradePath
3164 __ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
3165 iLanguageDowngrade[aIndex] = static_cast<TUint16>(aLanguage);
3172 Gets the number mode stored in the locale.
3174 @return The number mode for the locale.
3176 inline TDigitType TLocale::DigitType() const
3177 { return iDigitType; }
3183 Sets the number mode for the locale.
3185 @param aDigitType The number mode to be set.
3187 inline void TLocale::SetDigitType(TDigitType aDigitType)
3188 { iDigitType=aDigitType; }
3194 Sets the device time state.
3196 @param aState The device time state.
3198 @deprecated Use the timezone server to coordinate automatic time adjustment.
3200 inline void TLocale::SetDeviceTime(TDeviceTimeState aState)
3202 iDeviceTimeState=aState;
3206 inline TLocale* TExtendedLocale::GetLocale()
3207 { return &iLocale; }
3211 Gets the device time state.
3213 @return The device time state.
3215 @deprecated Use the timezone server to coordinate automatic time adjustment.
3217 inline TLocale::TDeviceTimeState TLocale::DeviceTime() const
3219 return iDeviceTimeState;
3223 // Class TFindSemaphore
3224 inline TFindSemaphore::TFindSemaphore()
3227 Constructs the object with a default match pattern.
3229 The default match pattern, as implemented by the base class, is the single
3232 A new match pattern can be set after construction by calling the Find() member
3233 function of the TFindHandleBase base class.
3235 @see TFindHandleBase::Find
3242 inline TFindSemaphore::TFindSemaphore(const TDesC &aMatch)
3243 : TFindHandleBase(aMatch)
3245 Constructs this object with the specified match pattern.
3247 A new match pattern can be set after construction by
3248 calling TFindHandleBase::Find().
3250 Note that after construction, the object contains a copy of the supplied
3251 match pattern; the source descriptor can, therefore, be safely discarded.
3253 @param aMatch A reference to the descriptor containing the match pattern.
3255 @see TFindHandleBase::Find
3263 inline TFindMutex::TFindMutex()
3266 Constructs this object with a default match pattern.
3268 The default match pattern, as implemented by the base class, is the single
3271 A new match pattern can be set after construction by calling the Find() member
3272 function of the TFindHandleBase base class.
3274 @see TFindHandleBase::Find
3281 inline TFindMutex::TFindMutex(const TDesC &aMatch)
3282 : TFindHandleBase(aMatch)
3284 Constructs this object with the specified match pattern.
3286 A new match pattern can be set after construction by calling the Find() member
3287 function of the TFindHandleBase base class.
3289 After construction, the object contains a copy of the supplied match pattern;
3290 the source descriptor can, therefore, be safely discarded.
3292 @param aMatch The match pattern.
3294 @see TFindHandleBase::Find
3302 inline TFindChunk::TFindChunk()
3305 Constructs this object with a default match pattern.
3307 The default match pattern, as implemented by the base class, is
3308 the single character "*".
3310 A new match pattern can be set after construction by
3311 calling TFindHandleBase::Find().
3313 @see TFindHandleBase
3320 inline TFindChunk::TFindChunk(const TDesC &aMatch)
3321 : TFindHandleBase(aMatch)
3323 Constructs the object with the specified match pattern.
3325 A new match pattern can be set after construction by
3326 calling TFindHandleBase::Find().
3328 @param aMatch The match pattern.
3330 @see TFindHandleBase
3337 // Class TFindThread
3338 inline TFindThread::TFindThread()
3341 Constructs this object with a default match pattern.
3343 The default match pattern, as implemented by the base class,
3344 is the single character *.
3346 A new match pattern can be set after construction
3347 by calling TFindHandleBase::Find().
3349 @see TFindHandleBase::Find
3356 inline TFindThread::TFindThread(const TDesC &aMatch)
3357 : TFindHandleBase(aMatch)
3359 Constructs this object with the specified match pattern.
3361 A new match pattern can be set after construction
3362 by calling the TFindHandleBase::Find().
3364 @see TFindHandleBase::Find
3371 // Class TFindProcess
3372 inline TFindProcess::TFindProcess()
3375 Constructs this object with a default match pattern.
3377 The default match pattern, as implemented by the base class,
3378 is the single character *.
3380 A new match pattern can be set after construction
3381 by calling TFindHandleBase::Find().
3383 @see TFindHandleBase::Find
3390 inline TFindProcess::TFindProcess(const TDesC &aMatch)
3391 : TFindHandleBase(aMatch)
3393 Constructs this object with the specified match pattern.
3395 A new match pattern can be set after construction
3396 by calling the TFindHandleBase::Find().
3398 @see TFindHandleBase::Find
3405 // Class TFindLogicalDevice
3407 Constructs the LDD factory object with a default match pattern.
3409 The default match pattern, as implemented by the base class, is the single
3412 A new match pattern can be set after construction by calling the Find() member
3413 function of the TFindHandleBase base class.
3415 @see TFindHandleBase::Find
3417 inline TFindLogicalDevice::TFindLogicalDevice()
3422 Constructs the LDD factory object with a specified match pattern.
3424 A new match pattern can be set after construction by calling
3425 TFindHandleBase::Find().
3427 @param aMatch The match pattern.
3429 @see TFindHandleBase::Find
3431 inline TFindLogicalDevice::TFindLogicalDevice(const TDesC &aMatch)
3432 : TFindHandleBase(aMatch)
3435 // Class TFindPhysicalDevice
3437 Constructs the PDD factory object with a default match pattern.
3439 The default match pattern, as implemented by the base class, is the single
3442 A new match pattern can be set after construction by calling the Find() member
3443 function of the TFindHandleBase base class.
3445 @see TFindHandleBase::Find
3447 inline TFindPhysicalDevice::TFindPhysicalDevice()
3452 Constructs the PDD factory object with a specified match pattern.
3454 A new match pattern can be set after construction by calling
3455 TFindHandleBase::Find().
3457 @param aMatch The match pattern.
3459 @see TFindHandleBase::Find
3461 inline TFindPhysicalDevice::TFindPhysicalDevice(const TDesC &aMatch)
3462 : TFindHandleBase(aMatch)
3469 // Class TFindServer
3470 inline TFindServer::TFindServer()
3473 Constructs the object with a default match pattern.
3475 The default match pattern, as implemented by the base class, is the single
3478 A new match pattern can be set after construction by calling the Find() member
3479 function of the TFindHandleBase base class.
3481 @see TFindHandleBase::Find
3488 inline TFindServer::TFindServer(const TDesC &aMatch)
3489 : TFindHandleBase(aMatch)
3491 Constructs the object with a specified match pattern.
3493 A new match pattern can be set after construction by calling
3494 TFindHandleBase::Find().
3496 @param aMatch The match pattern.
3498 @see TFindHandleBase::Find
3505 // Class TFindLibrary
3506 inline TFindLibrary::TFindLibrary()
3509 Constructs this object with a default match pattern.
3511 The default match pattern is the single character ‘*’ and is implemented by
3512 the base class TFindHandleBase.
3519 inline TFindLibrary::TFindLibrary(const TDesC &aMatch)
3520 : TFindHandleBase(aMatch)
3522 Constructs this object with the specified match pattern.
3524 @param aMatch The descriptor containing the match pattern.
3533 Opens a handle to an LDD factory object found using a TFindLogicalDevice object.
3535 A TFindLogicalDevice object is used to find all LDD factory objects whose full names match
3536 a specified pattern.
3538 @param aFind A reference to the object which is used to find the LDD factory object.
3539 @param aType An enumeration whose enumerators define the ownership of this
3540 LDD factory object handle. If not explicitly specified, EOwnerProcess is
3543 @return KErrNone if successful, otherwise one of the other system wide error
3546 inline TInt RDevice::Open(const TFindLogicalDevice& aFind,TOwnerType aType)
3547 {return(RHandleBase::Open(aFind,aType));}
3552 // Class RCriticalSection
3553 inline TBool RCriticalSection::IsBlocked() const
3555 Tests whether the critical section is occupied by another thread.
3557 @return True, if the critical section is occupied by another thread. False,
3560 {return(iBlocked!=1);}
3566 inline TInt RMutex::Open(const TFindMutex& aFind,TOwnerType aType)
3568 Opens a handle to the global mutex found using a TFindMutex object.
3570 A TFindMutex object is used to find all global mutexes whose full names match
3571 a specified pattern.
3573 By default, any thread in the process can use this instance of RMutex to access
3574 the mutex. However, specifying EOwnerThread as the second parameter to this
3575 function, means that only the opening thread can use this instance of RMutex
3576 to access the mutex; any other thread in this process that wants to access
3577 the mutex must either duplicate the handle or use OpenGlobal() again.
3579 @param aFind A reference to the object which is used to find the mutex.
3580 @param aType An enumeration whose enumerators define the ownership of this
3581 mutex handle. If not explicitly specified, EOwnerProcess is
3584 @return KErrNone if successful, otherwise one of the other system wide error
3587 {return(RHandleBase::Open(aFind,aType));}
3593 inline TInt RChunk::Open(const TFindChunk& aFind,TOwnerType aType)
3595 Opens a handle to the global chunk found using a TFindChunk object.
3597 A TFindChunk object is used to find all chunks whose full names match
3598 a specified pattern.
3600 By default, ownership of this chunk handle is vested in the current process,
3601 but can be vested in the current thread by passing EOwnerThread as the second
3602 parameter to this function.
3604 @param aFind A reference to the TFindChunk object used to find the chunk.
3605 @param aType An enumeration whose enumerators define the ownership of this
3606 chunk handle. If not explicitly specified, EOwnerProcess is
3609 @return KErrNone if successful, otherwise another of the system error codes.
3611 {return(RHandleBase::Open(aFind,aType));}
3616 inline TBool RChunk::IsReadable() const
3618 Tests whether the chunk is mapped into its process address space.
3620 @return True, if the chunk is readable; false, otherwise.
3622 {return (Attributes()&RHandleBase::EDirectReadAccess); }
3627 inline TBool RChunk::IsWritable() const
3629 Tests whether the chunk mapped into its process address space and is writable.
3631 @return True, if the chunk is writable; false, otherwise.
3633 {return (Attributes()&RHandleBase::EDirectWriteAccess); }
3639 inline TObjectId::TObjectId()
3641 Default constructor.
3648 inline TObjectId::TObjectId(TUint64 aId)
3651 Constructor taking an unsigned integer value.
3653 @param aId The value of the object id.
3660 inline TUint64 TObjectId::Id() const
3662 Return the ID as a 64 bit integer
3669 inline TObjectId::operator TUint() const
3671 Conversion operator invoked by the compiler when a TObjectId type is passed
3672 to a function that is prototyped to take a TUint type.
3676 { return TUint(iId); }
3681 inline TBool TObjectId::operator==(TObjectId aId) const
3683 Tests whether this thread Id is equal to the specified Id.
3685 @param aId The thread Id to be compared with this thread Id.
3687 @return True, if the thread Ids are equal; false otherwise.
3689 {return iId==aId.iId;}
3694 inline TBool TObjectId::operator!=(TObjectId aId) const
3696 Tests whether this thread Id is unequal to the specified thread Id.
3698 @param aId The thread Id to be compared with this thread Id.
3700 @return True, if the thread Ids are unequal; false otherwise.
3702 {return iId!=aId.iId;}
3708 inline TThreadId::TThreadId()
3711 Default constructor.
3718 inline TThreadId::TThreadId(TUint64 aId)
3721 Constructor taking an unsigned integer value.
3723 @param aId The value of the thread id.
3731 inline RThread::RThread()
3732 : RHandleBase(KCurrentThreadHandle)
3734 Default constructor.
3736 The constructor exists to initialise private data within this handle; it does
3737 not create the thread object.
3739 Specifically, it sets the handle-number to the value KCurrentThreadHandle.
3740 In effect, the constructor creates a default thread handle.
3747 inline TInt RThread::Open(const TFindThread& aFind,TOwnerType aType)
3749 Opens a handle to the thread found by pattern matching a name.
3751 A TFindThread object is used to find all threads whose full names match a
3754 By default, ownership of this thread handle is vested in the current process,
3755 but can be vested in the current thread by passing EOwnerThread as the second
3756 parameter to this function.
3758 @param aFind A reference to the TFindThread object used to find the thread.
3759 @param aType An enumeration whose enumerators define the ownership of this
3760 thread handle. If not explicitly specified, EOwnerProcess is
3763 @return KErrNone if successful, otherwise one of the other system-wide error codes.
3765 {return(RHandleBase::Open(aFind,aType));}
3770 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3772 inline TBool RThread::HasCapability(TCapability aCapability, const char* aDiagnostic) const
3774 return DoHasCapability(aCapability, aDiagnostic);
3777 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
3779 return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
3782 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3784 // Only available to NULL arguments
3785 inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
3787 return DoHasCapability(aCapability);
3790 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
3792 return DoHasCapability(aCapability1, aCapability2);
3795 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3796 // For things using KSuppressPlatSecDiagnostic
3797 inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3799 return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
3802 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3804 return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
3807 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3809 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3812 inline TProcessId::TProcessId()
3815 Default constructor.
3822 inline TProcessId::TProcessId(TUint64 aId)
3825 Constructor taking an unsigned integer value.
3827 @param aId The value of the process id.
3835 inline RProcess::RProcess()
3836 : RHandleBase(KCurrentProcessHandle)
3838 Default constructor.
3840 The constructor exists to initialise private data within this handle; it does
3841 not create the process object.
3843 Specifically, it sets the handle-number to the value KCurrentProcessHandle.
3844 In effect, the constructor creates a default process handle.
3851 inline RProcess::RProcess(TInt aHandle)
3852 : RHandleBase(aHandle)
3854 Constructor taking a handle number.
3856 @param aHandle The handle number to be used to construct this RProcess handle.
3863 inline TInt RProcess::Open(const TFindProcess& aFind,TOwnerType aType)
3865 Opens a handle to the process found by pattern matching a name.
3867 A TFindProcess object is used to find all processes whose full names match
3868 a specified pattern.
3870 By default, ownership of this process handle is vested in the current process,
3871 but can be vested in the current thread by passing EOwnerThread as the second
3872 parameter to this function.
3874 @param aFind A reference to the TFindProcess object used to find the process.
3875 @param aType An enumeration whose enumerators define the ownership of this
3876 process handle. If not explicitly specified, EOwnerProcess is taken
3879 @return KErrNone if successful, otherwise one of the other system-wide error codes.
3881 {return(RHandleBase::Open(aFind,aType));}
3886 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3888 inline TBool RProcess::HasCapability(TCapability aCapability, const char* aDiagnostic) const
3890 return DoHasCapability(aCapability, aDiagnostic);
3893 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
3895 return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
3898 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3900 // Only available to NULL arguments
3901 inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
3903 return DoHasCapability(aCapability);
3906 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
3908 return DoHasCapability(aCapability1, aCapability2);
3911 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3912 // For things using KSuppressPlatSecDiagnostic
3913 inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3915 return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
3918 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3920 return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
3923 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3925 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3931 // Class RSessionBase
3935 Creates a session with a server, specifying no message slots.
3937 It should be called as part of session initialisation in the derived class.
3939 Message slots are not pre-allocated for the session but are taken from
3940 a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
3941 This raises a risk of failure due to lack of memory and, therefore, this mode
3942 of operation is not viable for sessions that make guarantees about the failure
3943 modes of asynchonous services.
3945 @param aServer The name of the server with which a session is to
3947 @param aVersion The lowest version of the server with which this client
3950 @return KErrNone if successful, otherwise one of the other system-wide error
3953 inline TInt RSessionBase::CreateSession(const TDesC& aServer,const TVersion& aVersion)
3954 {return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
3960 Creates a session with a server, specifying no message slots.
3962 It should be called as part of session initialisation in the derived class.
3964 Message slots are not pre-allocated for the session but are taken from
3965 a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
3966 This raises a risk of failure due to lack of memory and, therefore, this mode
3967 of operation is not viable for sessions that make guarantees about the failure
3968 modes of asynchonous services.
3970 @param aServer A handle to a server with which a session is to be established.
3971 @param aVersion The lowest version of the server with which this client
3974 @return KErrNone if successful, otherwise one of the other system-wide error
3977 inline TInt RSessionBase::CreateSession(RServer2 aServer,const TVersion& aVersion)
3978 {return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
3984 Issues a blind request to the server with the specified function number,
3987 A blind request is one where the server does not issue a response
3990 @param aFunction The function number identifying the request.
3991 @param aArgs A set of up to 4 arguments and their types to be passed
3994 @return KErrNone, if the send operation is successful;
3995 KErrServerTerminated, if the server no longer present;
3996 KErrServerBusy, if there are no message slots available;
3997 KErrNoMemory, if there is insufficient memory available.
3999 @panic USER 72 if the function number is negative.
4001 inline TInt RSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
4002 {return DoSend(aFunction,&aArgs);}
4008 Issues an asynchronous request to the server with the specified function
4009 number and arguments.
4011 The completion status of the request is returned via the request
4012 status object, aStatus.
4014 @param aFunction The function number identifying the request.
4015 @param aArgs A set of up to 4 arguments and their types to be passed
4017 @param aStatus The request status object used to contain the completion status
4020 @panic USER 72 if the function number is negative.
4022 inline void RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
4023 {DoSendReceive(aFunction,&aArgs,aStatus);}
4029 Issues a synchronous request to the server with the specified function number
4032 @param aFunction The function number identifying the request.
4033 @param aArgs A set of up to 4 arguments and their types to be passed
4036 @return KErrNone, if the send operation is successful;
4037 KErrServerTerminated, if the server no longer present;
4038 KErrServerBusy, if there are no message slots available;
4039 KErrNoMemory, if there is insufficient memory available.
4041 @panic USER 72 if the function number is negative.
4043 inline TInt RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
4044 {return DoSendReceive(aFunction,&aArgs);}
4050 Issues a blind request to the server with the specified function number,
4051 but with no arguments.
4053 A blind request is one where the server does not issue a response
4056 @param aFunction The function number identifying the request.
4058 @return KErrNone, if the send operation is successful;
4059 KErrServerTerminated, if the server no longer present;
4060 KErrServerBusy, if there are no message slots available;
4061 KErrNoMemory, if there is insufficient memory available.
4063 @panic USER 72 if the function number is negative.
4065 inline TInt RSessionBase::Send(TInt aFunction) const
4066 {return DoSend(aFunction,NULL);}
4072 Issues an asynchronous request to the server with the specified function
4073 number, but with no arguments.
4075 The completion status of the request is returned via the request
4076 status object, aStatus.
4078 @param aFunction The function number identifying the request.
4079 @param aStatus The request status object used to contain the completion
4080 status of the request.
4082 @panic USER 72 if the function number is negative.
4084 inline void RSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
4085 { DoSendReceive(aFunction,NULL,aStatus);}
4091 Sets the handle-number of this handle to the specified
4094 The function can take a (zero or positive) handle-number,
4095 or a (negative) error number.
4097 If aHandleOrError represents a handle-number, then the handle-number of this handle
4098 is set to that value.
4099 If aHandleOrError represents an error number, then the handle-number of this handle is set to zero
4100 and the negative value is returned.
4102 @param aHandleOrError A handle-number, if zero or positive; an error value, if negative.
4104 @return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.
4106 inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError)
4107 { return RHandleBase::SetReturnedHandle(aHandleOrError);}
4112 inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle)
4113 { return RHandleBase::SetReturnedHandle(aHandleOrError,aHandle);}
4115 Issues a synchronous request to the server with the specified function number,
4116 but with no arguments.
4118 @param aFunction The function number identifying the request.
4120 @return KErrNone, if the send operation is successful;
4121 KErrServerTerminated, if the server no longer present;
4122 KErrServerBusy, if there are no message slots available;
4123 KErrNoMemory, if there is insufficient memory available.
4125 @panic USER 72 if the function number is negative.
4127 inline TInt RSessionBase::SendReceive(TInt aFunction) const
4128 {return DoSendReceive(aFunction,NULL);}
4133 // Class RSubSessionBase
4134 inline RSubSessionBase::RSubSessionBase()
4135 : iSubSessionHandle(0)
4144 inline TInt RSubSessionBase::SubSessionHandle() const
4146 Gets the sub-session handle number.
4148 This number is automatically passed to the server when making requests and is
4149 used to identify the appropriate server-side sub-session.
4151 @return The sub-session handle number.
4153 {return iSubSessionHandle;}
4159 Creates a new sub-session within an existing session.
4161 @param aSession The session to which this sub-session will belong.
4162 @param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
4163 @param aArgs The message arguments.
4165 @return KErrNone if successful, otherwise one of the system-wide error codes.
4167 inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs)
4168 { return DoCreateSubSession(aSession,aFunction,&aArgs); }
4174 Creates a new sub-session within an existing session.
4176 This variant sends no message arguments to the server.
4178 @param aSession The session to which this sub-session will belong.
4179 @param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
4181 @return KErrNone if successful, otherwise one of the system-wide error codes.
4183 inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction)
4184 { return DoCreateSubSession(aSession,aFunction,NULL); }
4190 Sends a blind message to the server - no reply is expected.
4192 A set of message arguments is passed that can be used to specify client
4193 addresses, which the server can use to read from and write to the client
4196 Note that this function can fail if there are no available message-slots, either
4197 in the system wide pool (if this is being used), or in the session reserved pool
4198 (if this is being used). If the client request is synchronous, then always use
4199 the synchronous variant of SendReceive(); this is guaranteed to reach the server.
4201 @param aFunction The opcode specifying the requested service.
4202 @param aArgs The message arguments.
4204 @return KErrNone if successful, otherwise one of the system-wide error codes.
4206 inline TInt RSubSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
4207 {return DoSend(aFunction,&aArgs);}
4213 Sends a message to the server and waits asynchronously for the reply.
4215 An opcode specifies the service required.
4216 A set of message arguments is passed that can be used to specify client addresses,
4217 which the server can use to read from and write to the client address space.
4219 Note that this function can fail if there are no available message-slots,
4220 either in the system wide pool (if this is being used), or in the session
4221 reserved pool (if this is being used). If the client request is synchronous,
4222 then always use the synchronous variant of SendReceive();
4223 this is guaranteed to reach the server.
4225 @param aFunction The opcode specifying the requested service.
4226 @param aArgs The message arguments.
4227 @param aStatus A request status which indicates the completion status of the asynchronous request.
4229 inline void RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
4230 {DoSendReceive(aFunction,&aArgs,aStatus);}
4236 Sends a message to the server and waits synchronously for a reply.
4238 An opcode specifies the service required.
4239 A set of message arguments is passed that can be used to specify client addresses,
4240 which the server can use to read from and write to the client address space.
4242 Note that this function will only fail if the server itself fails or environmental
4243 errors occur in the server. All requests made using this function are guaranteed to
4244 reach the server. This means that all synchronous client requests (typically those
4245 that return void) should be routed through this synchronous variant of SendReceive().
4247 @param aFunction The opcode specifying the requested service.
4248 @param aArgs The message arguments.
4250 @return KErrNone if successful, otherwise one of the system-wide error codes.
4252 inline TInt RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
4253 {return DoSendReceive(aFunction,&aArgs);}
4259 Sends a blind message to the server - no reply is expected.
4261 This variant sends no message arguments to the server.
4263 @param aFunction The opcode specifying the requested service.
4265 @return KErrNone if successful, otherwise one of the system-wide error codes.
4267 inline TInt RSubSessionBase::Send(TInt aFunction) const
4268 {return DoSend(aFunction,NULL);}
4274 Sends a message to the server and waits asynchronously for the reply.
4276 An opcode specifies the service required.
4277 This variant sends no message arguments to the server.
4279 @param aFunction The opcode specifying the requested service.
4280 @param aStatus A request status which indicates the completion status of the asynchronous request.
4282 inline void RSubSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
4283 { DoSendReceive(aFunction,NULL,aStatus);}
4289 Sends a message to the server and waits synchronously for a reply.
4291 An opcode specifies the service required.
4292 This variant sends no message arguments to the server.
4294 @param aFunction The opcode specifying the requested service.
4296 @return KErrNone if successful, otherwise one of the system-wide error codes.
4298 inline TInt RSubSessionBase::SendReceive(TInt aFunction) const
4299 {return DoSendReceive(aFunction,NULL);}
4307 Default constructor.
4309 inline RRefBase::RRefBase()
4318 @param aRef A reference to the object to be copied.
4320 inline RRefBase::RRefBase(const RRefBase &aRef)
4330 Default constructor.
4333 inline RRef<T>::RRef()
4341 The constructor frees any existing contained object, and takes ownership of
4342 the object owned by anObject.
4344 @param anObject A reference to another 'reference' object.
4345 On return from this constructor, anObject may be safely
4346 orphaned if it lives on the program stack.
4349 inline RRef<T>::RRef(const RRef<T> &anObject)
4356 Assignment operator.
4358 The constructor frees any existing contained object, and takes ownership of
4359 the object owned by anObject.
4361 @param anObject A reference to another 'reference' object.
4362 On return from this constructor, anObject may be safely
4363 orphaned if it lives on the program stack.
4366 inline void RRef<T>::operator=(const RRef<T> &anObject)
4373 Gets a pointer to the contained object.
4375 @return A pointer to the contained object
4378 inline T *RRef<T>::operator->()
4379 {return((T *)iPtr);}
4385 Gets a pointer to the contained object.
4387 @return A pointer to the contained object
4390 inline RRef<T>::operator T*()
4391 {return((T *)iPtr);}
4397 Creates a copy of the specified object, which is to be contained by
4398 this reference object.
4400 The amount of memory set aside to contain the object is defined by the size
4403 @param anObject The object to be packaged up by this reference object.
4406 void RRef<T>::Alloc(const T &anObject)
4407 {DoAlloc(&anObject,sizeof(T));}
4413 Creates a copy of the specified object, which is to be contained by
4414 this reference object.
4416 The amount of memory set aside to contain the object is defined by aSize.
4418 @param anObject The object to be packaged up by this reference object.
4419 @param aSize The amount of memory to be set aside to contain the object.
4420 You must make sure that this is big enough.
4423 void RRef<T>::Alloc(const T &anObject,TInt aSize)
4424 {DoAlloc(&anObject,aSize);}
4430 Creates a copy of the specified object, which is to be contained by
4431 this reference object, and leaves on failure.
4433 The amount of memory set aside to contain the object is defined by the size
4436 @param anObject The object to be packaged up by this reference object.
4439 void RRef<T>::AllocL(const T &anObject)
4440 {DoAllocL(&anObject,sizeof(T));}
4446 Creates a copy of the specified object, which is to be contained by
4447 this reference object, and leaves on failure.
4449 The amount of memory set aside to contain the object is defined by aSize.
4451 @param anObject The object to be packaged up by this reference object.
4452 @param aSize The amount of memory to be set aside to contain the object.
4453 You must make sure that this is big enough.
4456 void RRef<T>::AllocL(const T &anObject,TInt aSize)
4457 {DoAllocL(&anObject,aSize);}
4463 inline TBool TRegion::CheckError() const
4465 Tests whether the region's error flag is set.
4467 The error flag may be set:
4469 1. when an attempt to allocate more memory for the region fails
4471 2. if an attempt is made to expand a fixed size region beyond its allocated
4474 3. if ForceError() has been called.
4476 Use Clear() to unset the error flag, clear the region and free all allocated
4479 @return True, if the error flag is set; false, otherwise.
4481 @see TRegion::ForceError
4489 inline TInt TRegion::Count() const
4491 Gets the number of rectangles in this region.
4493 @return The number of rectangles.
4500 inline const TRect *TRegion::RectangleList() const
4502 Gets a pointer to the array of rectangles defining this region.
4504 @return Pointer to the array of rectangles. Note that array is a standard
4505 C++ array, i.e. a concatenated set of TRect objects. Use Count() to
4506 get the number of rectangles.
4510 {return(((TRegion *)this)->RectangleListW());}
4515 inline TRegion::TRegion()
4522 inline TInt RRegion::CheckSpare() const
4524 Gets the number of free memory slots in the region.
4526 This is the number of slots which have been allocated, minus the number in
4529 @return The number of free memory slots in the region.
4531 {return(iAllocedRects-iCount);}
4538 inline TRegionFix<S>::TRegionFix() : TRegion(-S)
4540 Constructs a default fixed size region.
4548 inline TRegionFix<S>::TRegionFix(const TRect &aRect) : TRegion(-S)
4550 Constructs a fixed size region with a TRect.
4552 @param aRect Rectangle to be added to the newly constructed region.
4560 inline TRegionFix<S>::TRegionFix(const TRegionFix<S> &aRegion)
4564 @param aRegion The TRegionFix object to be copied.
4572 inline RRegionBuf<S>::RRegionBuf() : RRegion(-S&(~ERRegionBuf),S)
4574 Constructs a default object.
4576 The granularity is the value of the template parameter.
4583 inline RRegionBuf<S>::RRegionBuf(const RRegion &aRegion)
4585 Constructs this object from the specified RRegion.
4587 @param aRegion The region to assign to this RRegionBuf.
4595 inline RRegionBuf<S>::RRegionBuf(const TRect &aRect) : RRegion(-S&(~ERRegionBuf),S)
4597 Constructs an RRegionBuf with a TRect.
4599 Its granularity is initialised to the value contained in the template argument.
4600 The resulting region consists of the specified single rectangle.
4602 @param aRect The single rectangle with which to initialise the region.
4610 inline RRegionBuf<S>::RRegionBuf(const RRegionBuf<S> &aRegion)
4612 Copy constructs from an existing RRegionBuf object.
4614 @param aRegion The RRegionBuf to be copied.
4621 // enum TTimerLockSpec
4622 inline TTimerLockSpec &operator++(TTimerLockSpec &aLock)
4624 return aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
4626 inline TTimerLockSpec operator++(TTimerLockSpec &aLock, TInt)
4628 TTimerLockSpec l=aLock;
4629 aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
4636 // Class TCheckedUid
4637 inline const TUidType& TCheckedUid::UidType() const
4639 Gets the Uid type contained in this object.
4641 @return The Uid type.
4648 // Array deletion support, uses CBase deletion (virtual d'tor) for all C-classes
4650 /** @internalComponent
4652 void _DeleteArray(T** aBegin,T** aEnd)
4653 {for (;;) if (aBegin<aEnd) delete *aBegin++; else return;}
4656 /** @internalComponent
4660 static inline void Delete(T* aBegin,T* aEnd,CBase*)
4661 {::_DeleteArray((CBase**)aBegin,(CBase**)aEnd);}
4662 static inline void Delete(T* aBegin,T* aEnd,TAny*)
4663 {::_DeleteArray(aBegin,aEnd);}
4664 static inline void Delete(T* aArray,TInt aCount)
4665 {Delete(aArray,aArray+aCount,*aArray);}
4672 // Template class TFixedArray
4673 IMPORT_C void PanicTFixedArray();
4678 template <class T,TInt S>
4679 inline TFixedArray<T,S>::TFixedArray()
4681 Default constructor.
4683 Constructs an uninitialised C++ array.
4690 template <class T,TInt S>
4691 inline void TFixedArray<T,S>::Copy(const T* aList,TInt aLength)
4693 Copies the specified set of contiguous objects into the C++ array.
4695 The copy operation starts at the beginning of the array, replacing
4698 @param aList A pointer to a set of contiguous objects.
4699 @param aLength The number of contiguous objects to be copied. This value must
4700 not be negative and must not be greater than the size of the
4701 array as defined by the integer template parameter.
4703 @panic USER 133, in a debug build only, if aLength is negative or is greater
4704 than the size of the array as defined by the integer template parameter.
4706 {__ASSERT_DEBUG(TUint(aLength)<=TUint(S),PanicTFixedArray());Mem::Copy(iRep,aList,aLength*sizeof(T));}
4711 template <class T,TInt S>
4712 inline TFixedArray<T,S>::TFixedArray(const T* aList,TInt aLength)
4714 Constructs a C++ array initialised with the specified objects.
4716 @param aList A pointer to a set of contiguous objects.
4717 @param aLength The number of contiguous objects to be copied. This value must
4718 not be negative and must not be greater than the size of the
4719 array as defined by the integer template parameter.
4721 @panic USER 133, in a debug build only, if aLength is negative or is greater
4722 than the size of the array as defined by the integer template parameter.
4724 {Copy(aList,aLength);}
4729 template <class T,TInt S>
4730 inline void TFixedArray<T,S>::Reset()
4732 Fills every element of the array with binary zeroes.
4734 {Mem::FillZ(iRep,sizeof(iRep));}
4739 template <class T,TInt S>
4740 inline TInt TFixedArray<T,S>::Count() const
4742 Gets the size of the array.
4744 For any instance of this class, the array size
4745 is fixed and has the same value as the integer template parameter.
4747 @return The size of the array.
4754 template <class T,TInt S>
4755 inline TInt TFixedArray<T,S>::Length() const
4757 Gets the size of an array element, in bytes.
4759 @return The size of an array element, in bytes.
4766 template <class T,TInt S>
4767 inline TBool TFixedArray<T,S>::InRange(TInt aIndex)
4768 {return TUint(aIndex)<S;}
4773 template <class T,TInt S>
4774 inline T& TFixedArray<T,S>::operator[](TInt aIndex)
4776 Gets a reference to the specified element within the C++ array.
4778 @param aIndex The position of the element within the array. This is an offset value;
4779 a zero value refers to the first element in the array. This value must be
4780 greater than or equal to zero and less than the size of the array.
4782 @return A reference to an element of the array.
4784 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
4785 of the array as defined by the integer template parameter.
4787 {__ASSERT_DEBUG(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
4792 template <class T,TInt S>
4793 inline const T& TFixedArray<T,S>::operator[](TInt aIndex) const
4795 Gets a const reference to the specified element within the C++ array.
4797 @param aIndex The position of the element within the array. This is an offset value;
4798 a zero value refers to the first element in the array. This value must be
4799 greater than or equal to zero and less than the size of the array.
4801 @return A const reference to an element of the array; the element cannot be
4802 changed through this reference.
4804 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
4805 of the array as defined by the integer template parameter.
4807 {return CONST_CAST(ThisClass&,*this)[aIndex];}
4812 template <class T,TInt S>
4813 inline T& TFixedArray<T,S>::At(TInt aIndex)
4815 Gets a reference to the specified element within the C++ array.
4817 @param aIndex The position of the element within the array. This is an offset value;
4818 a zero value refers to the first element in the array. This value must be
4819 greater than or equal to zero and less than the size of the array.
4821 @return A reference to an element of the array.
4823 @panic USER 133, if aIndex is negative or greater than or equal to the size
4824 of the array as defined by the integer template parameter.
4826 {__ASSERT_ALWAYS(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
4831 template <class T,TInt S>
4832 inline const T& TFixedArray<T,S>::At(TInt aIndex) const
4834 Gets a const reference to the specified element within the C++ array.
4836 @param aIndex The position of the element within the array. This is an offset value;
4837 a zero value refers to the first element in the array. This value must be
4838 greater than or equal to zero and less than the size of the array.
4840 @return A const reference to an element of the array; the element cannot be
4841 changed through this reference.
4843 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
4844 of the array as defined by the integer template parameter.
4846 {return CONST_CAST(ThisClass&,*this).At(aIndex);}
4851 template <class T,TInt S>
4852 inline T* TFixedArray<T,S>::Begin()
4854 Gets a pointer to the first element of the array.
4856 @return A pointer to the first element of the array.
4863 template <class T,TInt S>
4864 inline T* TFixedArray<T,S>::End()
4866 Gets a pointer to the first byte following the end of the array.
4868 @return A pointer to the first byte following the end of the array.
4875 template <class T,TInt S>
4876 inline const T* TFixedArray<T,S>::Begin() const
4878 Gets a pointer to the first element of the array.
4880 @return A pointer to a const element of the array.
4887 template <class T,TInt S>
4888 inline const T* TFixedArray<T,S>::End() const
4890 Gets a pointer to the first byte following the end of the array.
4892 @return A pointer to the const first byte following the end of the array.
4899 template <class T,TInt S>
4900 inline TInt TFixedArray<T,S>::CountFunctionR(const CBase*)
4906 template <class T,TInt S>
4907 inline const TAny* TFixedArray<T,S>::AtFunctionR(const CBase* aThis,TInt aIndex)
4908 {return &REINTERPRET_CAST(const ThisClass&,*aThis)[aIndex];}
4913 template <class T,TInt S>
4914 inline TArray<T> TFixedArray<T,S>::Array() const
4916 Creates and returns a generic array for this C++ array.
4918 @return A generic array for this C++ array.
4920 {return TArray<T>(CountFunctionR,AtFunctionR,REINTERPRET_CAST(const CBase*,this));}
4925 template <class T,TInt S>
4926 inline void TFixedArray<T,S>::DeleteAll()
4928 Invokes the delete operator on every member of the array.
4930 The function can only be used for arrays of pointers to CBase derived objects.
4932 If the array is to be used after a call to this function, it is good practice
4933 to call TFixedArray<class T,TInt S>::Reset() to set all array elements to
4936 {_ArrayUtil<T>::Delete(iRep,S);}
4944 inline RHeap* User::SwitchHeap(RAllocator* aHeap)
4946 Changes the current thread's heap.
4948 @param aHeap A pointer to the new heap handle.
4950 @return A pointer to the old heap handle.
4952 { return (RHeap*)SwitchAllocator(aHeap); }
4957 inline RHeap& User::Heap()
4959 Gets a reference to the handle to the current thread's heap.
4961 @return A reference to the handle to the current thread's heap.
4963 { return (RHeap&)Allocator(); }
4968 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4970 inline TBool User::CreatorHasCapability(TCapability aCapability, const char* aDiagnostic)
4972 return DoCreatorHasCapability(aCapability, aDiagnostic);
4975 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic)
4977 return DoCreatorHasCapability(aCapability1, aCapability2, aDiagnostic);
4980 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4982 // Only available to NULL arguments
4983 inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/)
4985 return DoCreatorHasCapability(aCapability);
4988 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/)
4990 return DoCreatorHasCapability(aCapability1, aCapability2);
4993 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
4994 // For things using KSuppressPlatSecDiagnostic
4995 inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
4997 return DoCreatorHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
5000 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
5002 return DoCreatorHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
5005 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
5007 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5009 /** Sets this TSecurityInfo to the security attributes of this process. */
5010 inline void TSecurityInfo::SetToCurrentInfo()
5011 { new (this) TSecurityInfo(RProcess()); }
5013 /** Constructs a TSecurityInfo using the security attributes of aProcess */
5014 inline void TSecurityInfo::Set(RProcess aProcess)
5015 { new (this) TSecurityInfo(aProcess); }
5017 /** Constructs a TSecurityInfo using the security attributes of the process
5020 inline void TSecurityInfo::Set(RThread aThread)
5021 { new (this) TSecurityInfo(aThread); }
5023 /** Constructs a TSecurityInfo using the security attributes of the process
5024 which sent the message aMsgPtr */
5025 inline void TSecurityInfo::Set(RMessagePtr2 aMsgPtr)
5026 { new (this) TSecurityInfo(aMsgPtr); }
5028 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5030 /** Checks this policy against the platform security attributes of aProcess.
5032 When a check fails the action taken is determined by the system wide Platform Security
5033 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5034 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5037 @param aProcess The RProcess object to check against this TSecurityPolicy.
5038 @param aDiagnostic A string that will be emitted along with any diagnostic message
5039 that may be issued if the policy check fails.
5040 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5041 which enables it to be easily removed from the system.
5042 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5043 platform security attributes of aProcess, EFalse otherwise.
5044 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5046 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
5048 return DoCheckPolicy(aProcess, aDiagnostic);
5051 /** Checks this policy against the platform security attributes of the process
5054 When a check fails the action taken is determined by the system wide Platform Security
5055 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5056 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5059 @param aThread The thread whose owning process' platform security attributes
5060 are to be checked against this TSecurityPolicy.
5061 @param aDiagnostic A string that will be emitted along with any diagnostic message
5062 that may be issued if the policy check fails.
5063 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5064 which enables it to be easily removed from the system.
5065 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5066 platform security parameters of the owning process of aThread, EFalse otherwise.
5067 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5069 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
5071 return DoCheckPolicy(aThread, aDiagnostic);
5074 /** Checks this policy against the platform security attributes of the process which sent
5077 When a check fails the action taken is determined by the system wide Platform Security
5078 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5079 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5082 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5083 @param aDiagnostic A string that will be emitted along with any diagnostic message
5084 that may be issued if the policy check fails.
5085 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5086 which enables it to be easily removed from the system.
5087 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5088 platform security attributes of aMsg, EFalse otherwise.
5089 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5091 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
5093 return DoCheckPolicy(aMsgPtr, aDiagnostic);
5096 /** Checks this policy against the platform security attributes of the process which sent
5099 When a check fails the action taken is determined by the system wide Platform Security
5100 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5101 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5104 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5105 @param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
5106 it finds to be missing.
5107 @param aDiagnostic A string that will be emitted along with any diagnostic message
5108 that may be issued if the policy check fails.
5109 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5110 which enables it to be easily removed from the system.
5111 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5112 platform security attributes of aMsg, EFalse otherwise.
5113 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5117 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
5119 return DoCheckPolicy(aMsgPtr, aMissing, aDiagnostic);
5122 /** Checks this policy against the platform security attributes of this process' creator.
5124 When a check fails the action taken is determined by the system wide Platform Security
5125 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5126 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5129 @param aDiagnostic A string that will be emitted along with any diagnostic message
5130 that may be issued if the policy check fails.
5131 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5132 which enables it to be easily removed from the system.
5133 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5134 platform security attributes of this process' creator, EFalse otherwise.
5135 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5137 inline TBool TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
5139 return DoCheckPolicyCreator(aDiagnostic);
5143 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
5145 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
5147 return (&(*this))->CheckPolicy(aProcess, aDiagnostic);
5151 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
5153 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
5155 return (&(*this))->CheckPolicy(aThread, aDiagnostic);
5159 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
5161 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
5163 return (&(*this))->CheckPolicy(aMsgPtr, aDiagnostic);
5167 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
5170 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
5172 return (&(*this))->CheckPolicy(aMsgPtr, aMissing, aDiagnostic);
5176 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
5178 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
5180 return (&(*this))->CheckPolicyCreator(aDiagnostic);
5183 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5185 /** Checks this policy against the platform security attributes of aProcess.
5187 When a check fails the action taken is determined by the system wide Platform Security
5188 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5189 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5192 @param aProcess The RProcess object to check against this TSecurityPolicy.
5193 @param aDiagnostic A string that will be emitted along with any diagnostic message
5194 that may be issued if the policy check fails.
5195 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5196 which enables it to be easily removed from the system.
5197 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5198 platform security attributes of aProcess, EFalse otherwise.
5199 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5201 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
5203 return DoCheckPolicy(aProcess);
5206 /** Checks this policy against the platform security attributes of the process
5209 When a check fails the action taken is determined by the system wide Platform Security
5210 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5211 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5214 @param aThread The thread whose owning process' platform security attributes
5215 are to be checked against this TSecurityPolicy.
5216 @param aDiagnostic A string that will be emitted along with any diagnostic message
5217 that may be issued if the policy check fails.
5218 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5219 which enables it to be easily removed from the system.
5220 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5221 platform security parameters of the owning process of aThread, EFalse otherwise.
5222 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5224 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
5226 return DoCheckPolicy(aThread);
5229 /** Checks this policy against the platform security attributes of the process which sent
5232 When a check fails the action taken is determined by the system wide Platform Security
5233 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5234 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5237 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5238 @param aDiagnostic A string that will be emitted along with any diagnostic message
5239 that may be issued if the policy check fails.
5240 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5241 which enables it to be easily removed from the system.
5242 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5243 platform security attributes of aMsg, EFalse otherwise.
5244 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5246 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
5248 return DoCheckPolicy(aMsgPtr);
5251 /** Checks this policy against the platform security attributes of the process which sent
5254 When a check fails the action taken is determined by the system wide Platform Security
5255 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5256 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5259 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5260 @param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
5261 it finds to be missing.
5262 @param aDiagnostic A string that will be emitted along with any diagnostic message
5263 that may be issued if the policy check fails.
5264 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5265 which enables it to be easily removed from the system.
5266 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5267 platform security attributes of aMsg, EFalse otherwise.
5268 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5272 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
5274 return DoCheckPolicy(aMsgPtr, aMissing);
5277 /** Checks this policy against the platform security attributes of this process' creator.
5279 When a check fails the action taken is determined by the system wide Platform Security
5280 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5281 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5284 @param aDiagnostic A string that will be emitted along with any diagnostic message
5285 that may be issued if the policy check fails.
5286 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5287 which enables it to be easily removed from the system.
5288 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5289 platform security attributes of this process' creator, EFalse otherwise.
5290 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5292 inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
5294 return DoCheckPolicyCreator();
5297 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
5298 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5300 return DoCheckPolicy(aProcess, KSuppressPlatSecDiagnosticMagicValue);
5303 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5305 return DoCheckPolicy(aThread, KSuppressPlatSecDiagnosticMagicValue);
5308 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5310 return DoCheckPolicy(aMsgPtr, KSuppressPlatSecDiagnosticMagicValue);
5313 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5315 return DoCheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnosticMagicValue);
5318 inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5320 return DoCheckPolicyCreator(KSuppressPlatSecDiagnosticMagicValue);
5322 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
5325 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
5327 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
5329 return (&(*this))->CheckPolicy(aProcess);
5333 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
5335 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
5337 return (&(*this))->CheckPolicy(aThread);
5341 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
5343 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
5345 return (&(*this))->CheckPolicy(aMsgPtr);
5349 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
5352 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
5354 return (&(*this))->CheckPolicy(aMsgPtr, aMissing);
5358 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
5360 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
5362 return (&(*this))->CheckPolicyCreator();
5365 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
5367 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
5369 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5371 return (&(*this))->CheckPolicy(aProcess, KSuppressPlatSecDiagnostic);
5375 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
5377 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5379 return (&(*this))->CheckPolicy(aThread, KSuppressPlatSecDiagnostic);
5383 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
5385 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5387 return (&(*this))->CheckPolicy(aMsgPtr, KSuppressPlatSecDiagnostic);
5391 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
5394 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5396 return (&(*this))->CheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnostic);
5400 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
5402 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5404 return (&(*this))->CheckPolicyCreator(KSuppressPlatSecDiagnostic);
5406 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
5408 #endif //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5412 #ifndef __KERNEL_MODE__
5415 Appends an object pointer onto the array.
5417 The function leaves with one of the system wide error codes, if the operation fails.
5419 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5421 @param anEntry The object pointer to be appended.
5424 inline void RPointerArray<T>::AppendL(const T* anEntry)
5425 { User::LeaveIfError(Append(anEntry));}
5429 Inserts an object pointer into the array at the specified position.
5431 The function leaves with one of the system wide error codes, if
5432 the operation fails.
5434 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5436 @param anEntry The object pointer to be inserted.
5437 @param aPos The position within the array where the object pointer is to be
5438 inserted. The position is relative to zero, i.e. zero implies
5439 that a pointer is inserted at the beginning of the array.
5441 @panic USER 131, if aPos is negative, or is greater than the number of object
5442 pointers currently in the array.
5445 inline void RPointerArray<T>::InsertL(const T* anEntry, TInt aPos)
5446 { User::LeaveIfError(Insert(anEntry,aPos)); }
5450 Finds the first object pointer in the array which matches the specified object
5451 pointer, using a sequential search.
5453 Matching is based on the comparison of pointers.
5455 The find operation always starts at the low index end of the array. There
5456 is no assumption about the order of objects in the array.
5458 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5460 @param anEntry The object pointer to be found.
5461 @return The index of the first matching object pointer within the array.
5462 @leave KErrNotFound, if no matching object pointer can be found.
5465 inline TInt RPointerArray<T>::FindL(const T* anEntry) const
5466 { return User::LeaveIfError(Find(anEntry));}
5470 Finds the first object pointer in the array whose object matches the specified
5471 object, using a sequential search and a matching algorithm.
5473 The algorithm for determining whether two class T objects match is provided
5474 by a function supplied by the caller.
5476 The find operation always starts at the low index end of the array. There
5477 is no assumption about the order of objects in the array.
5479 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5481 @param anEntry The object pointer to be found.
5482 @param anIdentity A package encapsulating the function which determines whether
5483 two class T objects match.
5485 @return The index of the first matching object pointer within the array.
5486 @leave KErrNotFound, if no suitable object pointer can be found.
5489 inline TInt RPointerArray<T>::FindL(const T* anEntry, TIdentityRelation<T> anIdentity) const
5490 { return User::LeaveIfError(Find(anEntry, anIdentity));}
5494 Finds the last object pointer in the array which matches the specified object
5495 pointer, using a sequential search.
5497 Matching is based on the comparison of pointers.
5499 The find operation always starts at the high index end of the array. There
5500 is no assumption about the order of objects in the array.
5502 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5504 @param anEntry The object pointer to be found.
5505 @return The index of the last matching object pointer within the array.
5506 @leave KErrNotFound, if no matching object pointer can be found.
5509 inline TInt RPointerArray<T>::FindReverseL(const T* anEntry) const
5510 { return User::LeaveIfError(FindReverse(anEntry));}
5514 Finds the last object pointer in the array whose object matches the specified
5515 object, using a sequential search and a matching algorithm.
5517 The algorithm for determining whether two class T objects match is provided
5518 by a function supplied by the caller.
5520 The find operation always starts at the high index end of the array. There
5521 is no assumption about the order of objects in the array.
5523 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5525 @param anEntry The object pointer to be found.
5526 @param anIdentity A package encapsulating the function which determines whether
5527 two class T objects match.
5529 @return The index of the last matching object pointer within the array.
5530 @leave KErrNotFound, if no suitable object pointer can be found.
5533 inline TInt RPointerArray<T>::FindReverseL(const T* anEntry, TIdentityRelation<T> anIdentity) const
5534 { return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
5538 Finds the object pointer in the array that matches the specified object
5539 pointer, using a binary search technique.
5541 The function assumes that object pointers in the array are in address order.
5543 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5545 @param anEntry The object pointer to be found.
5547 @return The index of the matching object pointer within the array
5548 @leave KErrNotFound, if no suitable object pointer can be found.
5551 inline TInt RPointerArray<T>::FindInAddressOrderL(const T* anEntry) const
5552 { return User::LeaveIfError(FindInAddressOrder(anEntry));}
5556 Finds the object pointer in the array whose object matches the specified
5557 object, using a binary search technique and an ordering algorithm.
5559 The function assumes that existing object pointers in the array are ordered
5560 so that the objects themselves are in object order as determined by an algorithm
5561 supplied by the caller and packaged as a TLinearOrder<T>.
5563 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5565 @param anEntry The object pointer to be found.
5566 @param anOrder A package encapsulating the function which determines the order
5567 of two class T objects.
5569 @return The index of the matching object pointer within the array.
5571 @leave KErrNotFound, if no suitable object pointer can be found.
5574 inline TInt RPointerArray<T>::FindInOrderL(const T* anEntry, TLinearOrder<T> anOrder) const
5575 { return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
5579 Finds the object pointer in the array that matches the specified object
5580 pointer, using a binary search technique.
5582 The function assumes that object pointers in the array are in address order.
5584 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5586 @param anEntry The object pointer to be found.
5587 @param anIndex A reference to a TInt into which the
5588 function puts an index value: If the function does not leave,
5589 this is the index of the matching object pointer within the
5590 array. If the function leaves with KErrNotFound, this is the
5591 index of the first object pointer within the array which
5592 logically follows after anEntry.
5594 @leave KErrNotFound, if no suitable object pointer can be found.
5597 inline void RPointerArray<T>::FindInAddressOrderL(const T* anEntry, TInt& anIndex) const
5598 { User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
5602 Finds the object pointer in the array whose object matches the specified
5603 object, using a binary search technique and an ordering algorithm.
5605 The function assumes that existing object pointers in the array are ordered
5606 so that the objects themselves are in object order as determined by an
5607 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
5609 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5611 @param anEntry The object pointer to be found.
5612 @param anIndex A TInt supplied by the caller. On return, contains an
5614 If the function does not leave, this is the index of the
5615 matching object pointer within the array.
5616 If the function leaves with KErrNotFound, this is the index of
5617 the first object pointer in the array whose object is bigger
5618 than the entry being searched for - if no objects pointed to in
5619 the array are bigger, then the index value is the same as the
5620 total number of object pointers in the array.
5622 @param anOrder A package encapsulating the function which determines the order
5623 of two class T objects.
5625 @leave KErrNotFound, if no suitable object pointer can be found.
5628 inline void RPointerArray<T>::FindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
5629 { User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder)); }
5633 Finds the object pointer in the array that matches the specified object
5634 pointer, using a binary search technique.
5636 Where there is more than one matching element, it finds the first, the last
5637 or any matching element as specified by the value of aMode.
5639 The function assumes that object pointers in the array are in address order.
5641 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5643 @param anEntry The object pointer to be found.
5644 @param aMode Specifies whether to find the first match, the last match or
5645 any match, as defined by one of the TArrayFindMode enum values.
5647 @return If there is a matching element, the array index of a matching element - what
5648 the index refers to depends on the value of aMode:
5649 if this is EArrayFindMode_First, then the index refers to the first matching element;
5650 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5651 if this is EArrayFindMode_Last, then the index refers to first element that follows the
5652 last matching element - if the last matching element is also the last element of the array,
5653 then the index value is the same as the total number of elements in the array.
5655 @leave KErrNotFound if no matching entry exists.
5660 inline TInt RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt aMode) const
5661 { return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
5665 Finds the object pointer in the array whose object matches the specified
5666 object, using a binary search technique and an ordering algorithm.
5668 In the case that there is more than one matching element finds the first, last
5669 or any match as specified by the value of aMode.
5671 The function assumes that existing object pointers in the array are ordered
5672 so that the objects themselves are in object order as determined by an algorithm
5673 supplied by the caller and packaged as a TLinearOrder<T> type.
5675 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5677 @param anEntry The object pointer to be found.
5678 @param anOrder A package encapsulating the function which determines the order
5679 of two class T objects.
5680 @param aMode Specifies whether to find the first match, the last match or any match,
5681 as defined by one of the TArrayFindMode enum values.
5683 @return If there is a matching element, the array index of a matching
5684 element - what the index refers to depends on the value of aMode:
5685 if this is EArrayFindMode_First, then the index refers to the first matching element;
5686 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5687 if this is EArrayFindMode_Last, then the index refers to first element that follows
5688 the last matching element - if the last matching element is also the last element of the array, then
5689 the index value is the same as the total number of elements in the array.
5691 @leave KErrNotFound if no matching entry exists.
5696 inline TInt RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const
5697 { return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
5701 Finds the object pointer in the array that matches the specified object
5702 pointer, using a binary search technique.
5704 Where there is more than one matching element, it finds the first, the last or
5705 any matching element as specified by the value of aMode.
5707 The function assumes that object pointers in the array are in address order.
5709 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5711 @param anEntry The object pointer to be found.
5712 @param anIndex A TInt type supplied by the caller. On return, it contains an index
5713 value depending on whether a match is found and on the value of aMode.
5714 If there is no matching element in the array, then this is the index
5715 of the first element in the array that is bigger than the element being
5716 searched for - if no elements in the array are bigger, then the index
5717 value is the same as the total number of elements in the array.
5718 If there is a matching element, then what the index refers to depends
5719 on the value of aMode:
5720 if this is EArrayFindMode_First, then the index refers to the first matching element;
5721 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5722 if this is EArrayFindMode_Last, then the index refers to first element that follows
5723 the last matching element - if the last matching element is also the last element
5724 of the array, then the index value is the same as the total number of elements in the array.
5726 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
5727 one of the TArrayFindMode enum values.
5729 @leave KErrNotFound, if no suitable object pointer can be found.
5734 inline void RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt& anIndex, TInt aMode) const
5735 { User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
5739 Finds the object pointer in the array whose object matches the specified
5740 object, using a binary search technique and an ordering algorithm.
5742 Where there is more than one matching element, it finds the first, the last or any
5743 matching element as specified by the value of aMode.
5745 The function assumes that existing object pointers in the array are ordered
5746 so that the objects themselves are in object order as determined by an
5747 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
5749 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5751 @param anEntry The object pointer to be found.
5752 @param anIndex A TInt type supplied by the caller. On return, it contains an index
5753 value depending on whether a match is found and on the value of aMode.
5754 If there is no matching element in the array, then this is
5755 the index of the first element in the array that is bigger than
5756 the element being searched for - if no elements in the array are bigger,
5757 then the index value is the same as the total number of elements in the array.
5758 If there is a matching element, then what the index refers to depends
5759 on the value of aMode:
5760 if this is EArrayFindMode_First, then the index refers to the first matching element;
5761 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5762 if this is EArrayFindMode_Last, then the index refers to first element that follows
5763 the last matching element - if the last matching element is also the last element of
5764 the array, then the index value is the same as the total number of elements in the array.
5766 @param anOrder A package encapsulating the function which determines the order
5767 of two class T objects.
5768 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
5769 one of the TArrayFindModeenum values.
5771 @leave KErrNotFound, if no suitable object pointer can be found.
5776 inline void RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
5777 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode)); }
5781 Inserts an object pointer into the array in address order.
5783 No duplicate entries are permitted.
5784 The function assumes that existing object pointers within the array are in
5787 The function leaves with one of the system wide error codes, if the operation fails.
5789 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5791 @param anEntry The object pointer to be inserted.
5794 inline void RPointerArray<T>::InsertInAddressOrderL(const T* anEntry)
5795 { User::LeaveIfError(InsertInAddressOrder(anEntry)); }
5799 Inserts an object pointer into the array so that the object itself is in object
5802 The algorithm for determining the order of two class T objects is provided
5803 by a function supplied by the caller.
5805 No duplicate entries are permitted.
5807 The function assumes that the array is ordered so that the referenced objects
5808 are in object order.
5810 The function leaves with one of the system wide error codes, if the operation fails.
5812 Note that the array remains unchanged following an attempt to insert a duplicate
5815 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5817 @param anEntry The object pointer to be inserted.
5818 @param anOrder A package encapsulating the function which determines the order
5819 of two class T objects.
5822 inline void RPointerArray<T>::InsertInOrderL(const T* anEntry, TLinearOrder<T> anOrder)
5823 { User::LeaveIfError(InsertInOrder(anEntry, anOrder)); }
5827 Inserts an object pointer into the array in address order, allowing duplicates.
5829 If the new object pointer is a duplicate of an existing object pointer in
5830 the array, then the new pointer is inserted after the existing one. If more
5831 than one duplicate object pointer already exists in the array, then any new
5832 duplicate pointer is inserted after the last one.
5834 The function assumes that existing object pointers within the array are in
5837 The function leaves with one of the system wide error codes, if the operation fails.
5839 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5841 @param anEntry The object pointer to be inserted.
5844 inline void RPointerArray<T>::InsertInAddressOrderAllowRepeatsL(const T* anEntry)
5845 { User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
5849 Inserts an object pointer into the array so that the object itself is in object
5850 order, allowing duplicates
5852 The algorithm for determining the order of two class T objects is provided
5853 by a function supplied by the caller.
5855 If the specified object is a duplicate of an existing object, then the new
5856 pointer is inserted after the pointer to the existing object. If more than
5857 one duplicate object already exists, then the new pointer is inserted after
5858 the pointer to the last one.
5860 The function leaves with one of the system wide error codes, if the operation fails.
5862 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5864 @param anEntry The object pointer to be inserted.
5865 @param anOrder A package encapsulating the function which determines the order
5866 of two class T objects.
5869 inline void RPointerArray<T>::InsertInOrderAllowRepeatsL(const T* anEntry, TLinearOrder<T> anOrder)
5870 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder)); }
5875 Reserves space for the specified number of elements.
5877 After a call to this function, the memory allocated to the array is sufficient
5878 to hold the number of object pointers specified. Adding new object pointers to the array
5879 does not result in a re-allocation of memory until the the total number of
5880 pointers exceeds the specified count.
5882 @param aCount The number of object pointers for which space should be reserved
5883 @leave KErrNoMemory If the requested amount of memory could not be allocated
5886 inline void RPointerArray<T>::ReserveL(TInt aCount)
5887 { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
5891 // Specialization for RPointerArray<TAny>
5894 Appends an pointer onto the array.
5896 The function leaves with one of the system wide error codes, if the operation fails.
5898 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5900 @param anEntry The pointer to be appended.
5902 inline void RPointerArray<TAny>::AppendL(const TAny* anEntry)
5903 { User::LeaveIfError(Append(anEntry));}
5907 Inserts an pointer into the array at the specified position.
5909 The function leaves with one of the system wide error codes, if
5910 the operation fails.
5912 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5914 @param anEntry The pointer to be inserted.
5915 @param aPos The position within the array where the pointer is to be
5916 inserted. The position is relative to zero, i.e. zero implies
5917 that a pointer is inserted at the beginning of the array.
5919 @panic USER 131, if aPos is negative, or is greater than the number of object
5920 pointers currently in the array.
5922 inline void RPointerArray<TAny>::InsertL(const TAny* anEntry, TInt aPos)
5923 { User::LeaveIfError(Insert(anEntry,aPos)); }
5927 Finds the first pointer in the array which matches the specified pointer, using
5928 a sequential search.
5930 Matching is based on the comparison of pointers.
5932 The find operation always starts at the low index end of the array. There
5933 is no assumption about the order of objects in the array.
5935 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5937 @param anEntry The pointer to be found.
5938 @return The index of the first matching pointer within the array.
5939 @leave KErrNotFound, if no matching pointer can be found.
5941 inline TInt RPointerArray<TAny>::FindL(const TAny* anEntry) const
5942 { return User::LeaveIfError(Find(anEntry));}
5946 Finds the last pointer in the array which matches the specified pointer, using
5947 a sequential search.
5949 Matching is based on the comparison of pointers.
5951 The find operation always starts at the high index end of the array. There
5952 is no assumption about the order of objects in the array.
5954 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5956 @param anEntry The pointer to be found.
5957 @return The index of the last matching pointer within the array.
5958 @leave KErrNotFound, if no matching pointer can be found.
5960 inline TInt RPointerArray<TAny>::FindReverseL(const TAny* anEntry) const
5961 { return User::LeaveIfError(FindReverse(anEntry));}
5965 Finds the pointer in the array that matches the specified pointer, using a
5966 binary search technique.
5968 The function assumes that pointers in the array are in address order.
5970 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5972 @param anEntry The pointer to be found.
5974 @return The index of the matching pointer within the array
5975 @leave KErrNotFound, if no suitable pointer can be found.
5977 inline TInt RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry) const
5978 { return User::LeaveIfError(FindInAddressOrder(anEntry));}
5982 Finds the pointer in the array that matches the specified pointer, using a
5983 binary search technique.
5985 The function assumes that pointers in the array are in address order.
5987 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5989 @param anEntry The pointer to be found.
5990 @param anIndex A reference to a TInt into which the
5991 function puts an index value: If the function does not leave,
5992 this is the index of the matching pointer within the array. If the
5993 function leaves with KErrNotFound, this is the index of the last
5994 pointer within the array which logically precedes
5997 @leave KErrNotFound, if no suitable pointer can be found.
5999 inline void RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry, TInt& anIndex) const
6000 { User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
6004 Finds the pointer in the array that matches the specified pointer, using a
6005 binary search technique.
6007 Where there is more than one matching element, it finds the first, the last
6008 or any matching element as specified by the value of aMode.
6010 The function assumes that pointers in the array are in address order.
6012 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6014 @param anEntry The pointer to be found.
6015 @param aMode Specifies whether to find the first match, the last match or
6016 any match, as defined by one of the TArrayFindMode enum values.
6018 @return If there is a matching element, the array index of a matching element - what
6019 the index refers to depends on the value of aMode:
6020 if this is EArrayFindMode_First, then the index refers to the first matching element;
6021 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6022 if this is EArrayFindMode_Last, then the index refers to first element that follows the
6023 last matching element - if the last matching element is also the last element of the array,
6024 then the index value is the same as the total number of elements in the array.
6026 @leave KErrNotFound if no matching entry exists.
6030 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt aMode) const
6031 { return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
6035 Finds the pointer in the array that matches the specified pointer, using a
6036 binary search technique.
6038 Where there is more than one matching element, it finds the first, the last or
6039 any matching element as specified by the value of aMode.
6041 The function assumes that pointers in the array are in address order.
6043 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6045 @param anEntry The pointer to be found.
6046 @param anIndex A TInt type supplied by the caller. On return, it contains an index
6047 value depending on whether a match is found and on the value of aMode.
6048 If there is no matching element in the array, then this is the index
6049 of the first element in the array that is bigger than the element being
6050 searched for - if no elements in the array are bigger, then the index
6051 value is the same as the total number of elements in the array.
6052 If there is a matching element, then what the index refers to depends
6053 on the value of aMode:
6054 if this is EArrayFindMode_First, then the index refers to the first matching element;
6055 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6056 if this is EArrayFindMode_Last, then the index refers to first element that follows
6057 the last matching element - if the last matching element is also the last element
6058 of the array, then the index value is the same as the total number of elements in the array.
6060 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
6061 one of the TArrayFindMode enum values.
6063 @leave KErrNotFound, if no suitable pointer can be found.
6067 inline void RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt& anIndex, TInt aMode) const
6068 { User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
6072 Inserts an pointer into the array in address order.
6074 No duplicate entries are permitted. The function assumes that existing pointers
6075 within the array are in address order.
6077 The function leaves with one of the system wide error codes, if the operation fails.
6079 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6081 @param anEntry The pointer to be inserted.
6083 inline void RPointerArray<TAny>::InsertInAddressOrderL(const TAny* anEntry)
6084 { User::LeaveIfError(InsertInAddressOrder(anEntry)); }
6088 Inserts an pointer into the array in address order, allowing duplicates.
6090 If the new pointer is a duplicate of an existing pointer in the array, then the
6091 new pointer is inserted after the existing one. If more than one duplicate
6092 pointer already exists in the array, then any new duplicate pointer is inserted
6095 The function assumes that existing pointers within the array are in address
6098 The function leaves with one of the system wide error codes, if the operation fails.
6100 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6102 @param anEntry The pointer to be inserted.
6104 inline void RPointerArray<TAny>::InsertInAddressOrderAllowRepeatsL(const TAny* anEntry)
6105 { User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
6109 Apends an object onto the array.
6111 The function leaves with one of the system wide error codes, if the operation fails.
6113 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6115 @param anEntry A reference to the object of type class T to be appended.
6118 inline void RArray<T>::AppendL(const T& anEntry)
6119 { User::LeaveIfError(Append(anEntry));}
6123 Inserts an object into the array at a specified position.
6125 The function leaves with one of the system wide error codes, if the operation fails.
6127 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6129 @param anEntry The class T object to be inserted.
6130 @param aPos The position within the array where the object is to
6131 be inserted. The position is relative to zero, i.e. zero
6132 implies that an object is inserted at the beginning of
6135 @panic USER 131, if aPos is negative or is greater than the number of objects
6136 currently in the array.
6139 inline void RArray<T>::InsertL(const T& anEntry, TInt aPos)
6140 { User::LeaveIfError(Insert(anEntry, aPos));}
6144 Finds the first object in the array which matches the specified object using
6145 a sequential search.
6147 Matching is based on the comparison of a TInt value at the key offset position
6150 The find operation always starts at the low index end of the array. There
6151 is no assumption about the order of objects in the array.
6153 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6155 @param anEntry A reference to an object of type class T to be used for matching.
6157 @return The index of the first matching object within the array.
6158 @leave KErrNotFound, if no matching object can be found.
6161 inline TInt RArray<T>::FindL(const T& anEntry) const
6162 { return User::LeaveIfError(Find(anEntry));}
6166 Finds the first object in the array which matches the specified object using
6167 a sequential search and a matching algorithm.
6169 The algorithm for determining whether two class T type objects match is provided
6170 by a function supplied by the caller.
6172 The find operation always starts at the low index end of the array. There
6173 is no assumption about the order of objects in the array.
6175 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6177 @param anEntry A reference to an object of type class T to be used
6179 @param anIdentity A package encapsulating the function which determines whether
6180 two class T type objects match.
6182 @return The index of the first matching object within the array.
6183 @leave KErrNotFound, if no matching object can be found.
6186 inline TInt RArray<T>::FindL(const T& anEntry, TIdentityRelation<T> anIdentity) const
6187 { return User::LeaveIfError(Find(anEntry, anIdentity));}
6191 Finds the last object in the array which matches the specified object using
6192 a sequential search.
6194 Matching is based on the comparison of a TInt value at the key offset position
6197 The find operation always starts at the high index end of the array. There
6198 is no assumption about the order of objects in the array.
6200 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6202 @param anEntry A reference to an object of type class T to be used for matching.
6204 @return The index of the last matching object within the array.
6205 @leave KErrNotFound, if no matching object can be found.
6208 inline TInt RArray<T>::FindReverseL(const T& anEntry) const
6209 { return User::LeaveIfError(FindReverse(anEntry));}
6213 Finds the last object in the array which matches the specified object using
6214 a sequential search and a matching algorithm.
6216 The algorithm for determining whether two class T type objects match is provided
6217 by a function supplied by the caller.
6219 The find operation always starts at the high index end of the array. There
6220 is no assumption about the order of objects in the array.
6222 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6224 @param anEntry A reference to an object of type class T to be used
6226 @param anIdentity A package encapsulating the function which determines whether
6227 two class T type objects match.
6229 @return The index of the last matching object within the array.
6230 @leave KErrNotFound, if no matching object can be found.
6233 inline TInt RArray<T>::FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) const
6234 { return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
6238 Finds the object in the array which matches the specified object using a binary
6241 The function assumes that existing objects within the array are in signed
6244 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6246 @param anEntry A reference to an object of type class T to be used for matching.
6248 @return The index of the matching object within the array.
6249 @leave KErrNotFound, if no matching object can be found.
6252 inline TInt RArray<T>::FindInSignedKeyOrderL(const T& anEntry) const
6253 { return User::LeaveIfError(FindInSignedKeyOrder(anEntry));}
6257 Finds the object in the array which matches the specified object using a binary
6260 The function assumes that existing objects within the array are in unsigned
6263 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6265 @param anEntry A reference to an object of type class T to be used for matching.
6267 @return The index of the matching object within the array.
6268 @leave KErrNotFound, if no matching object can be found.
6271 inline TInt RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry) const
6272 { return User::LeaveIfError(FindInUnsignedKeyOrder(anEntry));}
6276 Finds the object in the array which matches the specified object using a binary
6277 search technique and an ordering algorithm.
6279 The function assumes that existing objects within the array are in object
6280 order as determined by an algorithm supplied by the caller and packaged as
6283 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6285 @param anEntry A reference to an object of type class T to be used for matching.
6286 @param anOrder A package encapsulating the function which determines the order
6287 of two class T objects.
6289 @return The index of the matching object within the array.
6290 @leave KErrNotFound if no matching object can be found.
6293 inline TInt RArray<T>::FindInOrderL(const T& anEntry, TLinearOrder<T> anOrder) const
6294 { return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
6298 Finds the object in the array which matches the specified object using a binary
6301 The function assumes that existing objects within the array are in signed
6304 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6306 @param anEntry A reference to an object of type class T to be used for matching.
6307 @param anIndex On return contains an index value of the matching object within the array.
6308 If the function leaves with KErrNotFound,this is the index of the
6309 first element in the array whose key is bigger than the key of the
6310 element being sought. If there are no elements in the array with
6311 a bigger key, then the index value is the same as the total
6312 number of elements in the array.
6313 @leave KErrNotFound, if no matching object can be found.
6316 inline void RArray<T>::FindInSignedKeyOrderL(const T& anEntry, TInt& anIndex) const
6317 { User::LeaveIfError(FindInSignedKeyOrder(anEntry, anIndex));}
6321 Finds the object in the array which matches the specified object using a binary
6324 The function assumes that existing objects within the array are in unsigned
6327 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6329 @param anEntry A reference to an object of type class T to be used for matching.
6330 @param anIndex On return contains an index value of the matching object within the array.
6331 If the function leaves with KErrNotFound, this is the index of the
6332 first element in the array whose key is bigger than the key of the
6333 element being sought. If there are no elements in the array with
6334 a bigger key, then the index value is the same as the total
6335 number of elements in the array.
6336 @leave KErrNotFound, if no matching object can be found.
6339 inline void RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex) const
6340 { User::LeaveIfError(FindInUnsignedKeyOrder(anEntry, anIndex));}
6344 Finds the object in the array which matches the specified object using a binary
6345 search technique and an ordering algorithm.
6347 The function assumes that existing objects within the array are in object
6348 order as determined by an algorithm supplied by the caller and packaged as
6351 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6353 @param anEntry A reference to an object of type class T to be used for matching.
6354 @param anIndex On return contains the index value of the matching object within the array
6355 If the function leaves with KErrNotFound, this is the index of
6356 the first element in the array that is bigger than the element
6357 being searched for - if no elements in the array are bigger,
6358 then the index value is the same as the total number of elements
6360 @param anOrder A package encapsulating the function which determines the order
6361 of two class T objects.
6363 @leave KErrNotFound if no matching object can be found.
6366 inline void RArray<T>::FindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
6367 { User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder));}
6371 Finds the object in the array which matches the specified object using a binary
6374 The element ordering is determined by a signed 32-bit word
6375 (the key) embedded in each array element. In the case that there is more than
6376 one matching element, finds the first, last or any match as specified.
6378 The function assumes that existing objects within the array are in signed
6381 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6383 @param anEntry A reference to an object of type class T to be used for matching.
6384 @param aMode Specifies whether to find the first match, the last match or
6385 any match, as defined by one of the TArrayFindMode enum values.
6387 @return The array index of a matching element - what the index refers to
6388 depends on the value of aMode:
6389 if this is EArrayFindMode_First, then the index refers to the first matching element;
6390 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6391 if this is EArrayFindMode_Last, then the index refers to first element that follows
6392 the last matching element - if the last matching element is also the last element of
6393 the array, then the index value is the same as the total number of elements in the array.
6394 @leave KErrNotFound if no matching entry exists.
6399 inline TInt RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt aMode) const
6400 { return User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, aMode));}
6404 Finds the object in the array which matches the specified object using a binary
6407 The element ordering is determined by an unsigned 32-bit word
6408 (the key) embedded in each array element. In the case that there is more than
6409 one matching element, finds the first, last or any match as specified.
6411 The function assumes that existing objects within the array are in unsigned
6414 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6416 @param anEntry A reference to an object of type class T to be used for matching.
6417 @param aMode Specifies whether to find the first match, the last match or any
6418 match, as defined by one of the TArrayFindMode enum values.
6420 @return The array index of a matching element - what the index refers to
6421 depends on the value of aMode:
6422 if this is EArrayFindMode_First, then the index refers to the first matching element;
6423 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6424 if this is EArrayFindMode_Last, then the index refers to first element that follows
6425 the last matching element - if the last matching element is also the last element
6426 of the array, then the index value is the same as the total number of elements in the array.
6428 @leave KErrNotFound if no matching entry exists.
6433 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt aMode) const
6434 { return User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, aMode));}
6438 Finds the object in the array which matches the specified object using a binary
6439 search technique and an ordering algorithm.
6441 Where there is more than one matching element, it finds the first, the last or
6442 any matching element as specified by the value of aMode.
6444 The function assumes that existing objects within the array are in object
6445 order as determined by an algorithm supplied by the caller and packaged as
6446 a TLinearOrder<T> type.
6448 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6450 @param anEntry A reference to an object of type class T to be used for matching.
6451 @param anOrder A package encapsulating the function which determines the order
6452 of two class T objects.
6453 @param aMode Specifies whether to find the first match, the last match or any match,
6454 as defined by one of the TArrayFindMode enum values.
6456 @return The array index of a matching element - what the index refers to
6457 depends on the value of aMode:
6458 if this is EArrayFindMode_First, then the index refers to the first matching element;
6459 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6460 if this is EArrayFindMode_Last, then the index refers to first element that follows
6461 the last matching element - if the last matching element is also the last element
6462 of the array, then the index value is the same as the total number of elements in the array.
6464 @leave KErrNotFound if no matching entry exists.
6469 inline TInt RArray<T>::SpecificFindInOrderL(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const
6470 { return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
6474 Finds the object in the array which matches the specified object using a binary
6477 The element ordering is determined by a signed 32-bit word
6478 (the key) embedded in each array element. In the case that there is more than
6479 one matching element, finds the first, last or any match as specified.
6481 The function assumes that existing objects within the array are in signed
6484 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6486 @param anEntry A reference to an object of type class T to be used for matching.
6487 @param anIndex A TInt type supplied by the caller. On return, it contains an
6488 index value depending on whether a match is found and on the
6489 value of aMode. If there is no matching element in the array,
6490 then this is the index of the first element in the array that
6491 is bigger than the element being searched for - if no elements
6492 in the array are bigger, then the index value is the same as
6493 the total number of elements in the array.
6494 If there is a matching element, then what the index refers to
6495 depends on the value of aMode:
6496 if this is EArrayFindMode_First, then the index refers to the first matching element;
6497 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6498 if this is EArrayFindMode_Last, then the index refers to first element that follows
6499 the last matching element - if the last matching element is also the last element
6500 of the array, then the index value is the same as the total number of elements
6502 @param aMode Specifies whether to find the first match, the last match or any match,
6503 as defined by one of the TArrayFindMode enum values.
6505 @leave KErrNotFound if no matching entry exists.
6510 inline void RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
6511 { User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, anIndex, aMode));}
6515 Finds the object in the array which matches the specified object using a binary
6518 The element ordering is determined by an unsigned 32-bit word
6519 (the key) embedded in each array element. In the case that there is more than
6520 one matching element, finds the first, last or any match as specified.
6522 The function assumes that existing objects within the array are in unsigned
6525 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6527 @param anEntry A reference to an object of type class T to be used for matching.
6528 @param anIndex A TInt type supplied by the caller. On return, it contains an
6529 index value depending on whether a match is found and on the
6530 value of aMode. If there is no matching element in the array,
6531 then this is the index of the first element in the array that
6532 is bigger than the element being searched for - if no elements
6533 in the array are bigger, then the index value is the same as
6534 the total number of elements in the array. If there is a matching
6535 element, then what the index refers to depends on the value of aMode:
6536 if this is EArrayFindMode_First, then the index refers to the first matching element;
6537 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6538 if this is EArrayFindMode_Last, then the index refers to first element that follows
6539 the last matching element - if the last matching element is also the last element
6540 of the array, then the index value is the same as the total number of elements in the array.
6541 @param aMode Specifies whether to find the first match, the last match or any match,
6542 as defined by one of the TArrayFindMode enum values.
6544 @leave KErrNotFound if no matching entry exists.
6549 inline void RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
6550 { User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, anIndex, aMode));}
6554 Finds the object in the array which matches the specified object using a binary
6555 search technique and a specified ordering algorithm.
6557 Where there is more than one matching element, it finds the first, the last or
6558 any matching element as specified by the value of aMode.
6560 The function assumes that existing objects within the array are in object
6561 order as determined by an algorithm supplied by the caller and packaged as
6562 a TLinearOrder<T> type.
6564 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6566 @param anEntry A reference to an object of type class T to be used for matching.
6567 @param anIndex A TInt type supplied by the caller. On return, it contains an
6568 index value depending on whether a match is found and on the value
6569 of aMode. If there is no matching element in the array, then this is
6570 the index of the first element in the array that is bigger than the
6571 element being searched for - if no elements in the array are bigger,
6572 then the index value is the same as the total number of elements
6573 in the array. If there is a matching element, then what the index
6574 refers to depends on the value of aMode:
6575 if this is EArrayFindMode_First, then the index refers to the first matching element;
6576 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6577 if this is EArrayFindMode_Last, then the index refers to first element that follows
6578 the last matching element - if the last matching element is also the last element
6579 of the array, then the index value is the same as the total number of elements in the array.
6581 @param anOrder A package encapsulating the function which determines the order
6582 of two class T objects.
6583 @param aMode Specifies whether to find the first match, the last match or any match,
6584 as defined by one of the TArrayFindMode enum values.
6586 @leave KErrNotFound if no matching entry exists.
6591 inline void RArray<T>::SpecificFindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
6592 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode));}
6596 Inserts an object into the array in ascending signed key order.
6598 The order of two class T type objects is based on comparing a TInt value
6599 located at the key offset position within the class T object.
6601 No duplicate entries are permitted.
6603 The function leaves with one of the system wide error codes, if the operation fails.
6605 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6607 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6609 @param anEntry A reference to the object of type class T to be inserted.
6612 inline void RArray<T>::InsertInSignedKeyOrderL(const T& anEntry)
6613 { User::LeaveIfError(InsertInSignedKeyOrder(anEntry));}
6617 Inserts an object into the array in ascending unsigned key order, not allowing
6620 The order of two class T type objects is based on comparing a TUint value
6621 located at the key offset position within the class T object.
6623 The function leaves with one of the system wide error codes, if the operation fails.
6625 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6627 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6629 @param anEntry A reference to the object of type class T to be inserted.
6632 inline void RArray<T>::InsertInUnsignedKeyOrderL(const T& anEntry)
6633 { User::LeaveIfError(InsertInUnsignedKeyOrder(anEntry));}
6637 Inserts an object of into the array in object order.
6639 The algorithm for determining the order of two class T type objects is provided
6640 by a function supplied by the caller.
6642 No duplicate entries are permitted.
6644 The function assumes that existing objects within the array are in object
6647 The function leaves with one of the system wide error codes, if the operation fails.
6649 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6651 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6653 @param anEntry A reference to the object of type class T to be inserted.
6654 @param anOrder A package encapsulating the function which determines the order
6655 of two class T objects.
6658 inline void RArray<T>::InsertInOrderL(const T& anEntry, TLinearOrder<T> anOrder)
6659 { User::LeaveIfError(InsertInOrder(anEntry, anOrder));}
6663 Inserts an object into the array in ascending signed key order,
6664 allowing duplicates.
6666 The order of two class T type objects is based on comparing a TInt value
6667 located at the key offset position within the class T object.
6669 If anEntry is a duplicate of an existing object in the array, then the new
6670 object is inserted after the existing object. If more than one duplicate object
6671 already exists in the array, then any new duplicate object is inserted after
6674 The function leaves with one of the system wide error codes, if the operation fails.
6676 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6678 @param anEntry A reference to the object of type class T to be inserted.
6681 inline void RArray<T>::InsertInSignedKeyOrderAllowRepeatsL(const T& anEntry)
6682 { User::LeaveIfError(InsertInSignedKeyOrderAllowRepeats(anEntry));}
6686 Inserts an object into the array in ascending unsigned key order, allowing
6689 The order of two class T type objects is based on comparing a TUint value
6690 located at the key offset position within the class T object.
6692 If anEntry is a duplicate of an existing object in the array, then the new
6693 object is inserted after the existing object. If more than one duplicate object
6694 already exists in the array, then any new duplicate object is inserted after
6697 The function leaves with one of the system wide error codes, if the operation fails.
6699 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6701 @param anEntry A reference to the object of type class T to be inserted.
6704 inline void RArray<T>::InsertInUnsignedKeyOrderAllowRepeatsL(const T& anEntry)
6705 { User::LeaveIfError(InsertInUnsignedKeyOrderAllowRepeats(anEntry));}
6709 Inserts an object into the array in object order, allowing duplicates.
6711 The algorithm for determining the order of two class T type objects is provided
6712 by a function supplied by the caller.
6714 If anEntry is a duplicate of an existing object in the array, then the new
6715 object is inserted after the existing object. If more than one duplicate object
6716 already exists in the array, then anEntry is inserted after the last one.
6718 The function assumes that existing objects within the array are in object
6721 The function leaves with one of the system wide error codes, if the operation fails.
6723 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6725 @param anEntry A reference to the object of type class T to be inserted.
6726 @param anOrder A package encapsulating the function which determines the order
6727 of two class T objects.
6730 inline void RArray<T>::InsertInOrderAllowRepeatsL(const T& anEntry, TLinearOrder<T> anOrder)
6731 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder));}
6736 Reserves space for the specified number of elements.
6738 After a call to this function, the memory allocated to the array is sufficient
6739 to hold the number of objects specified. Adding new objects to the array
6740 does not result in a re-allocation of memory until the the total number of
6741 objects exceeds the specified count.
6743 @param aCount The number of objects for which space should be reserved
6744 @leave KErrNoMemory If the requested amount of memory could not be allocated
6747 inline void RArray<T>::ReserveL(TInt aCount)
6748 { User::LeaveIfError(RArrayBase::DoReserve(aCount)); }
6754 Appends a signed integer onto the array.
6756 The function leaves with one of the system wide error codes, if the operation fails.
6758 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6760 @param anEntry The signed integer to be appended.
6762 inline void RArray<TInt>::AppendL(TInt anEntry)
6763 { User::LeaveIfError(Append(anEntry));}
6767 Inserts a signed integer into the array at the specified position.
6769 The function leaves with one of the system wide error codes, if the operation fails.
6771 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6773 @param anEntry The signed integer to be inserted.
6774 @param aPos The position within the array where the signed integer is to be
6775 inserted. The position is relative to zero, i.e. zero implies
6776 that an entry is inserted at the beginning of the array.
6778 @panic USER 131, if aPos is negative, or is greater than the number of entries
6779 currently in the array.
6781 inline void RArray<TInt>::InsertL(TInt anEntry, TInt aPos)
6782 { User::LeaveIfError(Insert(anEntry, aPos));}
6786 Finds the first signed integer in the array which matches the specified signed
6787 integer using a sequential search.
6789 The find operation always starts at the low index end of the array. There
6790 is no assumption about the order of entries in the array.
6792 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6794 @param anEntry The signed integer to be found.
6796 @return The index of the first matching signed integer within the array.
6797 @leave KErrNotFound, if no matching entry can be found.
6799 inline TInt RArray<TInt>::FindL(TInt anEntry) const
6800 { return User::LeaveIfError(Find(anEntry));}
6804 Finds the last signed integer in the array which matches the specified signed
6805 integer using a sequential search.
6807 The find operation always starts at the high index end of the array. There
6808 is no assumption about the order of entries in the array.
6810 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6812 @param anEntry The signed integer to be found.
6814 @return The index of the last matching signed integer within the array.
6815 @leave KErrNotFound, if no matching entry can be found.
6817 inline TInt RArray<TInt>::FindReverseL(TInt anEntry) const
6818 { return User::LeaveIfError(FindReverse(anEntry));}
6822 Finds the signed integer in the array that matches the specified signed integer
6823 using a binary search technique.
6825 The function assumes that the array is in signed integer order.
6827 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6829 @param anEntry The signed integer to be found.
6831 @return The index of the matching signed integer within the array.
6832 @leave KErrNotFound, if no match can be found.
6834 inline TInt RArray<TInt>::FindInOrderL(TInt anEntry) const
6835 { return User::LeaveIfError(FindInOrder(anEntry));}
6839 Finds the signed integer in the array that matches the specified signed integer
6840 using a binary search technique.
6842 The function assumes that the array is in signed integer order.
6844 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6846 @param anEntry The signed integer to be found.
6847 @param anIndex A reference to a signed integer into which the
6848 function puts an index value: If the function returns ,
6849 this is the index of the matching signed integer within the
6850 array. If the function leaves with KErrNotFound, this is the
6851 index of the first signed integer within the array that is
6852 bigger than the signed integer being searched for - if no
6853 signed integers within the array are bigger, then the index
6854 value is the same as the total number of signed integers
6856 @leave KErrNotFound if no match can be found.
6858 inline void RArray<TInt>::FindInOrderL(TInt anEntry, TInt& anIndex) const
6859 { User::LeaveIfError(FindInOrder(anEntry, anIndex));}
6863 Finds the signed integer in the array that matches the specified signed integer
6864 using a binary search technique.
6866 Where there is more than one matching element, it finds the first, last or any
6867 matching element as specified by the value of aMode.
6869 The function assumes that the array is in signed integer order.
6871 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6873 @param anEntry The signed integer to be found.
6874 @param aMode Specifies whether to find the first match, the last match or
6875 any match, as defined by one of the TArrayFindMode enum values.
6877 @return The array index of a matching element - what the index refers to
6878 depends on the value of aMode:
6879 if this is EArrayFindMode_First, then the index refers to the first matching element;
6880 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6881 if this is EArrayFindMode_Last, then the index refers to first element that follows
6882 the last matching element - if the last matching element is also the last element
6883 of the array, then the index value is the same as the total number of elements in the array.
6885 @leave KErrNotFound if no matching entry exists.
6889 inline TInt RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt aMode) const
6890 { return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
6894 Finds the signed integer in the array that matches the specified signed integer
6895 using a binary search technique.
6897 Where there is more than one matching element, it finds the first, last or any
6898 matching element as specified by the value of aMode.
6900 The function assumes that the array is in signed integer order.
6902 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6904 @param anEntry The signed integer to be found.
6905 @param anIndex A TInt type supplied by the caller. On return, it contains an
6906 index value depending on whether a match is found and on the value of aMode.
6907 If there is no matching element in the array, then this is
6908 the index of the first element in the array that is bigger
6909 than the element being searched for - if no elements in the
6910 array are bigger, then the index value is the same as the total
6911 number of elements in the array. If there is a matching element,
6912 then what the index refers to depends on the value of aMode:
6913 if this is EArrayFindMode_First, then the index refers to the first matching element;
6914 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6915 if this is EArrayFindMode_Last, then the index refers to first element that follows
6916 the last matching element - if the last matching element is also the last element
6917 of the array, then the index value is the same as the total number of elements in the array.
6919 @param aMode Specifies whether to find the first match, the last match or any match, as defined
6920 by one of the TArrayFindMode enum values.
6922 @leave KErrNotFound if no matching entry exists.
6926 inline void RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt& anIndex, TInt aMode) const
6927 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
6931 Inserts a signed integer into the array in signed integer order.
6933 No duplicate entries are permitted.
6935 The function assumes that existing entries within the array are in signed
6938 The function leaves with one of the system wide error codes, if the operation fails.
6940 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6942 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6944 @param anEntry The signed integer to be inserted.
6946 inline void RArray<TInt>::InsertInOrderL(TInt anEntry)
6947 { User::LeaveIfError(InsertInOrder(anEntry));}
6951 Inserts a signed integer into the array in signed integer order,
6952 allowing duplicates.
6954 If anEntry is a duplicate of an existing entry in the array, then the new
6955 signed integer is inserted after the existing one. If more than one duplicate
6956 entry already exists in the array, then any new duplicate signed integer is
6957 inserted after the last one.
6959 The function assumes that existing entries within the array are in signed
6962 The function leaves with one of the system wide error codes, if the operation fails.
6964 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6966 @param anEntry The signed integer to be inserted.
6968 inline void RArray<TInt>::InsertInOrderAllowRepeatsL(TInt anEntry)
6969 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
6974 Reserves space for the specified number of elements.
6976 After a call to this function, the memory allocated to the array is sufficient
6977 to hold the number of integers specified. Adding new integers to the array
6978 does not result in a re-allocation of memory until the the total number of
6979 integers exceeds the specified count.
6981 @param aCount The number of integers for which space should be reserved
6982 @leave KErrNoMemory If the requested amount of memory could not be allocated
6984 inline void RArray<TInt>::ReserveL(TInt aCount)
6985 { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
6991 Appends an unsigned integer onto the array.
6993 The function leaves with one of the system wide error codes, if the operation fails.
6995 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6997 @param anEntry The unsigned integer to be appended.
6999 inline void RArray<TUint>::AppendL(TUint anEntry)
7000 { User::LeaveIfError(Append(anEntry));}
7004 Inserts an unsigned integer into the array at the specified position.
7006 The function leaves with one of the system wide error codes, if the operation fails.
7008 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7010 @param anEntry The unsigned integer to be inserted.
7011 @param aPos The position within the array where the unsigned integer is to
7012 be inserted. The position is relative to zero, i.e. zero
7013 implies that an entry is inserted at the beginning of
7016 @panic USER 131, if aPos is negative, or is greater than the number of entries
7017 currently in the array.
7019 inline void RArray<TUint>::InsertL(TUint anEntry, TInt aPos)
7020 { User::LeaveIfError(Insert(anEntry, aPos));}
7024 Finds the first unsigned integer in the array which matches the specified
7025 value, using a sequential search.
7027 The find operation always starts at the low index end of the array. There
7028 is no assumption about the order of entries in the array.
7030 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7032 @param anEntry The unsigned integer to be found.
7033 @return The index of the first matching unsigned integer within the array.
7034 @leave KErrNotFound, if no matching entry can be found.
7036 inline TInt RArray<TUint>::FindL(TUint anEntry) const
7037 { return User::LeaveIfError(Find(anEntry));}
7041 Finds the last unsigned integer in the array which matches the specified
7042 value, using a sequential search.
7044 The find operation always starts at the high index end of the array. There
7045 is no assumption about the order of entries in the array.
7047 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7049 @param anEntry The unsigned integer to be found.
7050 @return The index of the last matching unsigned integer within the array.
7051 @leave KErrNotFound, if no matching entry can be found.
7053 inline TInt RArray<TUint>::FindReverseL(TUint anEntry) const
7054 { return User::LeaveIfError(FindReverse(anEntry));}
7058 Finds the unsigned integer in the array which matches the specified value,
7059 using a binary search technique.
7061 The functions assume that existing entries within the array are in unsigned
7064 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7066 @param anEntry The unsigned integer to be found.
7068 @return The index of the matching unsigned integer within the array;
7069 @leave KErrNotFound, if no matching entry can be found.
7071 inline TInt RArray<TUint>::FindInOrderL(TUint anEntry) const
7072 { return User::LeaveIfError(FindInOrder(anEntry));}
7076 Finds the unsigned integer in the array which matches the specified value,
7077 using a binary search technique.
7079 If the index cannot be found, the function returns the index of the last
7080 unsigned integer within the array which logically precedes anEntry.
7081 The functions assume that existing entries within the array are in unsigned
7084 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7086 @param anEntry The unsigned integer to be found.
7087 @param anIndex A TInt supplied by the caller. On return, contains an index
7088 value of the matching unsigned integer within the array.
7089 If the function leaves with KErrNotFound, this is the index of the
7090 first unsigned integer within the array that is bigger than the
7091 unsigned integer being searched for - if no unsigned integers within
7092 the array are bigger, then the index value is the same as the
7093 total number of unsigned integers within the array.
7095 @leave KErrNotFound, if no matching entry can be found.
7097 inline void RArray<TUint>::FindInOrderL(TUint anEntry, TInt& anIndex) const
7098 { User::LeaveIfError(FindInOrder(anEntry, anIndex));}
7102 Finds the unsigned integer in the array that matches the specified unsigned integer
7103 using a binary search technique.
7105 In the case that there is more than one matching element, finds the first, last or any
7108 The function assumes that the array is in unsigned integer order.
7110 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7112 @param anEntry The unsigned integer to be found.
7113 @param aMode Specifies whether to find the first match, the last match or
7114 any match, as defined by one of the TArrayFindMode enum values.
7116 @return The array index of a matching element - what the index refers to depends
7117 on the value of aMode:
7118 if this is EArrayFindMode_First, then the index refers to the first matching element;
7119 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
7120 if this is EArrayFindMode_Last, then the index refers to first element that follows
7121 the last matching element - if the last matching element is also the last element
7122 of the array, then the index value is the same as the total number of elements in the array.
7124 @leave KErrNotFound if no matching entry exists.
7128 inline TInt RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt aMode) const
7129 { return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
7133 Finds the unsigned integer in the array that matches the specified unsigned integer
7134 using a binary search technique.
7136 Where there is more than one matching element, it finds the first, last or
7137 any matching element as specified by the value of aMode.
7139 The function assumes that the array is in unsigned integer order.
7141 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7143 @param anEntry The unsigned integer to be found.
7144 @param anIndex A TInt type supplied by the caller. On return, it contains an index
7145 value depending on whether a match is found and on the value of aMode.
7146 If there is no matching element in the array, then this is the
7147 index of the first element in the array that is bigger than the element
7148 being searched for - if no elements in the array are bigger, then
7149 the index value is the same as the total number of elements in the array.
7150 If there is a matching element, then what the index refers to depends on
7152 if this is EArrayFindMode_First, then the index refers to the first matching element;
7153 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
7154 if this is EArrayFindMode_Last, then the index refers to first element that follows
7155 the last matching element - if the last matching element is also the last element of the array,
7156 then the index value is the same as the total number of elements in the array.
7158 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
7159 one of the TArrayFindMode enum values.
7160 @leave KErrNotFound if no matching entry exists.
7164 inline void RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt& anIndex, TInt aMode) const
7165 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
7169 Inserts an unsigned integer into the array in unsigned integer order.
7171 No duplicate entries are permitted.
7173 The function assumes that existing entries within the array are in unsigned
7176 The function leaves with one of the system wide error codes, if the operation fails.
7178 Note that the array remains unchanged following an attempt to insert a duplicate entry.
7180 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7182 @param anEntry The unsigned integer to be inserted.
7184 inline void RArray<TUint>::InsertInOrderL(TUint anEntry)
7185 { User::LeaveIfError(InsertInOrder(anEntry));}
7189 Inserts an unsigned integer into the array in unsigned integer order, allowing
7192 If the new integer is a duplicate of an existing entry in the array, then
7193 the new unsigned integer is inserted after the existing one. If more than
7194 one duplicate entry already exists in the array, then any new duplicate
7195 unsigned integer is inserted after the last one.
7197 The function assumes that existing entries within the array are in unsigned
7200 The function leaves with one of the system wide error codes, if the operation fails.
7202 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7204 @param anEntry The unsigned integer to be inserted.
7206 inline void RArray<TUint>::InsertInOrderAllowRepeatsL(TUint anEntry)
7207 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
7212 Reserves space for the specified number of elements.
7214 After a call to this function, the memory allocated to the array is sufficient
7215 to hold the number of integers specified. Adding new integers to the array
7216 does not result in a re-allocation of memory until the the total number of
7217 integers exceeds the specified count.
7219 @param aCount The number of integers for which space should be reserved
7220 @leave KErrNoMemory If the requested amount of memory could not be allocated
7222 inline void RArray<TUint>::ReserveL(TInt aCount)
7223 { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
7229 Sets the priority of the client's process.
7231 @param aPriority The priority value.
7233 inline void RMessagePtr2::SetProcessPriorityL(TProcessPriority aPriority) const
7234 { User::LeaveIfError(SetProcessPriority(aPriority));}
7238 Opens a handle on the client thread.
7240 @param aClient On successful return, the handle to the client thread.
7241 @param aOwnerType An enumeration whose enumerators define the ownership of
7242 the handle. If not explicitly specified,
7243 EOwnerProcess is taken as default.
7245 inline void RMessagePtr2::ClientL(RThread& aClient, TOwnerType aOwnerType) const
7246 { User::LeaveIfError(Client(aClient, aOwnerType));}
7249 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
7251 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, const char* aDiagnostic) const
7253 return DoHasCapability(aCapability, aDiagnostic);
7256 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, const char* aDiagnosticMessage) const
7258 if (!HasCapability(aCapability, aDiagnosticMessage))
7260 User::Leave(KErrPermissionDenied);
7264 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
7266 return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
7269 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, const char* aDiagnosticMessage) const
7271 if (!HasCapability(aCapability1, aCapability2, aDiagnosticMessage))
7273 User::Leave(KErrPermissionDenied);
7277 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
7279 // Only available to NULL arguments
7280 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
7282 return DoHasCapability(aCapability);
7285 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnosticMessage*/) const
7287 if (!DoHasCapability(aCapability))
7289 User::Leave(KErrPermissionDenied);
7293 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
7295 return DoHasCapability(aCapability1, aCapability2);
7298 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnosticMessage*/) const
7300 if (!DoHasCapability(aCapability1, aCapability2))
7302 User::Leave(KErrPermissionDenied);
7306 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
7307 // For things using KSuppressPlatSecDiagnostic
7308 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7310 return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
7313 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7315 if (!DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue))
7317 User::Leave(KErrPermissionDenied);
7321 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7323 return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
7326 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7328 if (!DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue))
7330 User::Leave(KErrPermissionDenied);
7333 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
7335 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
7337 inline TInt RThread::RenameMe(const TDesC& aName)
7338 { return User::RenameThread(aName); }
7339 inline TInt RProcess::RenameMe(const TDesC& aName)
7340 { return User::RenameProcess(aName); }
7343 #endif // !__KERNEL_MODE__
7345 #ifdef __SUPPORT_CPP_EXCEPTIONS__
7346 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
7347 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
7348 // when we move to supporting Standard C++.
7349 #if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__)
7351 #if defined(__VC32__) && !defined(_CRTIMP_PURE)
7353 // Declare MS EH runtime functions
7354 bool __uncaught_exception(void);
7356 #if _MSC_VER >= 1200
7357 __declspec(noreturn) void terminate(void);
7358 __declspec(noreturn) void unexpected(void);
7360 void terminate(void);
7361 void unexpected(void);
7364 typedef void (*terminate_handler)();
7365 terminate_handler set_terminate(terminate_handler h) throw();
7366 typedef void (*unexpected_handler)();
7367 unexpected_handler set_unexpected(unexpected_handler h) throw();
7370 #ifdef __MSVCDOTNET__
7371 inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
7372 #else // !__MSVCDOTNET__
7373 // MS KB242192: BUG: uncaught_exception() Always Returns False
7374 inline bool uncaught_exception(void) { return false; }
7375 #endif //__MSVCDOTNET__
7376 inline void terminate(void) { ::terminate(); }
7377 inline void unexpected(void) { ::unexpected(); }
7378 inline terminate_handler set_terminate(terminate_handler h) throw() { return ::set_terminate(h); }
7379 inline unexpected_handler set_unexpected(unexpected_handler h) throw() { return ::set_unexpected(h); }
7382 #endif // extract from MSVC headers
7386 extern "C" bool __uncaught_exception(void);
7389 #if __MWERKS__ > 0x3200
7390 inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
7392 // no uncaught_exception() implementation on CW 2.4.7
7393 inline bool uncaught_exception(void) { return false; }
7397 #endif // extract from CW headers
7399 #endif // <exception> header guard
7401 #endif //__SUPPORT_CPP_EXCEPTIONS__