CDbKey Class Reference

#include <d32dbms.h>

Link against: edbms.lib

class CDbKey : public CBase

Inherits from

  • CDbKey

    Detailed 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.

    Member Enumeration Documentation

    Enum anonymous

    EnumeratorValueDescription
    EUnique0x01
    EPrimary0x02

    Constructor & Destructor Documentation

    CDbKey ( )

    IMPORT_CCDbKey()

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

    ~CDbKey ( )

    IMPORT_C~CDbKey()

    Frees resources owned by the object.

    Member Function Documentation

    AddL ( const TDbKeyCol & )

    IMPORT_C CDbKey &AddL(const TDbKeyCol &aKeyCol)

    Adds a key column to the end of the key.

    ParameterDescription
    aKeyColThe key column to add to the key.

    Returns: A reference to this object.

    Clear ( )

    IMPORT_C voidClear()

    Resets the key to its initial empty state.

    Comparison ( )

    TDbTextComparison Comparison()const [inline]

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

    Returns: The comparison type used for the key.

    Count ( )

    TInt Count()const [inline]

    IsPrimary ( )

    TBool IsPrimary()const [inline]

    Tests whether the key is the primary key.

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

    IsUnique ( )

    TBool IsUnique()const [inline]

    Tests whether the key is unique.

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

    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]

    Constructs and returns a pointer to a new empty key.

    Returns: A pointer to the key object.

    NewLC ( )

    IMPORT_C CDbKey *NewLC()[static]

    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.

    Returns: A pointer to the key object.

    Remove ( const TDesC & )

    IMPORT_C voidRemove(const TDesC &aColName)

    Removes the named column from the key.

    ParameterDescription
    aColNameThe name of the column to remove from the key.

    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.

    ParameterDescription
    aComparisonThe comparison type to use.

    operator[] ( TInt )

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

    Returns a key column by its position in the key.

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

    Returns: The key column requested.