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