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