1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
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); }
122 #if !(defined(__GCC32__) && defined(__MARM__))
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::RegionCode() const
2397 {return(iRegionCode);}
2398 inline TInt TLocale::CountryCode() const
2400 Gets the code which is used to select country-specific locale data.
2402 The country code is the code used as the international dialling prefix.
2403 This code is also used to identify a country by the dialling software.
2405 @return The country code.
2407 {return(iCountryCode);}
2412 inline void TLocale::SetCountryCode(TInt aCode)
2414 Sets the value which is used to select country-specific locale data.
2416 This value can be retrieved by using TLocale::CountryCode(). The country code
2417 is the code used as the international dialling prefix. This code is also used
2418 to identify a country by the dialling software.
2420 @param aCode The country code.
2422 @see TLocale::CountryCode
2424 {iCountryCode=aCode;}
2429 inline TTimeIntervalSeconds TLocale::UniversalTimeOffset() const
2431 Gets the locale's universal time offset.
2433 @return Offset in seconds from universal time. Time zones east of universal
2434 time have positive offsets. Time zones west of universal time have negative
2437 @deprecated Use User::UTCOffset to get the current offset inclusive of daylight
2438 savings time. This function returns the same value, for compatibility.
2440 {return(iUniversalTimeOffset);}
2445 inline TDateFormat TLocale::DateFormat() const
2447 Gets the date format.
2449 @return The date format.
2451 {return(iDateFormat);}
2456 inline void TLocale::SetDateFormat(TDateFormat aFormat)
2458 Sets the date format.
2460 @param aFormat The date format to be used.
2462 {iDateFormat=aFormat;}
2467 inline TTimeFormat TLocale::TimeFormat() const
2469 Gets the time format (12 or 24 hour).
2471 @return The time format.
2473 {return(iTimeFormat);}
2478 inline void TLocale::SetTimeFormat(TTimeFormat aFormat)
2480 Sets the time format (12 or 24 hour).
2482 @param aFormat The time format.
2484 {iTimeFormat=aFormat;}
2489 inline TLocalePos TLocale::CurrencySymbolPosition() const
2491 Gets the currency symbol position.
2493 For negative currency values, this position may be
2494 reversed using SetNegativeCurrencySymbolOpposite().
2496 @return The currency symbol position.
2498 @see TLocale::SetNegativeCurrencySymbolOpposite
2500 {return(iCurrencySymbolPosition);}
2505 inline void TLocale::SetCurrencySymbolPosition(TLocalePos aPos)
2507 Sets the currency symbol position.
2509 @param aPos The currency symbol position.
2511 {iCurrencySymbolPosition=aPos;}
2516 inline TBool TLocale::CurrencySpaceBetween() const
2518 Gets whether or not a space is inserted between the currency symbol and the
2521 For negative currency values, the space can be removed using SetNegativeLoseSpace().
2523 @return True if a space is inserted; false if not.
2525 @see TLocale::SetNegativeLoseSpace
2527 {return(iCurrencySpaceBetween);}
2532 inline void TLocale::SetCurrencySpaceBetween(TBool aSpace)
2534 Sets whether a space is inserted between the currency symbol and the currency
2537 @param aSpace ETrue if a space is inserted; EFalse if not.
2539 {iCurrencySpaceBetween=aSpace;}
2544 inline TInt TLocale::CurrencyDecimalPlaces() const
2546 Gets the number of decimal places to which currency values are set.
2548 @return The number of decimal places.
2550 {return(iCurrencyDecimalPlaces);}
2555 inline void TLocale::SetCurrencyDecimalPlaces(TInt aPlaces)
2557 Sets the number of decimal places to which currency values should be set.
2559 @param aPlaces The number of decimal places.
2561 {iCurrencyDecimalPlaces=aPlaces;}
2566 inline TBool TLocale::CurrencyNegativeInBrackets() const
2570 Gets whether negative currency values are enclosed in brackets rather than
2571 being preceded by a minus sign.
2573 This is deprecated, use NegativeCurrencyFormat() instead.
2575 @return True if negative currency is enclosed in brackets and has no minus
2576 sign; false if negative currency has a minus sign and is not enclosed
2579 @see TLocale::NegativeCurrencyFormat
2581 {return((TBool)iNegativeCurrencyFormat);}
2586 inline void TLocale::SetCurrencyNegativeInBrackets(TBool aBool)
2590 Sets whether negative currency values are enclosed in brackets rather than
2591 being preceded by a minus sign.
2593 This is deprecated, use SetNegativeCurrencyFormat() instead.
2595 @param aBool ETrue, if a negative currency value must be enclosed in brackets
2596 without a minus sign; EFalse, if a negative currency value is
2597 preceded by a minus sign without any enclosing brackets.
2599 @see TLocale::SetNegativeCurrencyFormat
2601 {iNegativeCurrencyFormat=(aBool)?EInBrackets:ELeadingMinusSign;}
2606 inline TBool TLocale::CurrencyTriadsAllowed() const
2608 Gets whether triads are allowed in currency values. Triads are groups of
2609 three digits separated by the thousands separator.
2611 @return True if triads are allowed; false if not.
2613 {return(iCurrencyTriadsAllowed);}
2618 inline void TLocale::SetCurrencyTriadsAllowed(TBool aBool)
2620 Sets whether triads are allowed in currency values.
2622 @param aBool ETrue if triads are allowed; EFalse if triads not allowed.
2624 {iCurrencyTriadsAllowed=aBool;}
2629 inline TChar TLocale::ThousandsSeparator() const
2631 Gets the character used to separate groups of three digits to the left of
2632 the decimal separator.
2634 A thousands separator character is only displayed in currency values if currency
2637 @return The character used as the thousands separator.
2639 {return(iThousandsSeparator);}
2644 inline void TLocale::SetThousandsSeparator(const TChar& aChar)
2646 Sets the character to be used to separate groups of three digits to the left
2647 of the decimal separator.
2649 A thousands separator character is only displayed in currency values if currency
2652 @param aChar The character to be used as the thousands separator.
2654 {iThousandsSeparator=aChar;}
2659 inline TChar TLocale::DecimalSeparator() const
2661 Gets the character used to separate a whole number from its fractional part.
2663 @return The character used as the decimal separator.
2665 {return(iDecimalSeparator);}
2670 inline void TLocale::SetDecimalSeparator(const TChar& aChar)
2672 Sets the character to be used to separate a whole number from its fractional
2675 @param aChar The character to be used as the decimal separator.
2677 {iDecimalSeparator=aChar;}
2682 inline TChar TLocale::DateSeparator(TInt aIndex) const
2684 Gets one of the four characters used to separate the day, month and year
2685 components of the date.
2687 If the four separators are represented by S0, S1, S2 and S3 and the three
2688 date components are represented by XX, YY and ZZ, then the separators are
2689 located: S0 XX S1 YY S2 ZZ S3.
2691 @param aIndex An index indicating which of the four separators is being accessed.
2692 This must be a value between zero and three inclusive.
2694 @return A date separator character as determined by the value of aIndex.
2696 {return(iDateSeparator[aIndex]);}
2701 inline void TLocale::SetDateSeparator(const TChar& aChar,TInt aIndex)
2703 Sets one of the four characters used to separate the day, month and year
2704 components of the date.
2706 If the four separators are represented by S0, S1, S2 and S3 and the three
2707 date components are represented by XX, YY and ZZ, then the separators are
2708 located: S0 XX S1 YY S2 ZZ S3.
2710 @param aChar A date separator character to be used.
2711 @param aIndex An index indicating which of the four separators is being accessed.
2712 This must be a value between zero and three inclusive.
2714 {__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxDateSeparators,User::Invariant());
2715 iDateSeparator[aIndex]=aChar;}
2720 inline TChar TLocale::TimeSeparator(TInt aIndex) const
2722 Gets one of the four characters used to separate the hour, second and minute
2723 components of the time.
2725 If the four separators are represented by S0, S1, S2 and S3 and the three
2726 time components are represented by XX, YY and ZZ, then the separators are
2727 located: S0 XX S1 YY S2 ZZ S3.
2729 @param aIndex An index indicating which of the four separators is being
2730 accessed. This must be a value between zero and three inclusive.
2732 @return A time separator character as determined by the value of aIndex.
2735 {return(iTimeSeparator[aIndex]);}
2740 inline void TLocale::SetTimeSeparator(const TChar& aChar,TInt aIndex)
2742 Sets one of the four characters used to separate the hour, minute and second
2743 components of the date.
2745 If the four separators are represented by S0, S1, S2 and S3 and the three
2746 time components are represented by XX, YY and ZZ, then the separators are
2747 located: S0 XX S1 YY S2 ZZ S3.
2749 @param aChar A time separator character to be used.
2750 @param aIndex An index indicating which of the four separators is being accessed.
2751 This must be a value between zero and three inclusive.
2753 {__ASSERT_DEBUG(aIndex>=0 && aIndex<KMaxTimeSeparators,User::Invariant());
2754 iTimeSeparator[aIndex]=aChar;}
2759 inline TLocalePos TLocale::AmPmSymbolPosition() const
2761 Gets the am/pm text position (before or after the time value).
2763 @return The am/pm text position (0 before, 1 after).
2765 {return(iAmPmSymbolPosition);}
2770 inline void TLocale::SetAmPmSymbolPosition(TLocalePos aPos)
2772 Sets the am/pm text position (before or after the time value).
2774 @param aSpace The am/pm text position (0 before, 1 after).
2776 {iAmPmSymbolPosition=aPos;}
2781 inline TBool TLocale::AmPmSpaceBetween() const
2783 Tests whether or not a space is inserted between the time and the preceding
2784 or trailing am/pm text.
2786 @return True if a space is inserted between the time and am/pm text; false
2789 {return(iAmPmSpaceBetween);}
2794 inline void TLocale::SetAmPmSpaceBetween(TBool aSpace)
2796 Sets whether a space is inserted between the time and the preceding or trailing
2799 @param aPos ETrue if a space is inserted between the time and am/pm text;
2802 {iAmPmSpaceBetween=aSpace;}
2807 inline TUint TLocale::DaylightSaving() const
2809 Gets the zones in which daylight saving is in effect.
2811 If daylight saving is in effect, one hour is added to the time.
2813 Use TLocale::QueryHomeHasDaylightSavingOn() to find out whether daylight saving
2814 is in effect for the home city. This is because the daylight saving setting
2815 for the home city may differ from that of the zone in which home is located.
2817 @return A bit mask in which the three least significant bits are defined,
2818 indicating which of the three daylight saving zones are adjusted for
2819 daylight saving. These bits represent:
2820 Northern (non-European countries in the northern hemisphere),
2821 Southern (southern hemisphere),
2824 @see TLocale::QueryHomeHasDaylightSavingOn
2825 @see TDaylightSavingZone
2827 @deprecated Use the timezone server to retrieve information on timezones and DST.
2828 This method will always indicate that DST is inactive, in order to
2829 preserve compatibility.
2831 {return(iDaylightSaving);}
2836 inline TBool TLocale::QueryHomeHasDaylightSavingOn() const
2838 Tests whether or not daylight saving is set for the home city.
2840 @return True if home daylight saving is set; false if not.
2842 @deprecated Use the timezone server to retrieve information on timezones and DST.
2843 This method will always indicate that DST is inactive, in order to
2844 preserve compatibility.
2846 {return((iHomeDaylightSavingZone|EDstHome) & iDaylightSaving);}
2851 inline TDaylightSavingZone TLocale::HomeDaylightSavingZone() const
2853 Gets the daylight saving zone in which the home city is located.
2855 @return The daylight saving zone in which the home city is located.
2857 @deprecated Use the timezone server to retrieve information on timezones and DST.
2859 {return(iHomeDaylightSavingZone);}
2864 inline TUint TLocale::WorkDays() const
2866 Gets a bit mask representing the days of the week which are considered as
2869 @return A bit mask of seven bits indicating (by being set) which days are
2870 workdays. The least significant bit corresponds to Monday, the next bit to
2873 {return(iWorkDays);}
2878 inline void TLocale::SetWorkDays(TUint aMask)
2880 Sets the days of the week which are considered as working days.
2882 @param aMask A bit mask of seven bits indicating (by being set) which days
2883 are workdays. The least significant bit corresponds to Monday, the
2884 next bit is Tuesday and so on.
2891 inline TDay TLocale::StartOfWeek() const
2893 Gets the day which is considered the first day of the week.
2895 @return The first day of the week.
2897 {return(iStartOfWeek);}
2902 inline void TLocale::SetStartOfWeek(TDay aDay)
2904 Sets the day which is considered to be the first day of the week.
2906 @param aDay The first day of the week.
2908 {iStartOfWeek=aDay;}
2913 inline TClockFormat TLocale::ClockFormat() const
2915 Gets the clock display format.
2917 @return The clock display format.
2919 {return(iClockFormat);}
2924 inline void TLocale::SetClockFormat(TClockFormat aFormat)
2926 Sets the clock display format.
2928 @param aFormat The clock display format.
2930 {iClockFormat=aFormat;}
2935 inline TUnitsFormat TLocale::UnitsGeneral() const
2937 Gets the general units of measurement.
2939 This function should be used when both short and long distances use the
2940 same units of measurement.
2942 @return General units of measurement.
2944 {return(iUnitsGeneral);}
2949 inline void TLocale::SetUnitsGeneral(TUnitsFormat aFormat)
2951 Sets the general units of measurement.
2952 This function should be used when both short and long distances use the
2953 same units of measurement.
2955 @param aFormat General units of measurement.
2957 {iUnitsGeneral=aFormat;}
2962 inline TUnitsFormat TLocale::UnitsDistanceShort() const
2964 Gets the units of measurement for short distances.
2966 Short distances are those which would normally be represented by either
2967 metres and centimetres or feet and inches.
2969 @return Units of measurement for short distances.
2971 {return(iUnitsDistanceShort);}
2976 inline void TLocale::SetUnitsDistanceShort(TUnitsFormat aFormat)
2978 Sets the units of measurement for short distances.
2980 Short distances are those which would normally be represented by either
2981 metres and centimetres or feet and inches.
2983 @param aFormat Units of measurement for short distances.
2985 {iUnitsDistanceShort=aFormat;}
2990 inline TUnitsFormat TLocale::UnitsDistanceLong() const
2992 Gets the units of measurement for long distances.
2994 Long distances are those which would normally be represented by either
2995 miles or kilometres.
2997 @return Units of measurement for long distances.
2999 {return(iUnitsDistanceLong);}
3004 inline void TLocale::SetUnitsDistanceLong(TUnitsFormat aFormat)
3006 Sets the units of measurement for long distances.
3008 Long distances are those which would normally be represented by either
3009 miles or kilometres.
3011 @param aFormat Units of measurement for long distances.
3013 {iUnitsDistanceLong=aFormat;}
3018 inline void TLocale::SetNegativeCurrencyFormat(TLocale::TNegativeCurrencyFormat aNegativeCurrencyFormat)
3020 Sets the negative currency format.
3022 @param aNegativeCurrencyFormat How negative currency values are formatted.
3024 {iNegativeCurrencyFormat = aNegativeCurrencyFormat;}
3029 inline TLocale::TNegativeCurrencyFormat TLocale::NegativeCurrencyFormat() const
3031 Gets the negative currency format.
3033 @return How negative currency values are formatted.
3035 {return(iNegativeCurrencyFormat);}
3040 inline TBool TLocale::NegativeLoseSpace() const
3042 Gets whether negative currency values lose the space between the currency
3043 symbol and the value.
3045 @return True, if negative currency values lose the space between the value
3046 and the symbol; false, if not.
3049 if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeLoseSpace)==iExtraNegativeCurrencyFormatFlags)
3058 inline void TLocale::SetNegativeLoseSpace(TBool aBool)
3060 Sets whether negative currency values lose the space between the currency symbol
3063 @param aBool ETrue to set a flag which indicates that negative currency values
3064 should lose the space between the value and the symbol. EFalse to unset it.
3068 iExtraNegativeCurrencyFormatFlags |= EFlagNegativeLoseSpace;
3070 iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeLoseSpace;
3076 inline TBool TLocale::NegativeCurrencySymbolOpposite() const
3078 Gets whether in negative currency values, the position of the currency symbol
3079 is set to be the opposite of the position used for non-negative values (before
3080 or after the value, as set by SetCurrencySymbolPosition()).
3082 @return True, if the currency symbol position for negative currency values
3083 is the opposite of the position set by SetCurrencySymbolPosition();
3086 @see TLocale::SetCurrencySymbolPosition
3089 if((iExtraNegativeCurrencyFormatFlags|EFlagNegativeCurrencySymbolOpposite)==iExtraNegativeCurrencyFormatFlags)
3098 inline void TLocale::SetNegativeCurrencySymbolOpposite(TBool aBool)
3100 Sets whether the position of the currency symbol for negative currency values
3101 should be the opposite of the position used for non-negative values (before
3102 or after the value, as set by SetCurrencySymbolPosition()).
3104 @param aBool ETrue to set the position of the currency symbol in negative
3105 currency values to be the opposite of the position as set
3106 using SetCurrencySymbolPosition(). EFalse to leave the
3109 @see TLocale::SetCurrencySymbolPosition
3113 iExtraNegativeCurrencyFormatFlags |= EFlagNegativeCurrencySymbolOpposite;
3115 iExtraNegativeCurrencyFormatFlags &= ~EFlagNegativeCurrencySymbolOpposite;
3121 inline TLanguage TLocale::LanguageDowngrade(TInt aIndex) const
3123 Gets the language that is stored at the specified index into the customisable
3124 part of the language downgrade path.
3126 The second, third and fourth languages in the language downgrade path can
3127 be customised. These can be enquired using this function. The first language
3128 in the path is always the language of the current locale, as returned by User::Language().
3130 The languages in the downgrade path are used in turn by the BaflUtils::NearestLanguageFile()
3131 function to find the best matching language-specific version of a language-neutral
3134 The full language downgrade path can be retrieved using BaflUtils::GetDowngradePath().
3136 @param aIndex An index into the customisable part of the language downgrade
3137 path. Between zero and two inclusive.
3139 @return The language at the specified index.
3141 @see BaflUtils::NearestLanguageFile
3142 @see BaflUtils::GetDowngradePath
3145 __ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
3146 return static_cast<TLanguage>(iLanguageDowngrade[aIndex]);
3152 inline void TLocale::SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage)
3154 Sets a language in the customisable part of the language downgrade path.
3156 @param aIndex An index into the customisable part of the path at which to
3157 add the language, a value between zero and two.
3158 @param aLanguage The language to add. ELangNone is considered to be the last
3159 language in the path, no more will be searched, so can be used
3160 to specify that no language downgrade is required.
3162 @see BaflUtils::NearestLanguageFile
3163 @see BaflUtils::GetDowngradePath
3166 __ASSERT_DEBUG(0 <= aIndex && aIndex < 3, User::Invariant());
3167 iLanguageDowngrade[aIndex] = static_cast<TUint16>(aLanguage);
3174 Gets the number mode stored in the locale.
3176 @return The number mode for the locale.
3178 inline TDigitType TLocale::DigitType() const
3179 { return iDigitType; }
3185 Sets the number mode for the locale.
3187 @param aDigitType The number mode to be set.
3189 inline void TLocale::SetDigitType(TDigitType aDigitType)
3190 { iDigitType=aDigitType; }
3196 Sets the device time state.
3198 @param aState The device time state.
3200 @deprecated Use the timezone server to coordinate automatic time adjustment.
3202 inline void TLocale::SetDeviceTime(TDeviceTimeState aState)
3204 iDeviceTimeState=aState;
3209 Get the pointer to the TLocale object contained in this extended locale.
3211 @return Pointer to the TLocale object.
3213 inline TLocale* TExtendedLocale::GetLocale()
3214 { return &iLocale; }
3218 Gets the device time state.
3220 @return The device time state.
3222 @deprecated Use the timezone server to coordinate automatic time adjustment.
3224 inline TLocale::TDeviceTimeState TLocale::DeviceTime() const
3226 return iDeviceTimeState;
3230 // Class TFindSemaphore
3231 inline TFindSemaphore::TFindSemaphore()
3234 Constructs the object with a default match pattern.
3236 The default match pattern, as implemented by the base class, is the single
3239 A new match pattern can be set after construction by calling the Find() member
3240 function of the TFindHandleBase base class.
3242 @see TFindHandleBase::Find
3249 inline TFindSemaphore::TFindSemaphore(const TDesC &aMatch)
3250 : TFindHandleBase(aMatch)
3252 Constructs this object with the specified match pattern.
3254 A new match pattern can be set after construction by
3255 calling TFindHandleBase::Find().
3257 Note that after construction, the object contains a copy of the supplied
3258 match pattern; the source descriptor can, therefore, be safely discarded.
3260 @param aMatch A reference to the descriptor containing the match pattern.
3262 @see TFindHandleBase::Find
3270 inline TFindMutex::TFindMutex()
3273 Constructs this object with a default match pattern.
3275 The default match pattern, as implemented by the base class, is the single
3278 A new match pattern can be set after construction by calling the Find() member
3279 function of the TFindHandleBase base class.
3281 @see TFindHandleBase::Find
3288 inline TFindMutex::TFindMutex(const TDesC &aMatch)
3289 : TFindHandleBase(aMatch)
3291 Constructs this object with the specified match pattern.
3293 A new match pattern can be set after construction by calling the Find() member
3294 function of the TFindHandleBase base class.
3296 After construction, the object contains a copy of the supplied match pattern;
3297 the source descriptor can, therefore, be safely discarded.
3299 @param aMatch The match pattern.
3301 @see TFindHandleBase::Find
3309 inline TFindChunk::TFindChunk()
3312 Constructs this object with a default match pattern.
3314 The default match pattern, as implemented by the base class, is
3315 the single character "*".
3317 A new match pattern can be set after construction by
3318 calling TFindHandleBase::Find().
3320 @see TFindHandleBase
3327 inline TFindChunk::TFindChunk(const TDesC &aMatch)
3328 : TFindHandleBase(aMatch)
3330 Constructs the object with the specified match pattern.
3332 A new match pattern can be set after construction by
3333 calling TFindHandleBase::Find().
3335 @param aMatch The match pattern.
3337 @see TFindHandleBase
3344 // Class TFindThread
3345 inline TFindThread::TFindThread()
3348 Constructs this object with a default match pattern.
3350 The default match pattern, as implemented by the base class,
3351 is the single character *.
3353 A new match pattern can be set after construction
3354 by calling TFindHandleBase::Find().
3356 @see TFindHandleBase::Find
3363 inline TFindThread::TFindThread(const TDesC &aMatch)
3364 : TFindHandleBase(aMatch)
3366 Constructs this object with the specified match pattern.
3368 A new match pattern can be set after construction
3369 by calling the TFindHandleBase::Find().
3371 @see TFindHandleBase::Find
3378 // Class TFindProcess
3379 inline TFindProcess::TFindProcess()
3382 Constructs this object with a default match pattern.
3384 The default match pattern, as implemented by the base class,
3385 is the single character *.
3387 A new match pattern can be set after construction
3388 by calling TFindHandleBase::Find().
3390 @see TFindHandleBase::Find
3397 inline TFindProcess::TFindProcess(const TDesC &aMatch)
3398 : TFindHandleBase(aMatch)
3400 Constructs this object with the specified match pattern.
3402 A new match pattern can be set after construction
3403 by calling the TFindHandleBase::Find().
3405 @see TFindHandleBase::Find
3412 // Class TFindLogicalDevice
3414 Constructs the LDD factory object with a default match pattern.
3416 The default match pattern, as implemented by the base class, is the single
3419 A new match pattern can be set after construction by calling the Find() member
3420 function of the TFindHandleBase base class.
3422 @see TFindHandleBase::Find
3424 inline TFindLogicalDevice::TFindLogicalDevice()
3429 Constructs the LDD factory object with a specified match pattern.
3431 A new match pattern can be set after construction by calling
3432 TFindHandleBase::Find().
3434 @param aMatch The match pattern.
3436 @see TFindHandleBase::Find
3438 inline TFindLogicalDevice::TFindLogicalDevice(const TDesC &aMatch)
3439 : TFindHandleBase(aMatch)
3442 // Class TFindPhysicalDevice
3444 Constructs the PDD factory object with a default match pattern.
3446 The default match pattern, as implemented by the base class, is the single
3449 A new match pattern can be set after construction by calling the Find() member
3450 function of the TFindHandleBase base class.
3452 @see TFindHandleBase::Find
3454 inline TFindPhysicalDevice::TFindPhysicalDevice()
3459 Constructs the PDD factory object with a specified match pattern.
3461 A new match pattern can be set after construction by calling
3462 TFindHandleBase::Find().
3464 @param aMatch The match pattern.
3466 @see TFindHandleBase::Find
3468 inline TFindPhysicalDevice::TFindPhysicalDevice(const TDesC &aMatch)
3469 : TFindHandleBase(aMatch)
3476 // Class TFindServer
3477 inline TFindServer::TFindServer()
3480 Constructs the object with a default match pattern.
3482 The default match pattern, as implemented by the base class, is the single
3485 A new match pattern can be set after construction by calling the Find() member
3486 function of the TFindHandleBase base class.
3488 @see TFindHandleBase::Find
3495 inline TFindServer::TFindServer(const TDesC &aMatch)
3496 : TFindHandleBase(aMatch)
3498 Constructs the object with a specified match pattern.
3500 A new match pattern can be set after construction by calling
3501 TFindHandleBase::Find().
3503 @param aMatch The match pattern.
3505 @see TFindHandleBase::Find
3512 // Class TFindLibrary
3513 inline TFindLibrary::TFindLibrary()
3516 Constructs this object with a default match pattern.
3518 The default match pattern is the single character ‘*’ and is implemented by
3519 the base class TFindHandleBase.
3526 inline TFindLibrary::TFindLibrary(const TDesC &aMatch)
3527 : TFindHandleBase(aMatch)
3529 Constructs this object with the specified match pattern.
3531 @param aMatch The descriptor containing the match pattern.
3540 Opens a handle to an LDD factory object found using a TFindLogicalDevice object.
3542 A TFindLogicalDevice object is used to find all LDD factory objects whose full names match
3543 a specified pattern.
3545 @param aFind A reference to the object which is used to find the LDD factory object.
3546 @param aType An enumeration whose enumerators define the ownership of this
3547 LDD factory object handle. If not explicitly specified, EOwnerProcess is
3550 @return KErrNone if successful, otherwise one of the other system wide error
3553 inline TInt RDevice::Open(const TFindLogicalDevice& aFind,TOwnerType aType)
3554 {return(RHandleBase::Open(aFind,aType));}
3559 // Class RCriticalSection
3560 inline TBool RCriticalSection::IsBlocked() const
3562 Tests whether the critical section is occupied by any thread.
3564 @return True, if the critical section is occupied by another thread. False,
3567 {return(iBlocked!=1);}
3573 inline TInt RMutex::Open(const TFindMutex& aFind,TOwnerType aType)
3575 Opens a handle to the global mutex found using a TFindMutex object.
3577 A TFindMutex object is used to find all global mutexes whose full names match
3578 a specified pattern.
3580 By default, any thread in the process can use this instance of RMutex to access
3581 the mutex. However, specifying EOwnerThread as the second parameter to this
3582 function, means that only the opening thread can use this instance of RMutex
3583 to access the mutex; any other thread in this process that wants to access
3584 the mutex must either duplicate the handle or use OpenGlobal() again.
3586 @param aFind A reference to the object which is used to find the mutex.
3587 @param aType An enumeration whose enumerators define the ownership of this
3588 mutex handle. If not explicitly specified, EOwnerProcess is
3591 @return KErrNone if successful, otherwise one of the other system wide error
3594 {return(RHandleBase::Open(aFind,aType));}
3600 inline TInt RChunk::Open(const TFindChunk& aFind,TOwnerType aType)
3602 Opens a handle to the global chunk found using a TFindChunk object.
3604 A TFindChunk object is used to find all chunks whose full names match
3605 a specified pattern.
3607 By default, ownership of this chunk handle is vested in the current process,
3608 but can be vested in the current thread by passing EOwnerThread as the second
3609 parameter to this function.
3611 @param aFind A reference to the TFindChunk object used to find the chunk.
3612 @param aType An enumeration whose enumerators define the ownership of this
3613 chunk handle. If not explicitly specified, EOwnerProcess is
3616 @return KErrNone if successful, otherwise another of the system error codes.
3618 {return(RHandleBase::Open(aFind,aType));}
3623 inline TBool RChunk::IsReadable() const
3625 Tests whether the chunk is mapped into its process address space.
3627 @return True, if the chunk is readable; false, otherwise.
3629 {return (Attributes()&RHandleBase::EDirectReadAccess); }
3634 inline TBool RChunk::IsWritable() const
3636 Tests whether the chunk mapped into its process address space and is writable.
3638 @return True, if the chunk is writable; false, otherwise.
3640 {return (Attributes()&RHandleBase::EDirectWriteAccess); }
3646 inline TObjectId::TObjectId()
3648 Default constructor.
3655 inline TObjectId::TObjectId(TUint64 aId)
3658 Constructor taking an unsigned integer value.
3660 @param aId The value of the object id.
3667 inline TUint64 TObjectId::Id() const
3669 Return the ID as a 64 bit integer
3676 inline TObjectId::operator TUint() const
3678 Conversion operator invoked by the compiler when a TObjectId type is passed
3679 to a function that is prototyped to take a TUint type.
3683 { return TUint(iId); }
3688 inline TBool TObjectId::operator==(TObjectId aId) const
3690 Tests whether this thread Id is equal to the specified Id.
3692 @param aId The thread Id to be compared with this thread Id.
3694 @return True, if the thread Ids are equal; false otherwise.
3696 {return iId==aId.iId;}
3701 inline TBool TObjectId::operator!=(TObjectId aId) const
3703 Tests whether this thread Id is unequal to the specified thread Id.
3705 @param aId The thread Id to be compared with this thread Id.
3707 @return True, if the thread Ids are unequal; false otherwise.
3709 {return iId!=aId.iId;}
3715 inline TThreadId::TThreadId()
3718 Default constructor.
3725 inline TThreadId::TThreadId(TUint64 aId)
3728 Constructor taking an unsigned integer value.
3730 @param aId The value of the thread id.
3738 inline RThread::RThread()
3739 : RHandleBase(KCurrentThreadHandle)
3741 Default constructor.
3743 The constructor exists to initialise private data within this handle; it does
3744 not create the thread object.
3746 Specifically, it sets the handle-number to the value KCurrentThreadHandle.
3747 In effect, the constructor creates a default thread handle.
3754 inline TInt RThread::Open(const TFindThread& aFind,TOwnerType aType)
3756 Opens a handle to the thread found by pattern matching a name.
3758 A TFindThread object is used to find all threads whose full names match a
3761 By default, ownership of this thread handle is vested in the current process,
3762 but can be vested in the current thread by passing EOwnerThread as the second
3763 parameter to this function.
3765 @param aFind A reference to the TFindThread object used to find the thread.
3766 @param aType An enumeration whose enumerators define the ownership of this
3767 thread handle. If not explicitly specified, EOwnerProcess is
3770 @return KErrNone if successful, otherwise one of the other system-wide error codes.
3772 {return(RHandleBase::Open(aFind,aType));}
3777 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3779 inline TBool RThread::HasCapability(TCapability aCapability, const char* aDiagnostic) const
3781 return DoHasCapability(aCapability, aDiagnostic);
3784 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
3786 return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
3789 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3791 // Only available to NULL arguments
3792 inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
3794 return DoHasCapability(aCapability);
3797 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
3799 return DoHasCapability(aCapability1, aCapability2);
3802 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3803 // For things using KSuppressPlatSecDiagnostic
3804 inline TBool RThread::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3806 return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
3809 inline TBool RThread::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3811 return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
3814 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3816 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3819 inline TProcessId::TProcessId()
3822 Default constructor.
3829 inline TProcessId::TProcessId(TUint64 aId)
3832 Constructor taking an unsigned integer value.
3834 @param aId The value of the process id.
3842 inline RProcess::RProcess()
3843 : RHandleBase(KCurrentProcessHandle)
3845 Default constructor.
3847 The constructor exists to initialise private data within this handle; it does
3848 not create the process object.
3850 Specifically, it sets the handle-number to the value KCurrentProcessHandle.
3851 In effect, the constructor creates a default process handle.
3858 inline RProcess::RProcess(TInt aHandle)
3859 : RHandleBase(aHandle)
3861 Constructor taking a handle number.
3863 @param aHandle The handle number to be used to construct this RProcess handle.
3870 inline TInt RProcess::Open(const TFindProcess& aFind,TOwnerType aType)
3872 Opens a handle to the process found by pattern matching a name.
3874 A TFindProcess object is used to find all processes whose full names match
3875 a specified pattern.
3877 By default, ownership of this process handle is vested in the current process,
3878 but can be vested in the current thread by passing EOwnerThread as the second
3879 parameter to this function.
3881 @param aFind A reference to the TFindProcess object used to find the process.
3882 @param aType An enumeration whose enumerators define the ownership of this
3883 process handle. If not explicitly specified, EOwnerProcess is taken
3886 @return KErrNone if successful, otherwise one of the other system-wide error codes.
3888 {return(RHandleBase::Open(aFind,aType));}
3893 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3895 inline TBool RProcess::HasCapability(TCapability aCapability, const char* aDiagnostic) const
3897 return DoHasCapability(aCapability, aDiagnostic);
3900 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
3902 return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
3905 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3907 // Only available to NULL arguments
3908 inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
3910 return DoHasCapability(aCapability);
3913 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
3915 return DoHasCapability(aCapability1, aCapability2);
3918 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
3919 // For things using KSuppressPlatSecDiagnostic
3920 inline TBool RProcess::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3922 return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
3925 inline TBool RProcess::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
3927 return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
3930 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
3932 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
3938 // Class RSessionBase
3942 Creates a session with a server, specifying no message slots.
3944 It should be called as part of session initialisation in the derived class.
3946 Message slots are not pre-allocated for the session but are taken from
3947 a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
3948 This raises a risk of failure due to lack of memory and, therefore, this mode
3949 of operation is not viable for sessions that make guarantees about the failure
3950 modes of asynchonous services.
3952 @param aServer The name of the server with which a session is to
3954 @param aVersion The lowest version of the server with which this client
3957 @return KErrNone if successful, otherwise one of the other system-wide error
3960 inline TInt RSessionBase::CreateSession(const TDesC& aServer,const TVersion& aVersion)
3961 {return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
3967 Creates a session with a server, specifying no message slots.
3969 It should be called as part of session initialisation in the derived class.
3971 Message slots are not pre-allocated for the session but are taken from
3972 a system-wide pool allowing up to 255 asynchronous messages to be outstanding.
3973 This raises a risk of failure due to lack of memory and, therefore, this mode
3974 of operation is not viable for sessions that make guarantees about the failure
3975 modes of asynchonous services.
3977 @param aServer A handle to a server with which a session is to be established.
3978 @param aVersion The lowest version of the server with which this client
3981 @return KErrNone if successful, otherwise one of the other system-wide error
3984 inline TInt RSessionBase::CreateSession(RServer2 aServer,const TVersion& aVersion)
3985 {return CreateSession(aServer,aVersion,-1,EIpcSession_Unsharable,NULL,0);}
3991 Issues a blind request to the server with the specified function number,
3994 A blind request is one where the server does not issue a response
3997 @param aFunction The function number identifying the request.
3998 @param aArgs A set of up to 4 arguments and their types to be passed
4001 @return KErrNone, if the send operation is successful;
4002 KErrServerTerminated, if the server no longer present;
4003 KErrServerBusy, if there are no message slots available;
4004 KErrNoMemory, if there is insufficient memory available.
4006 @panic USER 72 if the function number is negative.
4008 inline TInt RSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
4009 {return DoSend(aFunction,&aArgs);}
4015 Issues an asynchronous request to the server with the specified function
4016 number and arguments.
4018 The completion status of the request is returned via the request
4019 status object, aStatus.
4021 @param aFunction The function number identifying the request.
4022 @param aArgs A set of up to 4 arguments and their types to be passed
4024 @param aStatus The request status object used to contain the completion status
4027 @panic USER 72 if the function number is negative.
4029 inline void RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
4030 {DoSendReceive(aFunction,&aArgs,aStatus);}
4036 Issues a synchronous request to the server with the specified function number
4039 @param aFunction The function number identifying the request.
4040 @param aArgs A set of up to 4 arguments and their types to be passed
4043 @return KErrNone, if the send operation is successful;
4044 KErrServerTerminated, if the server no longer present;
4045 KErrServerBusy, if there are no message slots available;
4046 KErrNoMemory, if there is insufficient memory available.
4048 @panic USER 72 if the function number is negative.
4050 inline TInt RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
4051 {return DoSendReceive(aFunction,&aArgs);}
4057 Issues a blind request to the server with the specified function number,
4058 but with no arguments.
4060 A blind request is one where the server does not issue a response
4063 @param aFunction The function number identifying the request.
4065 @return KErrNone, if the send operation is successful;
4066 KErrServerTerminated, if the server no longer present;
4067 KErrServerBusy, if there are no message slots available;
4068 KErrNoMemory, if there is insufficient memory available.
4070 @panic USER 72 if the function number is negative.
4072 inline TInt RSessionBase::Send(TInt aFunction) const
4073 {return DoSend(aFunction,NULL);}
4079 Issues an asynchronous request to the server with the specified function
4080 number, but with no arguments.
4082 The completion status of the request is returned via the request
4083 status object, aStatus.
4085 @param aFunction The function number identifying the request.
4086 @param aStatus The request status object used to contain the completion
4087 status of the request.
4089 @panic USER 72 if the function number is negative.
4091 inline void RSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
4092 { DoSendReceive(aFunction,NULL,aStatus);}
4098 Sets the handle-number of this handle to the specified
4101 The function can take a (zero or positive) handle-number,
4102 or a (negative) error number.
4104 If aHandleOrError represents a handle-number, then the handle-number of this handle
4105 is set to that value.
4106 If aHandleOrError represents an error number, then the handle-number of this handle is set to zero
4107 and the negative value is returned.
4109 @param aHandleOrError A handle-number, if zero or positive; an error value, if negative.
4111 @return KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.
4113 inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError)
4114 { return RHandleBase::SetReturnedHandle(aHandleOrError);}
4119 inline TInt RSessionBase::SetReturnedHandle(TInt aHandleOrError,RHandleBase& aHandle)
4120 { return RHandleBase::SetReturnedHandle(aHandleOrError,aHandle);}
4122 Issues a synchronous request to the server with the specified function number,
4123 but with no arguments.
4125 @param aFunction The function number identifying the request.
4127 @return KErrNone, if the send operation is successful;
4128 KErrServerTerminated, if the server no longer present;
4129 KErrServerBusy, if there are no message slots available;
4130 KErrNoMemory, if there is insufficient memory available.
4132 @panic USER 72 if the function number is negative.
4134 inline TInt RSessionBase::SendReceive(TInt aFunction) const
4135 {return DoSendReceive(aFunction,NULL);}
4140 // Class RSubSessionBase
4141 inline RSubSessionBase::RSubSessionBase()
4142 : iSubSessionHandle(0)
4151 inline TInt RSubSessionBase::SubSessionHandle() const
4153 Gets the sub-session handle number.
4155 This number is automatically passed to the server when making requests and is
4156 used to identify the appropriate server-side sub-session.
4158 @return The sub-session handle number.
4160 {return iSubSessionHandle;}
4166 Creates a new sub-session within an existing session.
4168 @param aSession The session to which this sub-session will belong.
4169 @param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
4170 @param aArgs The message arguments.
4172 @return KErrNone if successful, otherwise one of the system-wide error codes.
4174 inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs)
4175 { return DoCreateSubSession(aSession,aFunction,&aArgs); }
4181 Creates a new sub-session within an existing session.
4183 This variant sends no message arguments to the server.
4185 @param aSession The session to which this sub-session will belong.
4186 @param aFunction The opcode specifying the requested service; the server should interpret this as a request to create a sub-session.
4188 @return KErrNone if successful, otherwise one of the system-wide error codes.
4190 inline TInt RSubSessionBase::CreateSubSession(const RSessionBase& aSession,TInt aFunction)
4191 { return DoCreateSubSession(aSession,aFunction,NULL); }
4197 Sends a blind message to the server - no reply is expected.
4199 A set of message arguments is passed that can be used to specify client
4200 addresses, which the server can use to read from and write to the client
4203 Note that this function can fail if there are no available message-slots, either
4204 in the system wide pool (if this is being used), or in the session reserved pool
4205 (if this is being used). If the client request is synchronous, then always use
4206 the synchronous variant of SendReceive(); this is guaranteed to reach the server.
4208 @param aFunction The opcode specifying the requested service.
4209 @param aArgs The message arguments.
4211 @return KErrNone if successful, otherwise one of the system-wide error codes.
4213 inline TInt RSubSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) const
4214 {return DoSend(aFunction,&aArgs);}
4220 Sends a message to the server and waits asynchronously for the reply.
4222 An opcode specifies the service required.
4223 A set of message arguments is passed that can be used to specify client addresses,
4224 which the server can use to read from and write to the client address space.
4226 Note that this function can fail if there are no available message-slots,
4227 either in the system wide pool (if this is being used), or in the session
4228 reserved pool (if this is being used). If the client request is synchronous,
4229 then always use the synchronous variant of SendReceive();
4230 this is guaranteed to reach the server.
4232 @param aFunction The opcode specifying the requested service.
4233 @param aArgs The message arguments.
4234 @param aStatus A request status which indicates the completion status of the asynchronous request.
4236 inline void RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
4237 {DoSendReceive(aFunction,&aArgs,aStatus);}
4243 Sends a message to the server and waits synchronously for a reply.
4245 An opcode specifies the service required.
4246 A set of message arguments is passed that can be used to specify client addresses,
4247 which the server can use to read from and write to the client address space.
4249 Note that this function will only fail if the server itself fails or environmental
4250 errors occur in the server. All requests made using this function are guaranteed to
4251 reach the server. This means that all synchronous client requests (typically those
4252 that return void) should be routed through this synchronous variant of SendReceive().
4254 @param aFunction The opcode specifying the requested service.
4255 @param aArgs The message arguments.
4257 @return KErrNone if successful, otherwise one of the system-wide error codes.
4259 inline TInt RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
4260 {return DoSendReceive(aFunction,&aArgs);}
4266 Sends a blind message to the server - no reply is expected.
4268 This variant sends no message arguments to the server.
4270 @param aFunction The opcode specifying the requested service.
4272 @return KErrNone if successful, otherwise one of the system-wide error codes.
4274 inline TInt RSubSessionBase::Send(TInt aFunction) const
4275 {return DoSend(aFunction,NULL);}
4281 Sends a message to the server and waits asynchronously for the reply.
4283 An opcode specifies the service required.
4284 This variant sends no message arguments to the server.
4286 @param aFunction The opcode specifying the requested service.
4287 @param aStatus A request status which indicates the completion status of the asynchronous request.
4289 inline void RSubSessionBase::SendReceive(TInt aFunction,TRequestStatus& aStatus) const
4290 { DoSendReceive(aFunction,NULL,aStatus);}
4296 Sends a message to the server and waits synchronously for a reply.
4298 An opcode specifies the service required.
4299 This variant sends no message arguments to the server.
4301 @param aFunction The opcode specifying the requested service.
4303 @return KErrNone if successful, otherwise one of the system-wide error codes.
4305 inline TInt RSubSessionBase::SendReceive(TInt aFunction) const
4306 {return DoSendReceive(aFunction,NULL);}
4314 Default constructor.
4316 inline RRefBase::RRefBase()
4325 @param aRef A reference to the object to be copied.
4327 inline RRefBase::RRefBase(const RRefBase &aRef)
4337 Default constructor.
4340 inline RRef<T>::RRef()
4348 The constructor frees any existing contained object, and takes ownership of
4349 the object owned by anObject.
4351 @param anObject A reference to another 'reference' object.
4352 On return from this constructor, anObject may be safely
4353 orphaned if it lives on the program stack.
4356 inline RRef<T>::RRef(const RRef<T> &anObject)
4363 Assignment operator.
4365 The constructor frees any existing contained object, and takes ownership of
4366 the object owned by anObject.
4368 @param anObject A reference to another 'reference' object.
4369 On return from this constructor, anObject may be safely
4370 orphaned if it lives on the program stack.
4373 inline void RRef<T>::operator=(const RRef<T> &anObject)
4380 Gets a pointer to the contained object.
4382 @return A pointer to the contained object
4385 inline T *RRef<T>::operator->()
4386 {return((T *)iPtr);}
4392 Gets a pointer to the contained object.
4394 @return A pointer to the contained object
4397 inline RRef<T>::operator T*()
4398 {return((T *)iPtr);}
4404 Creates a copy of the specified object, which is to be contained by
4405 this reference object.
4407 The amount of memory set aside to contain the object is defined by the size
4410 @param anObject The object to be packaged up by this reference object.
4413 void RRef<T>::Alloc(const T &anObject)
4414 {DoAlloc(&anObject,sizeof(T));}
4420 Creates a copy of the specified object, which is to be contained by
4421 this reference object.
4423 The amount of memory set aside to contain the object is defined by aSize.
4425 @param anObject The object to be packaged up by this reference object.
4426 @param aSize The amount of memory to be set aside to contain the object.
4427 You must make sure that this is big enough.
4430 void RRef<T>::Alloc(const T &anObject,TInt aSize)
4431 {DoAlloc(&anObject,aSize);}
4437 Creates a copy of the specified object, which is to be contained by
4438 this reference object, and leaves on failure.
4440 The amount of memory set aside to contain the object is defined by the size
4443 @param anObject The object to be packaged up by this reference object.
4446 void RRef<T>::AllocL(const T &anObject)
4447 {DoAllocL(&anObject,sizeof(T));}
4453 Creates a copy of the specified object, which is to be contained by
4454 this reference object, and leaves on failure.
4456 The amount of memory set aside to contain the object is defined by aSize.
4458 @param anObject The object to be packaged up by this reference object.
4459 @param aSize The amount of memory to be set aside to contain the object.
4460 You must make sure that this is big enough.
4463 void RRef<T>::AllocL(const T &anObject,TInt aSize)
4464 {DoAllocL(&anObject,aSize);}
4470 inline TBool TRegion::CheckError() const
4472 Tests whether the region's error flag is set.
4474 The error flag may be set:
4476 1. when an attempt to allocate more memory for the region fails
4478 2. if an attempt is made to expand a fixed size region beyond its allocated
4481 3. if ForceError() has been called.
4483 Use Clear() to unset the error flag, clear the region and free all allocated
4486 @return True, if the error flag is set; false, otherwise.
4488 @see TRegion::ForceError
4496 inline TInt TRegion::Count() const
4498 Gets the number of rectangles in this region.
4500 @return The number of rectangles.
4507 inline const TRect *TRegion::RectangleList() const
4509 Gets a pointer to the array of rectangles defining this region.
4511 @return Pointer to the array of rectangles. Note that array is a standard
4512 C++ array, i.e. a concatenated set of TRect objects. Use Count() to
4513 get the number of rectangles.
4517 {return(((TRegion *)this)->RectangleListW());}
4522 inline TRegion::TRegion()
4529 inline TInt RRegion::CheckSpare() const
4531 Gets the number of free memory slots in the region.
4533 This is the number of slots which have been allocated, minus the number in
4536 @return The number of free memory slots in the region.
4538 {return(iAllocedRects-iCount);}
4545 inline TRegionFix<S>::TRegionFix() : TRegion(-S)
4547 Constructs a default fixed size region.
4555 inline TRegionFix<S>::TRegionFix(const TRect &aRect) : TRegion(-S)
4557 Constructs a fixed size region with a TRect.
4559 @param aRect Rectangle to be added to the newly constructed region.
4567 inline TRegionFix<S>::TRegionFix(const TRegionFix<S> &aRegion)
4571 @param aRegion The TRegionFix object to be copied.
4579 inline RRegionBuf<S>::RRegionBuf() : RRegion(-S&(~ERRegionBuf),S)
4581 Constructs a default object.
4583 The granularity is the value of the template parameter.
4590 inline RRegionBuf<S>::RRegionBuf(const RRegion &aRegion)
4592 Constructs this object from the specified RRegion.
4594 @param aRegion The region to assign to this RRegionBuf.
4602 inline RRegionBuf<S>::RRegionBuf(const TRect &aRect) : RRegion(-S&(~ERRegionBuf),S)
4604 Constructs an RRegionBuf with a TRect.
4606 Its granularity is initialised to the value contained in the template argument.
4607 The resulting region consists of the specified single rectangle.
4609 @param aRect The single rectangle with which to initialise the region.
4617 inline RRegionBuf<S>::RRegionBuf(const RRegionBuf<S> &aRegion)
4619 Copy constructs from an existing RRegionBuf object.
4621 @param aRegion The RRegionBuf to be copied.
4628 // enum TTimerLockSpec
4629 inline TTimerLockSpec &operator++(TTimerLockSpec &aLock)
4631 return aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
4633 inline TTimerLockSpec operator++(TTimerLockSpec &aLock, TInt)
4635 TTimerLockSpec l=aLock;
4636 aLock=((aLock==ETwelveOClock) ? EOneOClock : (TTimerLockSpec)((TInt)aLock+1));
4643 // Class TCheckedUid
4644 inline const TUidType& TCheckedUid::UidType() const
4646 Gets the Uid type contained in this object.
4648 @return The Uid type.
4655 // Array deletion support, uses CBase deletion (virtual d'tor) for all C-classes
4657 /** @internalComponent
4659 void _DeleteArray(T** aBegin,T** aEnd)
4660 {for (;;) if (aBegin<aEnd) delete *aBegin++; else return;}
4663 /** @internalComponent
4667 static inline void Delete(T* aBegin,T* aEnd,CBase*)
4668 {::_DeleteArray((CBase**)aBegin,(CBase**)aEnd);}
4669 static inline void Delete(T* aBegin,T* aEnd,TAny*)
4670 {::_DeleteArray(aBegin,aEnd);}
4671 static inline void Delete(T* aArray,TInt aCount)
4672 {Delete(aArray,aArray+aCount,*aArray);}
4679 // Template class TFixedArray
4680 IMPORT_C void PanicTFixedArray();
4685 template <class T,TInt S>
4686 inline TFixedArray<T,S>::TFixedArray()
4688 Default constructor.
4690 Constructs an uninitialised C++ array.
4697 template <class T,TInt S>
4698 inline void TFixedArray<T,S>::Copy(const T* aList,TInt aLength)
4700 Copies the specified set of contiguous objects into the C++ array.
4702 The copy operation starts at the beginning of the array, replacing
4705 @param aList A pointer to a set of contiguous objects.
4706 @param aLength The number of contiguous objects to be copied. This value must
4707 not be negative and must not be greater than the size of the
4708 array as defined by the integer template parameter.
4710 @panic USER 133, in a debug build only, if aLength is negative or is greater
4711 than the size of the array as defined by the integer template parameter.
4713 {__ASSERT_DEBUG(TUint(aLength)<=TUint(S),PanicTFixedArray());Mem::Copy(iRep,aList,aLength*sizeof(T));}
4718 template <class T,TInt S>
4719 inline TFixedArray<T,S>::TFixedArray(const T* aList,TInt aLength)
4721 Constructs a C++ array initialised with the specified objects.
4723 @param aList A pointer to a set of contiguous objects.
4724 @param aLength The number of contiguous objects to be copied. This value must
4725 not be negative and must not be greater than the size of the
4726 array as defined by the integer template parameter.
4728 @panic USER 133, in a debug build only, if aLength is negative or is greater
4729 than the size of the array as defined by the integer template parameter.
4731 {Copy(aList,aLength);}
4736 template <class T,TInt S>
4737 inline void TFixedArray<T,S>::Reset()
4739 Fills every element of the array with binary zeroes.
4741 {Mem::FillZ(iRep,sizeof(iRep));}
4746 template <class T,TInt S>
4747 inline TInt TFixedArray<T,S>::Count() const
4749 Gets the size of the array.
4751 For any instance of this class, the array size
4752 is fixed and has the same value as the integer template parameter.
4754 @return The size of the array.
4761 template <class T,TInt S>
4762 inline TInt TFixedArray<T,S>::Length() const
4764 Gets the size of an array element, in bytes.
4766 @return The size of an array element, in bytes.
4773 template <class T,TInt S>
4774 inline TBool TFixedArray<T,S>::InRange(TInt aIndex)
4775 {return TUint(aIndex)<S;}
4780 template <class T,TInt S>
4781 inline T& TFixedArray<T,S>::operator[](TInt aIndex)
4783 Gets a reference to the specified element within the C++ array.
4785 @param aIndex The position of the element within the array. This is an offset value;
4786 a zero value refers to the first element in the array. This value must be
4787 greater than or equal to zero and less than the size of the array.
4789 @return A reference to an element of the array.
4791 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
4792 of the array as defined by the integer template parameter.
4794 {__ASSERT_DEBUG(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
4799 template <class T,TInt S>
4800 inline const T& TFixedArray<T,S>::operator[](TInt aIndex) const
4802 Gets a const reference to the specified element within the C++ array.
4804 @param aIndex The position of the element within the array. This is an offset value;
4805 a zero value refers to the first element in the array. This value must be
4806 greater than or equal to zero and less than the size of the array.
4808 @return A const reference to an element of the array; the element cannot be
4809 changed through this reference.
4811 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
4812 of the array as defined by the integer template parameter.
4814 {return CONST_CAST(ThisClass&,*this)[aIndex];}
4819 template <class T,TInt S>
4820 inline T& TFixedArray<T,S>::At(TInt aIndex)
4822 Gets a reference to the specified element within the C++ array.
4824 @param aIndex The position of the element within the array. This is an offset value;
4825 a zero value refers to the first element in the array. This value must be
4826 greater than or equal to zero and less than the size of the array.
4828 @return A reference to an element of the array.
4830 @panic USER 133, if aIndex is negative or greater than or equal to the size
4831 of the array as defined by the integer template parameter.
4833 {__ASSERT_ALWAYS(InRange(aIndex),PanicTFixedArray());return iRep[aIndex];}
4838 template <class T,TInt S>
4839 inline const T& TFixedArray<T,S>::At(TInt aIndex) const
4841 Gets a const reference to the specified element within the C++ array.
4843 @param aIndex The position of the element within the array. This is an offset value;
4844 a zero value refers to the first element in the array. This value must be
4845 greater than or equal to zero and less than the size of the array.
4847 @return A const reference to an element of the array; the element cannot be
4848 changed through this reference.
4850 @panic USER 133, in a debug build only, if aIndex is negative or greater than or equal to the size
4851 of the array as defined by the integer template parameter.
4853 {return CONST_CAST(ThisClass&,*this).At(aIndex);}
4858 template <class T,TInt S>
4859 inline T* TFixedArray<T,S>::Begin()
4861 Gets a pointer to the first element of the array.
4863 @return A pointer to the first element of the array.
4870 template <class T,TInt S>
4871 inline T* TFixedArray<T,S>::End()
4873 Gets a pointer to the first byte following the end of the array.
4875 @return A pointer to the first byte following the end of the array.
4882 template <class T,TInt S>
4883 inline const T* TFixedArray<T,S>::Begin() const
4885 Gets a pointer to the first element of the array.
4887 @return A pointer to a const element of the array.
4894 template <class T,TInt S>
4895 inline const T* TFixedArray<T,S>::End() const
4897 Gets a pointer to the first byte following the end of the array.
4899 @return A pointer to the const first byte following the end of the array.
4906 template <class T,TInt S>
4907 inline TInt TFixedArray<T,S>::CountFunctionR(const CBase*)
4913 template <class T,TInt S>
4914 inline const TAny* TFixedArray<T,S>::AtFunctionR(const CBase* aThis,TInt aIndex)
4915 {return &REINTERPRET_CAST(const ThisClass&,*aThis)[aIndex];}
4920 template <class T,TInt S>
4921 inline TArray<T> TFixedArray<T,S>::Array() const
4923 Creates and returns a generic array for this C++ array.
4925 @return A generic array for this C++ array.
4927 {return TArray<T>(CountFunctionR,AtFunctionR,REINTERPRET_CAST(const CBase*,this));}
4932 template <class T,TInt S>
4933 inline void TFixedArray<T,S>::DeleteAll()
4935 Invokes the delete operator on every member of the array.
4937 The function can only be used for arrays of pointers to CBase derived objects.
4939 If the array is to be used after a call to this function, it is good practice
4940 to call TFixedArray<class T,TInt S>::Reset() to set all array elements to
4943 {_ArrayUtil<T>::Delete(iRep,S);}
4951 inline RHeap* User::SwitchHeap(RAllocator* aHeap)
4953 Changes the current thread's heap.
4955 @param aHeap A pointer to the new heap handle.
4957 @return A pointer to the old heap handle.
4959 { return (RHeap*)SwitchAllocator(aHeap); }
4964 inline RHeap& User::Heap()
4966 Gets a reference to the handle to the current thread's heap.
4968 @return A reference to the handle to the current thread's heap.
4970 { return (RHeap&)Allocator(); }
4975 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4977 inline TBool User::CreatorHasCapability(TCapability aCapability, const char* aDiagnostic)
4979 return DoCreatorHasCapability(aCapability, aDiagnostic);
4982 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic)
4984 return DoCreatorHasCapability(aCapability1, aCapability2, aDiagnostic);
4987 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
4989 // Only available to NULL arguments
4990 inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/)
4992 return DoCreatorHasCapability(aCapability);
4995 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/)
4997 return DoCreatorHasCapability(aCapability1, aCapability2);
5000 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
5001 // For things using KSuppressPlatSecDiagnostic
5002 inline TBool User::CreatorHasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
5004 return DoCreatorHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
5007 inline TBool User::CreatorHasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/)
5009 return DoCreatorHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
5012 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
5014 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5017 inline const TAny* User::LeaveIfNull(const TAny* aPtr)
5019 Leaves with the reason code KErrNoMemory, if the specified pointer is NULL.
5021 If the pointer is not NULL, the function simply returns with the value of
5024 Used to check pointers to const objects.
5026 @param aPtr The pointer to be tested.
5028 @return If the function returns, the value of aPtr.
5030 { return (const TAny*)LeaveIfNull((TAny*)aPtr); }
5032 /** Sets this TSecurityInfo to the security attributes of this process. */
5033 inline void TSecurityInfo::SetToCurrentInfo()
5034 { new (this) TSecurityInfo(RProcess()); }
5036 /** Constructs a TSecurityInfo using the security attributes of aProcess */
5037 inline void TSecurityInfo::Set(RProcess aProcess)
5038 { new (this) TSecurityInfo(aProcess); }
5040 /** Constructs a TSecurityInfo using the security attributes of the process
5043 inline void TSecurityInfo::Set(RThread aThread)
5044 { new (this) TSecurityInfo(aThread); }
5046 /** Constructs a TSecurityInfo using the security attributes of the process
5047 which sent the message aMsgPtr */
5048 inline void TSecurityInfo::Set(RMessagePtr2 aMsgPtr)
5049 { new (this) TSecurityInfo(aMsgPtr); }
5051 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5053 /** Checks this policy against the platform security attributes of aProcess.
5055 When a check fails the action taken is determined by the system wide Platform Security
5056 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5057 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5060 @param aProcess The RProcess object to check against this TSecurityPolicy.
5061 @param aDiagnostic A string that will be emitted along with any diagnostic message
5062 that may be issued if the policy check fails.
5063 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5064 which enables it to be easily removed from the system.
5065 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5066 platform security attributes of aProcess, EFalse otherwise.
5067 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5069 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
5071 return DoCheckPolicy(aProcess, aDiagnostic);
5074 /** Checks this policy against the platform security attributes of the process
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 aThread The thread whose owning process' platform security attributes
5083 are to be checked against this TSecurityPolicy.
5084 @param aDiagnostic A string that will be emitted along with any diagnostic message
5085 that may be issued if the policy check fails.
5086 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5087 which enables it to be easily removed from the system.
5088 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5089 platform security parameters of the owning process of aThread, EFalse otherwise.
5090 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5092 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
5094 return DoCheckPolicy(aThread, aDiagnostic);
5097 /** Checks this policy against the platform security attributes of the process which sent
5100 When a check fails the action taken is determined by the system wide Platform Security
5101 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5102 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5105 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5106 @param aDiagnostic A string that will be emitted along with any diagnostic message
5107 that may be issued if the policy check fails.
5108 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5109 which enables it to be easily removed from the system.
5110 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5111 platform security attributes of aMsg, EFalse otherwise.
5112 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5114 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
5116 return DoCheckPolicy(aMsgPtr, aDiagnostic);
5119 /** Checks this policy against the platform security attributes of the process which sent
5122 When a check fails the action taken is determined by the system wide Platform Security
5123 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5124 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5127 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5128 @param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
5129 it finds to be missing.
5130 @param aDiagnostic A string that will be emitted along with any diagnostic message
5131 that may be issued if the policy check fails.
5132 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5133 which enables it to be easily removed from the system.
5134 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5135 platform security attributes of aMsg, EFalse otherwise.
5136 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5140 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
5142 return DoCheckPolicy(aMsgPtr, aMissing, aDiagnostic);
5145 /** Checks this policy against the platform security attributes of this process' creator.
5147 When a check fails the action taken is determined by the system wide Platform Security
5148 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5149 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5152 @param aDiagnostic A string that will be emitted along with any diagnostic message
5153 that may be issued if the policy check fails.
5154 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5155 which enables it to be easily removed from the system.
5156 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5157 platform security attributes of this process' creator, EFalse otherwise.
5158 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5160 inline TBool TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
5162 return DoCheckPolicyCreator(aDiagnostic);
5166 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
5168 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const
5170 return (&(*this))->CheckPolicy(aProcess, aDiagnostic);
5174 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
5176 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
5178 return (&(*this))->CheckPolicy(aThread, aDiagnostic);
5182 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
5184 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic) const
5186 return (&(*this))->CheckPolicy(aMsgPtr, aDiagnostic);
5190 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
5193 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic) const
5195 return (&(*this))->CheckPolicy(aMsgPtr, aMissing, aDiagnostic);
5199 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
5201 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic) const
5203 return (&(*this))->CheckPolicyCreator(aDiagnostic);
5206 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5208 /** Checks this policy against the platform security attributes of aProcess.
5210 When a check fails the action taken is determined by the system wide Platform Security
5211 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5212 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5215 @param aProcess The RProcess object to check against this TSecurityPolicy.
5216 @param aDiagnostic A string that will be emitted along with any diagnostic message
5217 that may be issued if the policy check fails.
5218 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5219 which enables it to be easily removed from the system.
5220 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5221 platform security attributes of aProcess, EFalse otherwise.
5222 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5224 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
5226 return DoCheckPolicy(aProcess);
5229 /** Checks this policy against the platform security attributes of the process
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 aThread The thread whose owning process' platform security attributes
5238 are to be checked against this TSecurityPolicy.
5239 @param aDiagnostic A string that will be emitted along with any diagnostic message
5240 that may be issued if the policy check fails.
5241 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5242 which enables it to be easily removed from the system.
5243 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5244 platform security parameters of the owning process of aThread, EFalse otherwise.
5245 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5247 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
5249 return DoCheckPolicy(aThread);
5252 /** Checks this policy against the platform security attributes of the process which sent
5255 When a check fails the action taken is determined by the system wide Platform Security
5256 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5257 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5260 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5261 @param aDiagnostic A string that will be emitted along with any diagnostic message
5262 that may be issued if the policy check fails.
5263 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5264 which enables it to be easily removed from the system.
5265 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5266 platform security attributes of aMsg, EFalse otherwise.
5267 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5269 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
5271 return DoCheckPolicy(aMsgPtr);
5274 /** Checks this policy against the platform security attributes of the process which sent
5277 When a check fails the action taken is determined by the system wide Platform Security
5278 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5279 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5282 @param aMsgPtr The RMessagePtr2 object to check against this TSecurityPolicy.
5283 @param aMissing A TSecurityInfo object which this method fills with any capabilities or IDs
5284 it finds to be missing.
5285 @param aDiagnostic A string that will be emitted along with any diagnostic message
5286 that may be issued if the policy check fails.
5287 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5288 which enables it to be easily removed from the system.
5289 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5290 platform security attributes of aMsg, EFalse otherwise.
5291 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5295 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
5297 return DoCheckPolicy(aMsgPtr, aMissing);
5300 /** Checks this policy against the platform security attributes of this process' creator.
5302 When a check fails the action taken is determined by the system wide Platform Security
5303 configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted.
5304 If PlatSecEnforcement is OFF, then this function will return ETrue even though the
5307 @param aDiagnostic A string that will be emitted along with any diagnostic message
5308 that may be issued if the policy check fails.
5309 This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro
5310 which enables it to be easily removed from the system.
5311 @return ETrue if all the requirements of this TSecurityPolicy are met by the
5312 platform security attributes of this process' creator, EFalse otherwise.
5313 @panic USER 190 if 'this' is an invalid SSecurityInfo object
5315 inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
5317 return DoCheckPolicyCreator();
5320 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
5321 inline TBool TSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5323 return DoCheckPolicy(aProcess, KSuppressPlatSecDiagnosticMagicValue);
5326 inline TBool TSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5328 return DoCheckPolicy(aThread, KSuppressPlatSecDiagnosticMagicValue);
5331 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5333 return DoCheckPolicy(aMsgPtr, KSuppressPlatSecDiagnosticMagicValue);
5336 inline TBool TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5338 return DoCheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnosticMagicValue);
5341 inline TBool TSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5343 return DoCheckPolicyCreator(KSuppressPlatSecDiagnosticMagicValue);
5345 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
5348 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
5350 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/) const
5352 return (&(*this))->CheckPolicy(aProcess);
5356 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
5358 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/) const
5360 return (&(*this))->CheckPolicy(aThread);
5364 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
5366 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/) const
5368 return (&(*this))->CheckPolicy(aMsgPtr);
5372 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
5375 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/) const
5377 return (&(*this))->CheckPolicy(aMsgPtr, aMissing);
5381 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
5383 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/) const
5385 return (&(*this))->CheckPolicyCreator();
5388 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
5390 @see TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic)
5392 inline TBool TStaticSecurityPolicy::CheckPolicy(RProcess aProcess, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5394 return (&(*this))->CheckPolicy(aProcess, KSuppressPlatSecDiagnostic);
5398 @see TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic)
5400 inline TBool TStaticSecurityPolicy::CheckPolicy(RThread aThread, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5402 return (&(*this))->CheckPolicy(aThread, KSuppressPlatSecDiagnostic);
5406 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, const char* aDiagnostic)
5408 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5410 return (&(*this))->CheckPolicy(aMsgPtr, KSuppressPlatSecDiagnostic);
5414 @see TSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, const char* aDiagnostic)
5417 inline TBool TStaticSecurityPolicy::CheckPolicy(RMessagePtr2 aMsgPtr, TSecurityInfo& aMissing, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5419 return (&(*this))->CheckPolicy(aMsgPtr, aMissing, KSuppressPlatSecDiagnostic);
5423 @see TSecurityPolicy::CheckPolicyCreator(const char* aDiagnostic)
5425 inline TBool TStaticSecurityPolicy::CheckPolicyCreator(OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
5427 return (&(*this))->CheckPolicyCreator(KSuppressPlatSecDiagnostic);
5429 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
5431 #endif //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
5435 #ifndef __KERNEL_MODE__
5438 Appends an object pointer onto the array.
5440 The function leaves with one of the system wide error codes, if the operation fails.
5442 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5444 @param anEntry The object pointer to be appended.
5447 inline void RPointerArray<T>::AppendL(const T* anEntry)
5448 { User::LeaveIfError(Append(anEntry));}
5452 Inserts an object pointer into the array at the specified position.
5454 The function leaves with one of the system wide error codes, if
5455 the operation fails.
5457 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5459 @param anEntry The object pointer to be inserted.
5460 @param aPos The position within the array where the object pointer is to be
5461 inserted. The position is relative to zero, i.e. zero implies
5462 that a pointer is inserted at the beginning of the array.
5464 @panic USER 131, if aPos is negative, or is greater than the number of object
5465 pointers currently in the array.
5468 inline void RPointerArray<T>::InsertL(const T* anEntry, TInt aPos)
5469 { User::LeaveIfError(Insert(anEntry,aPos)); }
5473 Finds the first object pointer in the array which matches the specified object
5474 pointer, using a sequential search.
5476 Matching is based on the comparison of pointers.
5478 The find operation always starts at the low index end of the array. There
5479 is no assumption about the order of objects in the array.
5481 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5483 @param anEntry The object pointer to be found.
5484 @return The index of the first matching object pointer within the array.
5485 @leave KErrNotFound, if no matching object pointer can be found.
5488 inline TInt RPointerArray<T>::FindL(const T* anEntry) const
5489 { return User::LeaveIfError(Find(anEntry));}
5493 Finds the first object pointer in the array whose object matches the specified
5494 object, using a sequential search and a matching algorithm.
5496 The algorithm for determining whether two class T objects match is provided
5497 by a function supplied by the caller.
5499 The find operation always starts at the low index end of the array. There
5500 is no assumption about the order of objects in the array.
5502 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5504 @param anEntry The object pointer to be found.
5505 @param anIdentity A package encapsulating the function which determines whether
5506 two class T objects match.
5508 @return The index of the first matching object pointer within the array.
5509 @leave KErrNotFound, if no suitable object pointer can be found.
5512 inline TInt RPointerArray<T>::FindL(const T* anEntry, TIdentityRelation<T> anIdentity) const
5513 { return User::LeaveIfError(Find(anEntry, anIdentity));}
5517 Finds the last object pointer in the array which matches the specified object
5518 pointer, using a sequential search.
5520 Matching is based on the comparison of pointers.
5522 The find operation always starts at the high index end of the array. There
5523 is no assumption about the order of objects in the array.
5525 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5527 @param anEntry The object pointer to be found.
5528 @return The index of the last matching object pointer within the array.
5529 @leave KErrNotFound, if no matching object pointer can be found.
5532 inline TInt RPointerArray<T>::FindReverseL(const T* anEntry) const
5533 { return User::LeaveIfError(FindReverse(anEntry));}
5537 Finds the last object pointer in the array whose object matches the specified
5538 object, using a sequential search and a matching algorithm.
5540 The algorithm for determining whether two class T objects match is provided
5541 by a function supplied by the caller.
5543 The find operation always starts at the high index end of the array. There
5544 is no assumption about the order of objects in the array.
5546 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5548 @param anEntry The object pointer to be found.
5549 @param anIdentity A package encapsulating the function which determines whether
5550 two class T objects match.
5552 @return The index of the last matching object pointer within the array.
5553 @leave KErrNotFound, if no suitable object pointer can be found.
5556 inline TInt RPointerArray<T>::FindReverseL(const T* anEntry, TIdentityRelation<T> anIdentity) const
5557 { return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
5561 Finds the object pointer in the array that matches the specified object
5562 pointer, using a binary search technique.
5564 The function assumes that object pointers in the array are in address order.
5566 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5568 @param anEntry The object pointer to be found.
5570 @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>::FindInAddressOrderL(const T* anEntry) const
5575 { return User::LeaveIfError(FindInAddressOrder(anEntry));}
5579 Finds the object pointer in the array whose object matches the specified
5580 object, using a binary search technique and an ordering algorithm.
5582 The function assumes that existing object pointers in the array are ordered
5583 so that the objects themselves are in object order as determined by an algorithm
5584 supplied by the caller and packaged as a TLinearOrder<T>.
5586 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5588 @param anEntry The object pointer to be found.
5589 @param anOrder A package encapsulating the function which determines the order
5590 of two class T objects.
5592 @return The index of the matching object pointer within the array.
5594 @leave KErrNotFound, if no suitable object pointer can be found.
5597 inline TInt RPointerArray<T>::FindInOrderL(const T* anEntry, TLinearOrder<T> anOrder) const
5598 { return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
5602 Finds the object pointer in the array that matches the specified object
5603 pointer, using a binary search technique.
5605 The function assumes that object pointers in the array are in address order.
5607 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5609 @param anEntry The object pointer to be found.
5610 @param anIndex A reference to a TInt into which the
5611 function puts an index value: If the function does not leave,
5612 this is the index of the matching object pointer within the
5613 array. If the function leaves with KErrNotFound, this is the
5614 index of the first object pointer within the array which
5615 logically follows after anEntry.
5617 @leave KErrNotFound, if no suitable object pointer can be found.
5620 inline void RPointerArray<T>::FindInAddressOrderL(const T* anEntry, TInt& anIndex) const
5621 { User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
5625 Finds the object pointer in the array whose object matches the specified
5626 object, using a binary search technique and an ordering algorithm.
5628 The function assumes that existing object pointers in the array are ordered
5629 so that the objects themselves are in object order as determined by an
5630 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
5632 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5634 @param anEntry The object pointer to be found.
5635 @param anIndex A TInt supplied by the caller. On return, contains an
5637 If the function does not leave, this is the index of the
5638 matching object pointer within the array.
5639 If the function leaves with KErrNotFound, this is the index of
5640 the first object pointer in the array whose object is bigger
5641 than the entry being searched for - if no objects pointed to in
5642 the array are bigger, then the index value is the same as the
5643 total number of object pointers in the array.
5645 @param anOrder A package encapsulating the function which determines the order
5646 of two class T objects.
5648 @leave KErrNotFound, if no suitable object pointer can be found.
5651 inline void RPointerArray<T>::FindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
5652 { User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder)); }
5656 Finds the object pointer in the array that matches the specified object
5657 pointer, using a binary search technique.
5659 Where there is more than one matching element, it finds the first, the last
5660 or any matching element as specified by the value of aMode.
5662 The function assumes that object pointers in the array are in address order.
5664 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5666 @param anEntry The object pointer to be found.
5667 @param aMode Specifies whether to find the first match, the last match or
5668 any match, as defined by one of the TArrayFindMode enum values.
5670 @return If there is a matching element, the array index of a matching element - what
5671 the index refers to depends on the value of aMode:
5672 if this is EArrayFindMode_First, then the index refers to the first matching element;
5673 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5674 if this is EArrayFindMode_Last, then the index refers to first element that follows the
5675 last matching element - if the last matching element is also the last element of the array,
5676 then the index value is the same as the total number of elements in the array.
5678 @leave KErrNotFound if no matching entry exists.
5683 inline TInt RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt aMode) const
5684 { return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
5688 Finds the object pointer in the array whose object matches the specified
5689 object, using a binary search technique and an ordering algorithm.
5691 In the case that there is more than one matching element finds the first, last
5692 or any match as specified by the value of aMode.
5694 The function assumes that existing object pointers in the array are ordered
5695 so that the objects themselves are in object order as determined by an algorithm
5696 supplied by the caller and packaged as a TLinearOrder<T> type.
5698 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5700 @param anEntry The object pointer to be found.
5701 @param anOrder A package encapsulating the function which determines the order
5702 of two class T objects.
5703 @param aMode Specifies whether to find the first match, the last match or any match,
5704 as defined by one of the TArrayFindMode enum values.
5706 @return If there is a matching element, the array index of a matching
5707 element - what the index refers to depends on the value of aMode:
5708 if this is EArrayFindMode_First, then the index refers to the first matching element;
5709 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5710 if this is EArrayFindMode_Last, then the index refers to first element that follows
5711 the last matching element - if the last matching element is also the last element of the array, then
5712 the index value is the same as the total number of elements in the array.
5714 @leave KErrNotFound if no matching entry exists.
5719 inline TInt RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TLinearOrder<T> anOrder, TInt aMode) const
5720 { return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
5724 Finds the object pointer in the array that matches the specified object
5725 pointer, using a binary search technique.
5727 Where there is more than one matching element, it finds the first, the last or
5728 any matching element as specified by the value of aMode.
5730 The function assumes that object pointers in the array are in address order.
5732 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5734 @param anEntry The object pointer to be found.
5735 @param anIndex A TInt type supplied by the caller. On return, it contains an index
5736 value depending on whether a match is found and on the value of aMode.
5737 If there is no matching element in the array, then this is the index
5738 of the first element in the array that is bigger than the element being
5739 searched for - if no elements in the array are bigger, then the index
5740 value is the same as the total number of elements in the array.
5741 If there is a matching element, then what the index refers to depends
5742 on the value of aMode:
5743 if this is EArrayFindMode_First, then the index refers to the first matching element;
5744 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5745 if this is EArrayFindMode_Last, then the index refers to first element that follows
5746 the last matching element - if the last matching element is also the last element
5747 of the array, then the index value is the same as the total number of elements in the array.
5749 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
5750 one of the TArrayFindMode enum values.
5752 @leave KErrNotFound, if no suitable object pointer can be found.
5757 inline void RPointerArray<T>::SpecificFindInAddressOrderL(const T* anEntry, TInt& anIndex, TInt aMode) const
5758 { User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
5762 Finds the object pointer in the array whose object matches the specified
5763 object, using a binary search technique and an ordering algorithm.
5765 Where there is more than one matching element, it finds the first, the last or any
5766 matching element as specified by the value of aMode.
5768 The function assumes that existing object pointers in the array are ordered
5769 so that the objects themselves are in object order as determined by an
5770 algorithm supplied by the caller and packaged as a TLinearOrder<T>.
5772 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5774 @param anEntry The object pointer to be found.
5775 @param anIndex A TInt type supplied by the caller. On return, it contains an index
5776 value depending on whether a match is found and on the value of aMode.
5777 If there is no matching element in the array, then this is
5778 the index of the first element in the array that is bigger than
5779 the element being searched for - if no elements in the array are bigger,
5780 then the index value is the same as the total number of elements in the array.
5781 If there is a matching element, then what the index refers to depends
5782 on the value of aMode:
5783 if this is EArrayFindMode_First, then the index refers to the first matching element;
5784 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
5785 if this is EArrayFindMode_Last, then the index refers to first element that follows
5786 the last matching element - if the last matching element is also the last element of
5787 the array, then the index value is the same as the total number of elements in the array.
5789 @param anOrder A package encapsulating the function which determines the order
5790 of two class T objects.
5791 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
5792 one of the TArrayFindModeenum values.
5794 @leave KErrNotFound, if no suitable object pointer can be found.
5799 inline void RPointerArray<T>::SpecificFindInOrderL(const T* anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
5800 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode)); }
5804 Inserts an object pointer into the array in address order.
5806 No duplicate entries are permitted.
5807 The function assumes that existing object pointers within the array are in
5810 The function leaves with one of the system wide error codes, if the operation fails.
5812 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5814 @param anEntry The object pointer to be inserted.
5817 inline void RPointerArray<T>::InsertInAddressOrderL(const T* anEntry)
5818 { User::LeaveIfError(InsertInAddressOrder(anEntry)); }
5822 Inserts an object pointer into the array so that the object itself is in object
5825 The algorithm for determining the order of two class T objects is provided
5826 by a function supplied by the caller.
5828 No duplicate entries are permitted.
5830 The function assumes that the array is ordered so that the referenced objects
5831 are in object order.
5833 The function leaves with one of the system wide error codes, if the operation fails.
5835 Note that the array remains unchanged following an attempt to insert a duplicate
5838 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5840 @param anEntry The object pointer to be inserted.
5841 @param anOrder A package encapsulating the function which determines the order
5842 of two class T objects.
5845 inline void RPointerArray<T>::InsertInOrderL(const T* anEntry, TLinearOrder<T> anOrder)
5846 { User::LeaveIfError(InsertInOrder(anEntry, anOrder)); }
5850 Inserts an object pointer into the array in address order, allowing duplicates.
5852 If the new object pointer is a duplicate of an existing object pointer in
5853 the array, then the new pointer is inserted after the existing one. If more
5854 than one duplicate object pointer already exists in the array, then any new
5855 duplicate pointer is inserted after the last one.
5857 The function assumes that existing object pointers within the array are in
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.
5867 inline void RPointerArray<T>::InsertInAddressOrderAllowRepeatsL(const T* anEntry)
5868 { User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
5872 Inserts an object pointer into the array so that the object itself is in object
5873 order, allowing duplicates
5875 The algorithm for determining the order of two class T objects is provided
5876 by a function supplied by the caller.
5878 If the specified object is a duplicate of an existing object, then the new
5879 pointer is inserted after the pointer to the existing object. If more than
5880 one duplicate object already exists, then the new pointer is inserted after
5881 the pointer to the last one.
5883 The function leaves with one of the system wide error codes, if the operation fails.
5885 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5887 @param anEntry The object pointer to be inserted.
5888 @param anOrder A package encapsulating the function which determines the order
5889 of two class T objects.
5892 inline void RPointerArray<T>::InsertInOrderAllowRepeatsL(const T* anEntry, TLinearOrder<T> anOrder)
5893 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder)); }
5898 Reserves space for the specified number of elements.
5900 After a call to this function, the memory allocated to the array is sufficient
5901 to hold the number of object pointers specified. Adding new object pointers to the array
5902 does not result in a re-allocation of memory until the the total number of
5903 pointers exceeds the specified count.
5905 @param aCount The number of object pointers for which space should be reserved
5906 @leave KErrNoMemory If the requested amount of memory could not be allocated
5909 inline void RPointerArray<T>::ReserveL(TInt aCount)
5910 { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
5914 // Specialization for RPointerArray<TAny>
5917 Appends an pointer onto the array.
5919 The function leaves with one of the system wide error codes, if the operation fails.
5921 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5923 @param anEntry The pointer to be appended.
5925 inline void RPointerArray<TAny>::AppendL(const TAny* anEntry)
5926 { User::LeaveIfError(Append(anEntry));}
5930 Inserts an pointer into the array at the specified position.
5932 The function leaves with one of the system wide error codes, if
5933 the operation fails.
5935 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5937 @param anEntry The pointer to be inserted.
5938 @param aPos The position within the array where the pointer is to be
5939 inserted. The position is relative to zero, i.e. zero implies
5940 that a pointer is inserted at the beginning of the array.
5942 @panic USER 131, if aPos is negative, or is greater than the number of object
5943 pointers currently in the array.
5945 inline void RPointerArray<TAny>::InsertL(const TAny* anEntry, TInt aPos)
5946 { User::LeaveIfError(Insert(anEntry,aPos)); }
5950 Finds the first pointer in the array which matches the specified pointer, using
5951 a sequential search.
5953 Matching is based on the comparison of pointers.
5955 The find operation always starts at the low index end of the array. There
5956 is no assumption about the order of objects in the array.
5958 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5960 @param anEntry The pointer to be found.
5961 @return The index of the first matching pointer within the array.
5962 @leave KErrNotFound, if no matching pointer can be found.
5964 inline TInt RPointerArray<TAny>::FindL(const TAny* anEntry) const
5965 { return User::LeaveIfError(Find(anEntry));}
5969 Finds the last pointer in the array which matches the specified pointer, using
5970 a sequential search.
5972 Matching is based on the comparison of pointers.
5974 The find operation always starts at the high index end of the array. There
5975 is no assumption about the order of objects in the array.
5977 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5979 @param anEntry The pointer to be found.
5980 @return The index of the last matching pointer within the array.
5981 @leave KErrNotFound, if no matching pointer can be found.
5983 inline TInt RPointerArray<TAny>::FindReverseL(const TAny* anEntry) const
5984 { return User::LeaveIfError(FindReverse(anEntry));}
5988 Finds the pointer in the array that matches the specified pointer, using a
5989 binary search technique.
5991 The function assumes that pointers in the array are in address order.
5993 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
5995 @param anEntry The pointer to be found.
5997 @return The index of the matching pointer within the array
5998 @leave KErrNotFound, if no suitable pointer can be found.
6000 inline TInt RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry) const
6001 { return User::LeaveIfError(FindInAddressOrder(anEntry));}
6005 Finds the pointer in the array that matches the specified pointer, using a
6006 binary search technique.
6008 The function assumes that pointers in the array are in address order.
6010 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6012 @param anEntry The pointer to be found.
6013 @param anIndex A reference to a TInt into which the
6014 function puts an index value: If the function does not leave,
6015 this is the index of the matching pointer within the array. If the
6016 function leaves with KErrNotFound, this is the index of the last
6017 pointer within the array which logically precedes
6020 @leave KErrNotFound, if no suitable pointer can be found.
6022 inline void RPointerArray<TAny>::FindInAddressOrderL(const TAny* anEntry, TInt& anIndex) const
6023 { User::LeaveIfError(FindInAddressOrder(anEntry, anIndex)); }
6027 Finds the pointer in the array that matches the specified pointer, using a
6028 binary search technique.
6030 Where there is more than one matching element, it finds the first, the last
6031 or any matching element as specified by the value of aMode.
6033 The function assumes that pointers in the array are in address order.
6035 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6037 @param anEntry The pointer to be found.
6038 @param aMode Specifies whether to find the first match, the last match or
6039 any match, as defined by one of the TArrayFindMode enum values.
6041 @return If there is a matching element, the array index of a matching element - what
6042 the index refers to depends on the value of aMode:
6043 if this is EArrayFindMode_First, then the index refers to the first matching element;
6044 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6045 if this is EArrayFindMode_Last, then the index refers to first element that follows the
6046 last matching element - if the last matching element is also the last element of the array,
6047 then the index value is the same as the total number of elements in the array.
6049 @leave KErrNotFound if no matching entry exists.
6053 inline TInt RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt aMode) const
6054 { return User::LeaveIfError(SpecificFindInAddressOrder(anEntry, aMode));}
6058 Finds the pointer in the array that matches the specified pointer, using a
6059 binary search technique.
6061 Where there is more than one matching element, it finds the first, the last or
6062 any matching element as specified by the value of aMode.
6064 The function assumes that pointers in the array are in address order.
6066 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6068 @param anEntry The pointer to be found.
6069 @param anIndex A TInt type supplied by the caller. On return, it contains an index
6070 value depending on whether a match is found and on the value of aMode.
6071 If there is no matching element in the array, then this is the index
6072 of the first element in the array that is bigger than the element being
6073 searched for - if no elements in the array are bigger, then the index
6074 value is the same as the total number of elements in the array.
6075 If there is a matching element, then what the index refers to depends
6076 on the value of aMode:
6077 if this is EArrayFindMode_First, then the index refers to the first matching element;
6078 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6079 if this is EArrayFindMode_Last, then the index refers to first element that follows
6080 the last matching element - if the last matching element is also the last element
6081 of the array, then the index value is the same as the total number of elements in the array.
6083 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
6084 one of the TArrayFindMode enum values.
6086 @leave KErrNotFound, if no suitable pointer can be found.
6090 inline void RPointerArray<TAny>::SpecificFindInAddressOrderL(const TAny* anEntry, TInt& anIndex, TInt aMode) const
6091 { User::LeaveIfError(SpecificFindInAddressOrder(anEntry, anIndex, aMode)); }
6095 Inserts an pointer into the array in address order.
6097 No duplicate entries are permitted. The function assumes that existing pointers
6098 within the array are in address order.
6100 The function leaves with one of the system wide error codes, if the operation fails.
6102 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6104 @param anEntry The pointer to be inserted.
6106 inline void RPointerArray<TAny>::InsertInAddressOrderL(const TAny* anEntry)
6107 { User::LeaveIfError(InsertInAddressOrder(anEntry)); }
6111 Inserts an pointer into the array in address order, allowing duplicates.
6113 If the new pointer is a duplicate of an existing pointer in the array, then the
6114 new pointer is inserted after the existing one. If more than one duplicate
6115 pointer already exists in the array, then any new duplicate pointer is inserted
6118 The function assumes that existing pointers within the array are in address
6121 The function leaves with one of the system wide error codes, if the operation fails.
6123 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6125 @param anEntry The pointer to be inserted.
6127 inline void RPointerArray<TAny>::InsertInAddressOrderAllowRepeatsL(const TAny* anEntry)
6128 { User::LeaveIfError(InsertInAddressOrderAllowRepeats(anEntry)); }
6132 Apends an object onto the array.
6134 The function leaves with one of the system wide error codes, if the operation fails.
6136 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6138 @param anEntry A reference to the object of type class T to be appended.
6141 inline void RArray<T>::AppendL(const T& anEntry)
6142 { User::LeaveIfError(Append(anEntry));}
6146 Inserts an object into the array at a specified position.
6148 The function leaves with one of the system wide error codes, if the operation fails.
6150 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6152 @param anEntry The class T object to be inserted.
6153 @param aPos The position within the array where the object is to
6154 be inserted. The position is relative to zero, i.e. zero
6155 implies that an object is inserted at the beginning of
6158 @panic USER 131, if aPos is negative or is greater than the number of objects
6159 currently in the array.
6162 inline void RArray<T>::InsertL(const T& anEntry, TInt aPos)
6163 { User::LeaveIfError(Insert(anEntry, aPos));}
6167 Finds the first object in the array which matches the specified object using
6168 a sequential search.
6170 Matching is based on the comparison of a TInt value at the key offset position
6173 For classes which define their own equality operator (==), the alternative method
6174 FindL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
6176 The find operation always starts at the low index end of the array. There
6177 is no assumption about the order of objects in the array.
6179 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6181 @param anEntry A reference to an object of type class T to be used for matching.
6183 @return The index of the first matching object within the array.
6184 @leave KErrNotFound, if no matching object can be found.
6187 inline TInt RArray<T>::FindL(const T& anEntry) const
6188 { return User::LeaveIfError(Find(anEntry));}
6192 Finds the first object in the array which matches the specified object using
6193 a sequential search and a matching algorithm.
6195 The algorithm for determining whether two class T type objects match is provided
6196 by a function supplied by the caller.
6198 Such a function need not be supplied if an equality operator (==) is defined for class T.
6199 In this case, default construction of anIdentity provides matching.
6201 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
6203 The find operation always starts at the low index end of the array. There
6204 is no assumption about the order of objects in the array.
6206 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6208 @param anEntry A reference to an object of type class T to be used
6210 @param anIdentity A package encapsulating the function which determines whether
6211 two class T type objects match.
6213 @return The index of the first matching object within the array.
6214 @leave KErrNotFound, if no matching object can be found.
6217 inline TInt RArray<T>::FindL(const T& anEntry, TIdentityRelation<T> anIdentity) const
6218 { return User::LeaveIfError(Find(anEntry, anIdentity));}
6222 Finds the last object in the array which matches the specified object using
6223 a sequential search.
6225 Matching is based on the comparison of a TInt value at the key offset position
6228 For classes which define their own equality operator (==), the alternative method
6229 FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) is recommended.
6231 The find operation always starts at the high index end of the array. There
6232 is no assumption about the order of objects in the array.
6234 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6236 @param anEntry A reference to an object of type class T to be used for matching.
6238 @return The index of the last matching object within the array.
6239 @leave KErrNotFound, if no matching object can be found.
6242 inline TInt RArray<T>::FindReverseL(const T& anEntry) const
6243 { return User::LeaveIfError(FindReverse(anEntry));}
6247 Finds the last object in the array which matches the specified object using
6248 a sequential search and a matching algorithm.
6250 The algorithm for determining whether two class T type objects match is provided
6251 by a function supplied by the caller.
6253 Such a function need not be supplied if an equality operator (==) is defined for class T.
6254 In this case, default construction of anIdentity provides matching.
6256 See Find(const T& anEntry, TIdentityRelation<T> anIdentity) for more details.
6258 The find operation always starts at the high index end of the array. There
6259 is no assumption about the order of objects in the array.
6261 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6263 @param anEntry A reference to an object of type class T to be used
6265 @param anIdentity A package encapsulating the function which determines whether
6266 two class T type objects match.
6268 @return The index of the last matching object within the array.
6269 @leave KErrNotFound, if no matching object can be found.
6272 inline TInt RArray<T>::FindReverseL(const T& anEntry, TIdentityRelation<T> anIdentity) const
6273 { return User::LeaveIfError(FindReverse(anEntry, anIdentity));}
6277 Finds the object in the array which matches the specified object using a binary
6280 The function assumes that existing objects within the array are in signed
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.
6287 @return The index of the matching object within the array.
6288 @leave KErrNotFound, if no matching object can be found.
6291 inline TInt RArray<T>::FindInSignedKeyOrderL(const T& anEntry) const
6292 { return User::LeaveIfError(FindInSignedKeyOrder(anEntry));}
6296 Finds the object in the array which matches the specified object using a binary
6299 The function assumes that existing objects within the array are in unsigned
6302 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6304 @param anEntry A reference to an object of type class T to be used for matching.
6306 @return The index of the matching object within the array.
6307 @leave KErrNotFound, if no matching object can be found.
6310 inline TInt RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry) const
6311 { return User::LeaveIfError(FindInUnsignedKeyOrder(anEntry));}
6315 Finds the object in the array which matches the specified object using a binary
6316 search technique and an ordering algorithm.
6318 The function assumes that existing objects within the array are in object
6319 order as determined by an algorithm supplied by the caller and packaged as
6322 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6324 @param anEntry A reference to an object of type class T to be used for matching.
6325 @param anOrder A package encapsulating the function which determines the order
6326 of two class T objects.
6328 @return The index of the matching object within the array.
6329 @leave KErrNotFound if no matching object can be found.
6332 inline TInt RArray<T>::FindInOrderL(const T& anEntry, TLinearOrder<T> anOrder) const
6333 { return User::LeaveIfError(FindInOrder(anEntry, anOrder));}
6337 Finds the object in the array which matches the specified object using a binary
6340 The function assumes that existing objects within the array are in signed
6343 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6345 @param anEntry A reference to an object of type class T to be used for matching.
6346 @param anIndex On return contains an index value of the matching object within the array.
6347 If the function leaves with KErrNotFound,this is the index of the
6348 first element in the array whose key is bigger than the key of the
6349 element being sought. If there are no elements in the array with
6350 a bigger key, then the index value is the same as the total
6351 number of elements in the array.
6352 @leave KErrNotFound, if no matching object can be found.
6355 inline void RArray<T>::FindInSignedKeyOrderL(const T& anEntry, TInt& anIndex) const
6356 { User::LeaveIfError(FindInSignedKeyOrder(anEntry, anIndex));}
6360 Finds the object in the array which matches the specified object using a binary
6363 The function assumes that existing objects within the array are in unsigned
6366 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6368 @param anEntry A reference to an object of type class T to be used for matching.
6369 @param anIndex On return contains an index value of the matching object within the array.
6370 If the function leaves with KErrNotFound, this is the index of the
6371 first element in the array whose key is bigger than the key of the
6372 element being sought. If there are no elements in the array with
6373 a bigger key, then the index value is the same as the total
6374 number of elements in the array.
6375 @leave KErrNotFound, if no matching object can be found.
6378 inline void RArray<T>::FindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex) const
6379 { User::LeaveIfError(FindInUnsignedKeyOrder(anEntry, anIndex));}
6383 Finds the object in the array which matches the specified object using a binary
6384 search technique and an ordering algorithm.
6386 The function assumes that existing objects within the array are in object
6387 order as determined by an algorithm supplied by the caller and packaged as
6390 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6392 @param anEntry A reference to an object of type class T to be used for matching.
6393 @param anIndex On return contains the index value of the matching object within the array
6394 If the function leaves with KErrNotFound, this is the index of
6395 the first element in the array that is bigger than the element
6396 being searched for - if no elements in the array are bigger,
6397 then the index value is the same as the total number of elements
6399 @param anOrder A package encapsulating the function which determines the order
6400 of two class T objects.
6402 @leave KErrNotFound if no matching object can be found.
6405 inline void RArray<T>::FindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder) const
6406 { User::LeaveIfError(FindInOrder(anEntry, anIndex, anOrder));}
6410 Finds the object in the array which matches the specified object using a binary
6413 The element ordering is determined by a signed 32-bit word
6414 (the key) embedded in each array element. In the case that there is more than
6415 one matching element, finds the first, last or any match as specified.
6417 The function assumes that existing objects within the array are in signed
6420 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6422 @param anEntry A reference to an object of type class T to be used for matching.
6423 @param aMode Specifies whether to find the first match, the last match or
6424 any match, as defined by one of the TArrayFindMode enum values.
6426 @return The array index of a matching element - what the index refers to
6427 depends on the value of aMode:
6428 if this is EArrayFindMode_First, then the index refers to the first matching element;
6429 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6430 if this is EArrayFindMode_Last, then the index refers to first element that follows
6431 the last matching element - if the last matching element is also the last element of
6432 the array, then the index value is the same as the total number of elements in the array.
6433 @leave KErrNotFound if no matching entry exists.
6438 inline TInt RArray<T>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt aMode) const
6439 { return User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, aMode));}
6443 Finds the object in the array which matches the specified object using a binary
6446 The element ordering is determined by an unsigned 32-bit word
6447 (the key) embedded in each array element. In the case that there is more than
6448 one matching element, finds the first, last or any match as specified.
6450 The function assumes that existing objects within the array are in unsigned
6453 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6455 @param anEntry A reference to an object of type class T to be used for matching.
6456 @param aMode Specifies whether to find the first match, the last match or any
6457 match, as defined by one of the TArrayFindMode enum values.
6459 @return The array index of a matching element - what the index refers to
6460 depends on the value of aMode:
6461 if this is EArrayFindMode_First, then the index refers to the first matching element;
6462 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6463 if this is EArrayFindMode_Last, then the index refers to first element that follows
6464 the last matching element - if the last matching element is also the last element
6465 of the array, then the index value is the same as the total number of elements in the array.
6467 @leave KErrNotFound if no matching entry exists.
6472 inline TInt RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt aMode) const
6473 { return User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, aMode));}
6477 Finds the object in the array which matches the specified object using a binary
6478 search technique and an ordering algorithm.
6480 Where there is more than one matching element, it finds the first, the last or
6481 any matching element as specified by the value of aMode.
6483 The function assumes that existing objects within the array are in object
6484 order as determined by an algorithm supplied by the caller and packaged as
6485 a TLinearOrder<T> type.
6487 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6489 @param anEntry A reference to an object of type class T to be used for matching.
6490 @param anOrder A package encapsulating the function which determines the order
6491 of two class T objects.
6492 @param aMode Specifies whether to find the first match, the last match or any match,
6493 as defined by one of the TArrayFindMode enum values.
6495 @return The array index of a matching element - what the index refers to
6496 depends on the value of aMode:
6497 if this is EArrayFindMode_First, then the index refers to the first matching element;
6498 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6499 if this is EArrayFindMode_Last, then the index refers to first element that follows
6500 the last matching element - if the last matching element is also the last element
6501 of the array, then the index value is the same as the total number of elements in the array.
6503 @leave KErrNotFound if no matching entry exists.
6508 inline TInt RArray<T>::SpecificFindInOrderL(const T& anEntry, TLinearOrder<T> anOrder, TInt aMode) const
6509 { return User::LeaveIfError(SpecificFindInOrder(anEntry, anOrder, aMode));}
6513 Finds the object in the array which matches the specified object using a binary
6516 The element ordering is determined by a signed 32-bit word
6517 (the key) embedded in each array element. In the case that there is more than
6518 one matching element, finds the first, last or any match as specified.
6520 The function assumes that existing objects within the array are in signed
6523 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6525 @param anEntry A reference to an object of type class T to be used for matching.
6526 @param anIndex A TInt type supplied by the caller. On return, it contains an
6527 index value depending on whether a match is found and on the
6528 value of aMode. If there is no matching element in the array,
6529 then this is the index of the first element in the array that
6530 is bigger than the element being searched for - if no elements
6531 in the array are bigger, then the index value is the same as
6532 the total number of elements in the array.
6533 If there is a matching element, then what the index refers to
6534 depends on the value of aMode:
6535 if this is EArrayFindMode_First, then the index refers to the first matching element;
6536 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6537 if this is EArrayFindMode_Last, then the index refers to first element that follows
6538 the last matching element - if the last matching element is also the last element
6539 of the array, then the index value is the same as the total number of elements
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>::SpecificFindInSignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
6550 { User::LeaveIfError(SpecificFindInSignedKeyOrder(anEntry, anIndex, aMode));}
6554 Finds the object in the array which matches the specified object using a binary
6557 The element ordering is determined by an unsigned 32-bit word
6558 (the key) embedded in each array element. In the case that there is more than
6559 one matching element, finds the first, last or any match as specified.
6561 The function assumes that existing objects within the array are in unsigned
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
6569 value of aMode. If there is no matching element in the array,
6570 then this is the index of the first element in the array that
6571 is bigger than the element being searched for - if no elements
6572 in the array are bigger, then the index value is the same as
6573 the total number of elements in the array. If there is a matching
6574 element, then what the index refers to depends on the value of aMode:
6575 if this is EArrayFindMode_First, then the index refers to the first matching element;
6576 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6577 if this is EArrayFindMode_Last, then the index refers to first element that follows
6578 the last matching element - if the last matching element is also the last element
6579 of the array, then the index value is the same as the total number of elements in the array.
6580 @param aMode Specifies whether to find the first match, the last match or any match,
6581 as defined by one of the TArrayFindMode enum values.
6583 @leave KErrNotFound if no matching entry exists.
6588 inline void RArray<T>::SpecificFindInUnsignedKeyOrderL(const T& anEntry, TInt& anIndex, TInt aMode) const
6589 { User::LeaveIfError(SpecificFindInUnsignedKeyOrder(anEntry, anIndex, aMode));}
6593 Finds the object in the array which matches the specified object using a binary
6594 search technique and a specified ordering algorithm.
6596 Where there is more than one matching element, it finds the first, the last or
6597 any matching element as specified by the value of aMode.
6599 The function assumes that existing objects within the array are in object
6600 order as determined by an algorithm supplied by the caller and packaged as
6601 a TLinearOrder<T> type.
6603 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6605 @param anEntry A reference to an object of type class T to be used for matching.
6606 @param anIndex A TInt type supplied by the caller. On return, it contains an
6607 index value depending on whether a match is found and on the value
6608 of aMode. If there is no matching element in the array, then this is
6609 the index of the first element in the array that is bigger than the
6610 element being searched for - if no elements in the array are bigger,
6611 then the index value is the same as the total number of elements
6612 in the array. If there is a matching element, then what the index
6613 refers to depends on the value of aMode:
6614 if this is EArrayFindMode_First, then the index refers to the first matching element;
6615 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6616 if this is EArrayFindMode_Last, then the index refers to first element that follows
6617 the last matching element - if the last matching element is also the last element
6618 of the array, then the index value is the same as the total number of elements in the array.
6620 @param anOrder A package encapsulating the function which determines the order
6621 of two class T objects.
6622 @param aMode Specifies whether to find the first match, the last match or any match,
6623 as defined by one of the TArrayFindMode enum values.
6625 @leave KErrNotFound if no matching entry exists.
6630 inline void RArray<T>::SpecificFindInOrderL(const T& anEntry, TInt& anIndex, TLinearOrder<T> anOrder, TInt aMode) const
6631 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, anOrder, aMode));}
6635 Inserts an object into the array in ascending signed key order.
6637 The order of two class T type objects is based on comparing a TInt value
6638 located at the key offset position within the class T object.
6640 No duplicate entries are permitted.
6642 The function leaves with one of the system wide error codes, if the operation fails.
6644 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6646 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6648 @param anEntry A reference to the object of type class T to be inserted.
6651 inline void RArray<T>::InsertInSignedKeyOrderL(const T& anEntry)
6652 { User::LeaveIfError(InsertInSignedKeyOrder(anEntry));}
6656 Inserts an object into the array in ascending unsigned key order, not allowing
6659 The order of two class T type objects is based on comparing a TUint value
6660 located at the key offset position within the class T object.
6662 The function leaves with one of the system wide error codes, if the operation fails.
6664 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6666 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6668 @param anEntry A reference to the object of type class T to be inserted.
6671 inline void RArray<T>::InsertInUnsignedKeyOrderL(const T& anEntry)
6672 { User::LeaveIfError(InsertInUnsignedKeyOrder(anEntry));}
6676 Inserts an object of into the array in object order.
6678 The algorithm for determining the order of two class T type objects is provided
6679 by a function supplied by the caller.
6681 No duplicate entries are permitted.
6683 The function assumes that existing objects within the array are in object
6686 The function leaves with one of the system wide error codes, if the operation fails.
6688 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6690 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6692 @param anEntry A reference to the object of type class T to be inserted.
6693 @param anOrder A package encapsulating the function which determines the order
6694 of two class T objects.
6697 inline void RArray<T>::InsertInOrderL(const T& anEntry, TLinearOrder<T> anOrder)
6698 { User::LeaveIfError(InsertInOrder(anEntry, anOrder));}
6702 Inserts an object into the array in ascending signed key order,
6703 allowing duplicates.
6705 The order of two class T type objects is based on comparing a TInt value
6706 located at the key offset position within the class T object.
6708 If anEntry is a duplicate of an existing object in the array, then the new
6709 object is inserted after the existing object. If more than one duplicate object
6710 already exists in the array, then any new duplicate object is inserted after
6713 The function leaves with one of the system wide error codes, if the operation fails.
6715 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6717 @param anEntry A reference to the object of type class T to be inserted.
6720 inline void RArray<T>::InsertInSignedKeyOrderAllowRepeatsL(const T& anEntry)
6721 { User::LeaveIfError(InsertInSignedKeyOrderAllowRepeats(anEntry));}
6725 Inserts an object into the array in ascending unsigned key order, allowing
6728 The order of two class T type objects is based on comparing a TUint value
6729 located at the key offset position within the class T object.
6731 If anEntry is a duplicate of an existing object in the array, then the new
6732 object is inserted after the existing object. If more than one duplicate object
6733 already exists in the array, then any new duplicate object is inserted after
6736 The function leaves with one of the system wide error codes, if the operation fails.
6738 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6740 @param anEntry A reference to the object of type class T to be inserted.
6743 inline void RArray<T>::InsertInUnsignedKeyOrderAllowRepeatsL(const T& anEntry)
6744 { User::LeaveIfError(InsertInUnsignedKeyOrderAllowRepeats(anEntry));}
6748 Inserts an object into the array in object order, allowing duplicates.
6750 The algorithm for determining the order of two class T type objects is provided
6751 by a function supplied by the caller.
6753 If anEntry is a duplicate of an existing object in the array, then the new
6754 object is inserted after the existing object. If more than one duplicate object
6755 already exists in the array, then anEntry is inserted after the last one.
6757 The function assumes that existing objects within the array are in object
6760 The function leaves with one of the system wide error codes, if the operation fails.
6762 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6764 @param anEntry A reference to the object of type class T to be inserted.
6765 @param anOrder A package encapsulating the function which determines the order
6766 of two class T objects.
6769 inline void RArray<T>::InsertInOrderAllowRepeatsL(const T& anEntry, TLinearOrder<T> anOrder)
6770 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry, anOrder));}
6775 Reserves space for the specified number of elements.
6777 After a call to this function, the memory allocated to the array is sufficient
6778 to hold the number of objects specified. Adding new objects to the array
6779 does not result in a re-allocation of memory until the the total number of
6780 objects exceeds the specified count.
6782 @param aCount The number of objects for which space should be reserved
6783 @leave KErrNoMemory If the requested amount of memory could not be allocated
6786 inline void RArray<T>::ReserveL(TInt aCount)
6787 { User::LeaveIfError(RArrayBase::DoReserve(aCount)); }
6793 Appends a signed integer onto the array.
6795 The function leaves with one of the system wide error codes, if the operation fails.
6797 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6799 @param anEntry The signed integer to be appended.
6801 inline void RArray<TInt>::AppendL(TInt anEntry)
6802 { User::LeaveIfError(Append(anEntry));}
6806 Inserts a signed integer into the array at the specified position.
6808 The function leaves with one of the system wide error codes, if the operation fails.
6810 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6812 @param anEntry The signed integer to be inserted.
6813 @param aPos The position within the array where the signed integer is to be
6814 inserted. The position is relative to zero, i.e. zero implies
6815 that an entry is inserted at the beginning of the array.
6817 @panic USER 131, if aPos is negative, or is greater than the number of entries
6818 currently in the array.
6820 inline void RArray<TInt>::InsertL(TInt anEntry, TInt aPos)
6821 { User::LeaveIfError(Insert(anEntry, aPos));}
6825 Finds the first signed integer in the array which matches the specified signed
6826 integer using a sequential search.
6828 The find operation always starts at the low index end of the array. There
6829 is no assumption about the order of entries in the array.
6831 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6833 @param anEntry The signed integer to be found.
6835 @return The index of the first matching signed integer within the array.
6836 @leave KErrNotFound, if no matching entry can be found.
6838 inline TInt RArray<TInt>::FindL(TInt anEntry) const
6839 { return User::LeaveIfError(Find(anEntry));}
6843 Finds the last signed integer in the array which matches the specified signed
6844 integer using a sequential search.
6846 The find operation always starts at the high index end of the array. There
6847 is no assumption about the order of entries in the array.
6849 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6851 @param anEntry The signed integer to be found.
6853 @return The index of the last matching signed integer within the array.
6854 @leave KErrNotFound, if no matching entry can be found.
6856 inline TInt RArray<TInt>::FindReverseL(TInt anEntry) const
6857 { return User::LeaveIfError(FindReverse(anEntry));}
6861 Finds the signed integer in the array that matches the specified signed integer
6862 using a binary search technique.
6864 The function assumes that the array is in signed integer order.
6866 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6868 @param anEntry The signed integer to be found.
6870 @return The index of the matching signed integer within the array.
6871 @leave KErrNotFound, if no match can be found.
6873 inline TInt RArray<TInt>::FindInOrderL(TInt anEntry) const
6874 { return User::LeaveIfError(FindInOrder(anEntry));}
6878 Finds the signed integer in the array that matches the specified signed integer
6879 using a binary search technique.
6881 The function assumes that the array is in signed integer order.
6883 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6885 @param anEntry The signed integer to be found.
6886 @param anIndex A reference to a signed integer into which the
6887 function puts an index value: If the function returns ,
6888 this is the index of the matching signed integer within the
6889 array. If the function leaves with KErrNotFound, this is the
6890 index of the first signed integer within the array that is
6891 bigger than the signed integer being searched for - if no
6892 signed integers within the array are bigger, then the index
6893 value is the same as the total number of signed integers
6895 @leave KErrNotFound if no match can be found.
6897 inline void RArray<TInt>::FindInOrderL(TInt anEntry, TInt& anIndex) const
6898 { User::LeaveIfError(FindInOrder(anEntry, anIndex));}
6902 Finds the signed integer in the array that matches the specified signed integer
6903 using a binary search technique.
6905 Where there is more than one matching element, it finds the first, last or any
6906 matching element as specified by the value of aMode.
6908 The function assumes that the array is in signed integer order.
6910 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6912 @param anEntry The signed integer to be found.
6913 @param aMode Specifies whether to find the first match, the last match or
6914 any match, as defined by one of the TArrayFindMode enum values.
6916 @return The array index of a matching element - what the index refers to
6917 depends on the value of aMode:
6918 if this is EArrayFindMode_First, then the index refers to the first matching element;
6919 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6920 if this is EArrayFindMode_Last, then the index refers to first element that follows
6921 the last matching element - if the last matching element is also the last element
6922 of the array, then the index value is the same as the total number of elements in the array.
6924 @leave KErrNotFound if no matching entry exists.
6928 inline TInt RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt aMode) const
6929 { return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
6933 Finds the signed integer in the array that matches the specified signed integer
6934 using a binary search technique.
6936 Where there is more than one matching element, it finds the first, last or any
6937 matching element as specified by the value of aMode.
6939 The function assumes that the array is in signed integer order.
6941 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6943 @param anEntry The signed integer to be found.
6944 @param anIndex A TInt type supplied by the caller. On return, it contains an
6945 index value depending on whether a match is found and on the value of aMode.
6946 If there is no matching element in the array, then this is
6947 the index of the first element in the array that is bigger
6948 than the element being searched for - if no elements in the
6949 array are bigger, then the index value is the same as the total
6950 number of elements in the array. If there is a matching element,
6951 then what the index refers to depends on the value of aMode:
6952 if this is EArrayFindMode_First, then the index refers to the first matching element;
6953 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
6954 if this is EArrayFindMode_Last, then the index refers to first element that follows
6955 the last matching element - if the last matching element is also the last element
6956 of the array, then the index value is the same as the total number of elements in the array.
6958 @param aMode Specifies whether to find the first match, the last match or any match, as defined
6959 by one of the TArrayFindMode enum values.
6961 @leave KErrNotFound if no matching entry exists.
6965 inline void RArray<TInt>::SpecificFindInOrderL(TInt anEntry, TInt& anIndex, TInt aMode) const
6966 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
6970 Inserts a signed integer into the array in signed integer order.
6972 No duplicate entries are permitted.
6974 The function assumes that existing entries within the array are in signed
6977 The function leaves with one of the system wide error codes, if the operation fails.
6979 Note that the array remains unchanged following an attempt to insert a duplicate entry.
6981 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
6983 @param anEntry The signed integer to be inserted.
6985 inline void RArray<TInt>::InsertInOrderL(TInt anEntry)
6986 { User::LeaveIfError(InsertInOrder(anEntry));}
6990 Inserts a signed integer into the array in signed integer order,
6991 allowing duplicates.
6993 If anEntry is a duplicate of an existing entry in the array, then the new
6994 signed integer is inserted after the existing one. If more than one duplicate
6995 entry already exists in the array, then any new duplicate signed integer is
6996 inserted after the last one.
6998 The function assumes that existing entries within the array are in signed
7001 The function leaves with one of the system wide error codes, if the operation fails.
7003 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7005 @param anEntry The signed integer to be inserted.
7007 inline void RArray<TInt>::InsertInOrderAllowRepeatsL(TInt anEntry)
7008 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
7013 Reserves space for the specified number of elements.
7015 After a call to this function, the memory allocated to the array is sufficient
7016 to hold the number of integers specified. Adding new integers to the array
7017 does not result in a re-allocation of memory until the the total number of
7018 integers exceeds the specified count.
7020 @param aCount The number of integers for which space should be reserved
7021 @leave KErrNoMemory If the requested amount of memory could not be allocated
7023 inline void RArray<TInt>::ReserveL(TInt aCount)
7024 { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
7030 Appends an unsigned integer onto the array.
7032 The function leaves with one of the system wide error codes, if the operation fails.
7034 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7036 @param anEntry The unsigned integer to be appended.
7038 inline void RArray<TUint>::AppendL(TUint anEntry)
7039 { User::LeaveIfError(Append(anEntry));}
7043 Inserts an unsigned integer into the array at the specified position.
7045 The function leaves with one of the system wide error codes, if the operation fails.
7047 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7049 @param anEntry The unsigned integer to be inserted.
7050 @param aPos The position within the array where the unsigned integer is to
7051 be inserted. The position is relative to zero, i.e. zero
7052 implies that an entry is inserted at the beginning of
7055 @panic USER 131, if aPos is negative, or is greater than the number of entries
7056 currently in the array.
7058 inline void RArray<TUint>::InsertL(TUint anEntry, TInt aPos)
7059 { User::LeaveIfError(Insert(anEntry, aPos));}
7063 Finds the first unsigned integer in the array which matches the specified
7064 value, using a sequential search.
7066 The find operation always starts at the low index end of the array. There
7067 is no assumption about the order of entries in the array.
7069 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7071 @param anEntry The unsigned integer to be found.
7072 @return The index of the first matching unsigned integer within the array.
7073 @leave KErrNotFound, if no matching entry can be found.
7075 inline TInt RArray<TUint>::FindL(TUint anEntry) const
7076 { return User::LeaveIfError(Find(anEntry));}
7080 Finds the last unsigned integer in the array which matches the specified
7081 value, using a sequential search.
7083 The find operation always starts at the high index end of the array. There
7084 is no assumption about the order of entries in the array.
7086 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7088 @param anEntry The unsigned integer to be found.
7089 @return The index of the last matching unsigned integer within the array.
7090 @leave KErrNotFound, if no matching entry can be found.
7092 inline TInt RArray<TUint>::FindReverseL(TUint anEntry) const
7093 { return User::LeaveIfError(FindReverse(anEntry));}
7097 Finds the unsigned integer in the array which matches the specified value,
7098 using a binary search technique.
7100 The functions assume that existing entries within the array are in unsigned
7103 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7105 @param anEntry The unsigned integer to be found.
7107 @return The index of the matching unsigned integer within the array;
7108 @leave KErrNotFound, if no matching entry can be found.
7110 inline TInt RArray<TUint>::FindInOrderL(TUint anEntry) const
7111 { return User::LeaveIfError(FindInOrder(anEntry));}
7115 Finds the unsigned integer in the array which matches the specified value,
7116 using a binary search technique.
7118 If the index cannot be found, the function returns the index of the last
7119 unsigned integer within the array which logically precedes anEntry.
7120 The functions assume that existing entries within the array are in unsigned
7123 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7125 @param anEntry The unsigned integer to be found.
7126 @param anIndex A TInt supplied by the caller. On return, contains an index
7127 value of the matching unsigned integer within the array.
7128 If the function leaves with KErrNotFound, this is the index of the
7129 first unsigned integer within the array that is bigger than the
7130 unsigned integer being searched for - if no unsigned integers within
7131 the array are bigger, then the index value is the same as the
7132 total number of unsigned integers within the array.
7134 @leave KErrNotFound, if no matching entry can be found.
7136 inline void RArray<TUint>::FindInOrderL(TUint anEntry, TInt& anIndex) const
7137 { User::LeaveIfError(FindInOrder(anEntry, anIndex));}
7141 Finds the unsigned integer in the array that matches the specified unsigned integer
7142 using a binary search technique.
7144 In the case that there is more than one matching element, finds the first, last or any
7147 The function assumes that the array is in unsigned integer order.
7149 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7151 @param anEntry The unsigned integer to be found.
7152 @param aMode Specifies whether to find the first match, the last match or
7153 any match, as defined by one of the TArrayFindMode enum values.
7155 @return The array index of a matching element - what the index refers to depends
7156 on the value of aMode:
7157 if this is EArrayFindMode_First, then the index refers to the first matching element;
7158 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
7159 if this is EArrayFindMode_Last, then the index refers to first element that follows
7160 the last matching element - if the last matching element is also the last element
7161 of the array, then the index value is the same as the total number of elements in the array.
7163 @leave KErrNotFound if no matching entry exists.
7167 inline TInt RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt aMode) const
7168 { return User::LeaveIfError(SpecificFindInOrder(anEntry, aMode));}
7172 Finds the unsigned integer in the array that matches the specified unsigned integer
7173 using a binary search technique.
7175 Where there is more than one matching element, it finds the first, last or
7176 any matching element as specified by the value of aMode.
7178 The function assumes that the array is in unsigned integer order.
7180 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7182 @param anEntry The unsigned integer to be found.
7183 @param anIndex A TInt type supplied by the caller. On return, it contains an index
7184 value depending on whether a match is found and on the value of aMode.
7185 If there is no matching element in the array, then this is the
7186 index of the first element in the array that is bigger than the element
7187 being searched for - if no elements in the array are bigger, then
7188 the index value is the same as the total number of elements in the array.
7189 If there is a matching element, then what the index refers to depends on
7191 if this is EArrayFindMode_First, then the index refers to the first matching element;
7192 if this is EArrayFindMode_Any, then the index can refer to any of the matching elements;
7193 if this is EArrayFindMode_Last, then the index refers to first element that follows
7194 the last matching element - if the last matching element is also the last element of the array,
7195 then the index value is the same as the total number of elements in the array.
7197 @param aMode Specifies whether to find the first match, the last match or any match, as defined by
7198 one of the TArrayFindMode enum values.
7199 @leave KErrNotFound if no matching entry exists.
7203 inline void RArray<TUint>::SpecificFindInOrderL(TUint anEntry, TInt& anIndex, TInt aMode) const
7204 { User::LeaveIfError(SpecificFindInOrder(anEntry, anIndex, aMode));}
7208 Inserts an unsigned integer into the array in unsigned integer order.
7210 No duplicate entries are permitted.
7212 The function assumes that existing entries within the array are in unsigned
7215 The function leaves with one of the system wide error codes, if the operation fails.
7217 Note that the array remains unchanged following an attempt to insert a duplicate entry.
7219 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7221 @param anEntry The unsigned integer to be inserted.
7223 inline void RArray<TUint>::InsertInOrderL(TUint anEntry)
7224 { User::LeaveIfError(InsertInOrder(anEntry));}
7228 Inserts an unsigned integer into the array in unsigned integer order, allowing
7231 If the new integer is a duplicate of an existing entry in the array, then
7232 the new unsigned integer is inserted after the existing one. If more than
7233 one duplicate entry already exists in the array, then any new duplicate
7234 unsigned integer is inserted after the last one.
7236 The function assumes that existing entries within the array are in unsigned
7239 The function leaves with one of the system wide error codes, if the operation fails.
7241 NOTE: This function is NOT AVAILABLE to code running on the kernel side.
7243 @param anEntry The unsigned integer to be inserted.
7245 inline void RArray<TUint>::InsertInOrderAllowRepeatsL(TUint anEntry)
7246 { User::LeaveIfError(InsertInOrderAllowRepeats(anEntry));}
7251 Reserves space for the specified number of elements.
7253 After a call to this function, the memory allocated to the array is sufficient
7254 to hold the number of integers specified. Adding new integers to the array
7255 does not result in a re-allocation of memory until the the total number of
7256 integers exceeds the specified count.
7258 @param aCount The number of integers for which space should be reserved
7259 @leave KErrNoMemory If the requested amount of memory could not be allocated
7261 inline void RArray<TUint>::ReserveL(TInt aCount)
7262 { User::LeaveIfError(RPointerArrayBase::DoReserve(aCount)); }
7266 // class TChunkHeapCreateInfo
7268 Sets single thread property of the chunk heap.
7270 This overrides any previous call to TChunkHeapCreateInfo::SetSingleThread()
7271 for this TChunkHeapCreateInfo object.
7273 @param aSingleThread ETrue when the chunk heap is to be single threaded,
7276 inline void TChunkHeapCreateInfo::SetSingleThread(const TBool aSingleThread)
7278 iSingleThread = aSingleThread;
7283 Sets alignment of the cells of the chunk heap to be created.
7285 This overrides any previous call to TChunkHeapCreateInfo::SetAlignment()
7286 for this TChunkHeapCreateInfo object.
7288 @param aAlignment The alignment of the heap cells.
7290 inline void TChunkHeapCreateInfo::SetAlignment(TInt aAlign)
7297 Sets the increments to the size of the host chunk. If the supplied value is
7298 less than KMinHeapGrowBy, it is discarded and the value KMinHeapGrowBy is
7301 This overrides any previous call to TChunkHeapCreateInfo::SetGrowBy()
7302 for this TChunkHeapCreateInfo object.
7304 @param aGrowBy The increment to the size of the host chunk.
7306 inline void TChunkHeapCreateInfo::SetGrowBy(TInt aGrowBy)
7313 Sets the offset from the base of the host chunk to the start of the heap.
7315 This overrides any previous call to TChunkHeapCreateInfo::SetOffset()
7316 for this TChunkHeapCreateInfo object.
7318 @param aOffset The offset in bytes.
7320 inline void TChunkHeapCreateInfo::SetOffset(TInt aOffset)
7327 Sets the mode flags of the chunk heap.
7329 This overrides any previous call to TChunkHeapCreateInfo::SetMode()
7330 for this TChunkHeapCreateInfo object.
7332 @param aMode The mode flags for the chunk heap to be created, this should be
7333 one or more of the values from TChunkHeapCreateMode.
7335 inline void TChunkHeapCreateInfo::SetMode(TUint aMode)
7342 Sets the paging attribute of the chunk heap to be created.
7344 This overrides any previous call to TChunkHeapCreateInfo::SetPaging()
7345 for this TChunkHeapCreateInfo object.
7347 @param aPaging The paging attribute for the chunk heap to be created.
7349 inline void TChunkHeapCreateInfo::SetPaging(const TChunkHeapPagingAtt aPaging)
7356 Sets the priority of the client's process.
7358 @param aPriority The priority value.
7360 inline void RMessagePtr2::SetProcessPriorityL(TProcessPriority aPriority) const
7361 { User::LeaveIfError(SetProcessPriority(aPriority));}
7365 Opens a handle on the client thread.
7367 @param aClient On successful return, the handle to the client thread.
7368 @param aOwnerType An enumeration whose enumerators define the ownership of
7369 the handle. If not explicitly specified,
7370 EOwnerProcess is taken as default.
7372 inline void RMessagePtr2::ClientL(RThread& aClient, TOwnerType aOwnerType) const
7373 { User::LeaveIfError(Client(aClient, aOwnerType));}
7376 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
7378 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, const char* aDiagnostic) const
7380 return DoHasCapability(aCapability, aDiagnostic);
7383 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, const char* aDiagnosticMessage) const
7385 if (!HasCapability(aCapability, aDiagnosticMessage))
7387 User::Leave(KErrPermissionDenied);
7391 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
7393 return DoHasCapability(aCapability1, aCapability2, aDiagnostic);
7396 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, const char* aDiagnosticMessage) const
7398 if (!HasCapability(aCapability1, aCapability2, aDiagnosticMessage))
7400 User::Leave(KErrPermissionDenied);
7404 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
7406 // Only available to NULL arguments
7407 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/) const
7409 return DoHasCapability(aCapability);
7412 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnosticMessage*/) const
7414 if (!DoHasCapability(aCapability))
7416 User::Leave(KErrPermissionDenied);
7420 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/) const
7422 return DoHasCapability(aCapability1, aCapability2);
7425 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnosticMessage*/) const
7427 if (!DoHasCapability(aCapability1, aCapability2))
7429 User::Leave(KErrPermissionDenied);
7433 #ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
7434 // For things using KSuppressPlatSecDiagnostic
7435 inline TBool RMessagePtr2::HasCapability(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7437 return DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue);
7440 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7442 if (!DoHasCapability(aCapability, KSuppressPlatSecDiagnosticMagicValue))
7444 User::Leave(KErrPermissionDenied);
7448 inline TBool RMessagePtr2::HasCapability(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7450 return DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue);
7453 inline void RMessagePtr2::HasCapabilityL(TCapability aCapability1, TCapability aCapability2, OnlyCreateWithNull /*aDiagnostic*/, OnlyCreateWithNull /*aSuppress*/) const
7455 if (!DoHasCapability(aCapability1, aCapability2, KSuppressPlatSecDiagnosticMagicValue))
7457 User::Leave(KErrPermissionDenied);
7460 #endif // !__REMOVE_PLATSEC_DIAGNOSTICS__
7462 #endif // !__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
7464 inline TInt RThread::RenameMe(const TDesC& aName)
7465 { return User::RenameThread(aName); }
7466 inline TInt RProcess::RenameMe(const TDesC& aName)
7467 { return User::RenameProcess(aName); }
7470 #endif // !__KERNEL_MODE__
7472 #ifdef __SUPPORT_CPP_EXCEPTIONS__
7473 // The standard header file <exception> defines the following guard macro for EDG and CW, VC++, GCC respectively.
7474 // The guard below is ugly. It will surely come back and bite us unless we resolve the whole issue of standard headers
7475 // when we move to supporting Standard C++.
7477 // The macro __SYMBIAN_STDCPP_SUPPORT__ is defined when building a StdC++ target.
7478 // In this case, we wish to avoid defining uncaught_exception below since it clashes with the StdC++ specification
7479 #if !defined(_EXCEPTION) && !defined(_EXCEPTION_) && !defined(__EXCEPTION__) && !defined(__SYMBIAN_STDCPP_SUPPORT__)
7481 #if defined(__VC32__) && !defined(_CRTIMP_PURE)
7483 // Declare MS EH runtime functions
7484 bool __uncaught_exception(void);
7486 #if _MSC_VER >= 1200
7487 __declspec(noreturn) void terminate(void);
7488 __declspec(noreturn) void unexpected(void);
7490 void terminate(void);
7491 void unexpected(void);
7494 typedef void (*terminate_handler)();
7495 terminate_handler set_terminate(terminate_handler h) throw();
7496 typedef void (*unexpected_handler)();
7497 unexpected_handler set_unexpected(unexpected_handler h) throw();
7500 #ifdef __MSVCDOTNET__
7501 inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
7502 #else // !__MSVCDOTNET__
7503 // MS KB242192: BUG: uncaught_exception() Always Returns False
7504 inline bool uncaught_exception(void) { return false; }
7505 #endif //__MSVCDOTNET__
7506 inline void terminate(void) { ::terminate(); }
7507 inline void unexpected(void) { ::unexpected(); }
7508 inline terminate_handler set_terminate(terminate_handler h) throw() { return ::set_terminate(h); }
7509 inline unexpected_handler set_unexpected(unexpected_handler h) throw() { return ::set_unexpected(h); }
7512 #endif // extract from MSVC headers
7516 extern "C" bool __uncaught_exception(void);
7519 #if __MWERKS__ > 0x3200
7520 inline bool uncaught_exception(void) { return ::__uncaught_exception(); }
7522 // no uncaught_exception() implementation on CW 2.4.7
7523 inline bool uncaught_exception(void) { return false; }
7527 #endif // extract from CW headers
7529 #endif // <exception> header guard
7531 #endif //__SUPPORT_CPP_EXCEPTIONS__