CDbKey Class Reference

class CDbKey : public CBase

Represents the definition of an index. The key may be unique or primary, it can specify the sort of comparison which is made for Text columns, and it has a list of columns which make up the key. The class is used to construct and interrogate index keys.

This class is not intended for user derivation.

Inherits from

Constructor & Destructor Documentation

CDbKey()

IMPORT_CCDbKey()

~CDbKey()

IMPORT_C~CDbKey()

Member Functions Documentation

AddL(const TDbKeyCol &)

IMPORT_C CDbKey &AddL(const TDbKeyCol &aKeyCol)

Parameters

const TDbKeyCol & aKeyCol

Clear()

IMPORT_C voidClear()

Comparison()

TDbTextComparison Comparison()const [inline]

Returns the method used to compare Text columns in this key.

Count()

TInt Count()const [inline]

IsPrimary()

TBool IsPrimary()const [inline]

Tests whether the key is the primary key.

IsUnique()

TBool IsUnique()const [inline]

Tests whether the key is unique.

MakePrimary()

voidMakePrimary()[inline]

MakeUnique()

voidMakeUnique()[inline]

Makes the key unique. This ensures that every key value in the index is distinct from every other.

NewL()

IMPORT_C CDbKey *NewL()[static]

NewLC()

IMPORT_C CDbKey *NewLC()[static]

Remove(const TDesC &)

IMPORT_C voidRemove(const TDesC &aColName)

Parameters

const TDesC & aColName

SetComparison(TDbTextComparison)

voidSetComparison(TDbTextComparisonaComparison)[inline]

Sets the way in which Text columns are compared for the key. All Text columns in the key are compared in the same way.

Parameters

TDbTextComparison aComparisonThe comparison type to use.

operator[](TInt)

const TDbKeyCol &operator[](TIntaCol)const [inline]

Returns a key column by its position in the key.

Parameters

TInt aColThe position of the column in the key. These are numbered from 0 to Count()-1.

Member Data Documentation

TInt iAttributes

TInt iAttributes[private]

TDbTextComparison iComparison

TDbTextComparison iComparison[private]

CArrayPakFlat< TDbKeyCol > iKeys

CArrayPakFlat< TDbKeyCol >iKeys[private]