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.
Public Member Functions | |
---|---|
CDbKey() | |
~CDbKey() | |
IMPORT_C CDbKey & | AddL(const TDbKeyCol &) |
IMPORT_C void | Clear() |
TDbTextComparison | Comparison() |
TInt | Count() |
TBool | IsPrimary() |
TBool | IsUnique() |
void | MakePrimary() |
void | MakeUnique() |
IMPORT_C CDbKey * | NewL() |
IMPORT_C CDbKey * | NewLC() |
IMPORT_C void | Remove(const TDesC &) |
void | SetComparison(TDbTextComparison) |
const TDbKeyCol & | operator[](TInt) |
Private Attributes | |
---|---|
TInt | iAttributes |
TDbTextComparison | iComparison |
CArrayPakFlat< TDbKeyCol > | iKeys |
IMPORT_C CDbKey & | AddL | ( | const TDbKeyCol & | aKeyCol | ) |
const TDbKeyCol & aKeyCol |
TDbTextComparison | Comparison | ( | ) | const [inline] |
Returns the method used to compare Text columns in this key.
The comparison type used for the key.
TBool | IsPrimary | ( | ) | const [inline] |
Tests whether the key is the primary key.
ETrue, if the key is unique; EFalse, otherwise.
TBool | IsUnique | ( | ) | const [inline] |
Tests whether the key is unique.
ETrue, if the key is unique; EFalse, otherwise.
void | MakeUnique | ( | ) | [inline] |
Makes the key unique. This ensures that every key value in the index is distinct from every other.
void | SetComparison | ( | TDbTextComparison | aComparison | ) | [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.
TDbTextComparison aComparison | The comparison type to use. |
const TDbKeyCol & | operator[] | ( | TInt | aCol | ) | const [inline] |
Returns a key column by its position in the key.
The key column requested.
TInt aCol | The position of the column in the key. These are numbered from 0 to Count()-1. |