Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:

Inherited from CBase:


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()

IMPORT_C static CDbKey* NewL();

Description

Constructs and returns a pointer to a new empty key.

Return value

CDbKey *

A pointer to the key object.


NewLC()

IMPORT_C static 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(const TDbKeyCol &)

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(const TDesC &)

IMPORT_C void Remove(const TDesC &aColName);

Description

Removes the named column from the key.

Parameters

const TDesC16 &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()const

inline TInt Count() const;

Description

Return value

TInt


operator[](TInt)const

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 CDbKey::Count()const-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()const

inline TBool IsUnique() const;

Description

Tests whether the key is unique.

Return value

TBool

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


SetComparison(TDbTextComparison)

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()const

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()const

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