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)

void AppendL ( const TDesC & Text,
TContactItemId aId
)

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

Parameters

const TDesC & Text Text for CTextFieldMinimal object.
TContactItemId aId Contact 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 ( TInt aIndex ) const

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

Parameters

TInt aIndex

Merge(CSortArray *, TInt)

void Merge ( CSortArray * aDuplicates,
TInt aStartPos
)

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

Parameters

CSortArray * aDuplicates The sort array to be merged with this sort array.
TInt aStartPos The starting position for the merge in this sort array.

SortL(CContactDatabase::TSortPref::TOrder)

void SortL ( CContactDatabase::TSortPref::TOrder aOrder )

Sort the sort array using the given sort order.

Parameters

CContactDatabase::TSortPref::TOrder aOrder EAsc for ascending order, EDesc for descending order.

Text(TInt)

HBufC * Text ( TInt aIndex ) 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]