CSortArray Class Reference

class CSortArray : public CBase

Inherits from

Constructor & Destructor Documentation

CSortArray()

CSortArray()

CSortArray first phase constructor.

~CSortArray()

~CSortArray()

CSortArray destructor.

Member Functions Documentation

AppendL(const TDesC &, TContactItemId)

voidAppendL(const TDesC &Text,
TContactItemIdaId
)

Create a CTextFieldMinimal object using the given text and Contact ID and append it to the sort array.

Parameters

const TDesC & TextText for CTextFieldMinimal object.
TContactItemId aIdContact ID for CTextFieldMinimal object.

Count()

TInt Count()const [inline]

DefaultAlgorithmToCompareNames(const CTextFieldMinimal &, const CTextFieldMinimal &)

TInt DefaultAlgorithmToCompareNames(const CTextFieldMinimal &aName1,
const CTextFieldMinimal &aName2
)[private, static]

Compare the text in the given CTextFieldMinimal objects.

The custom TCollation method is required to ensure that the collated comparison will not ignore spaces and punctuation (which it does by default).

Mem::CollationMethodByIndex() is an exec call and is hence relatively expensive. Although it is inefficient to create a collation method each time this method is called, there is no benefit in storing TCollationMethod as a member of CSortArray because this method must be static.

Parameters

const CTextFieldMinimal & aName1
const CTextFieldMinimal & aName2

Id(TInt)

TContactItemId Id(TIntaIndex)const

Get the Contact ID at the given index in the sort array.

Parameters

TInt aIndex

Merge(CSortArray *, TInt)

voidMerge(CSortArray *aDuplicates,
TIntaStartPos
)

Merge the given sort array with this sort array starting from the given position in this sort array.

Parameters

CSortArray * aDuplicatesThe sort array to be merged with this sort array.
TInt aStartPosThe starting position for the merge in this sort array.

SortL(CContactDatabase::TSortPref::TOrder)

voidSortL(CContactDatabase::TSortPref::TOrderaOrder)

Sort the sort array using the given sort order.

Parameters

CContactDatabase::TSortPref::TOrder aOrderEAsc for ascending order, EDesc for descending order.

Text(TInt)

HBufC *Text(TIntaIndex)const

Get the text at the given index in the sort array.

Parameters

TInt aIndex

Member Data Documentation

RPointerArray< CTextFieldMinimal > iArray

RPointerArray< CTextFieldMinimal >iArray[private]