Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: D32DBMS.H
Link against: edbms.lib

Class CDbKey

class CDbKey : public CBase;

Description

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.

Derivation

Members

Defined in CDbKey:
AddL(), CDbKey(), Clear(), Comparison(), Count(), EPrimary, EUnique, IsPrimary(), IsUnique(), MakePrimary(), MakeUnique(), NewL(), NewLC(), Remove(), SetComparison(), anonymous, operator[](), ~CDbKey()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


CDbKey()

IMPORT_C CDbKey();

Description

Constructs an empty key. It is initialised to non-unique, non-primary and normal text comparison.


NewL()

static IMPORT_C CDbKey *NewL();

Description

Constructs and returns a pointer to a new empty key.

Return value

CDbKey *

A pointer to the key object.


NewLC()

static IMPORT_C CDbKey *NewLC();

Description

Constructs and returns a new empty key and return a pointer to it, leaving a pointer to the key object on the cleanup stack. This allows the key object and allocated resources to be cleaned up if a subsequent leave occurs.

Return value

CDbKey *

A pointer to the key object.


~CDbKey()

IMPORT_C ~CDbKey();

Description

Frees resources owned by the object.

[Top]


Member functions


AddL()

IMPORT_C CDbKey &AddL(const TDbKeyCol &aKeyCol);

Description

Adds a key column to the end of the key.

Parameters

const TDbKeyCol &aKeyCol

The key column to add to the key.

Return value

CDbKey &

A reference to this object.


Remove()

IMPORT_C void Remove(const TDesC &aColName);

Description

Removes the named column from the key.

Parameters

const TDesC &aColName

The name of the column to remove from the key.


Clear()

IMPORT_C void Clear();

Description

Resets the key to its initial empty state.


Count()

inline TInt Count() const;

Description

Return value

TInt


operator[]()

inline const TDbKeyCol &operator[](TInt aCol) const;

Description

Returns a key column by its position in the key.

Parameters

TInt aCol

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

Return value

const TDbKeyCol &

The key column requested.


MakeUnique()

inline void MakeUnique();

Description

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


IsUnique()

inline TBool IsUnique() const;

Description

Tests whether the key is unique.

Return value

TBool

ETrue, if the key is unique; EFalse, otherwise.


SetComparison()

inline void SetComparison(TDbTextComparison aComparison);

Description

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 aComparison

The comparison type to use.


Comparison()

inline TDbTextComparison Comparison() const;

Description

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

Return value

TDbTextComparison

The comparison type used for the key.


MakePrimary()

inline void MakePrimary();

Description


IsPrimary()

inline TBool IsPrimary() const;

Description

Tests whether the key is the primary key.

Return value

TBool

ETrue, if the key is unique; EFalse, otherwise.

[Top]


Member enumerations


Enum anonymous

n/a

Description

EUnique

EPrimary