Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: D32DBMS.H
Link against: edbms.lib

Class CDbColSet

class CDbColSet : public CBase;

Description

Manages a set of column definitions which describe a table or rowset structure. Column definitions can be added and removed. The set can be iterated over, and ordinals for a column can be looked up.

The class is not intended for user derivation.

Derivation

Members

Defined in CDbColSet:
AddL(), CDbColSet(), Clear(), Col(), ColNo(), Count(), NewL(), NewLC(), Remove(), operator[](), ~CDbColSet()

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


Construction and destruction


CDbColSet()

IMPORT_C CDbColSet();

Description

Constructs an empty column set.


NewL()

static IMPORT_C CDbColSet *NewL();

Description

Constructs a new empty column set and returns a pointer to it.

Return value

CDbColSet *

A pointer to the column set object.


NewLC()

static IMPORT_C CDbColSet *NewLC();

Description

Constructs a new empty column set and returns a pointer to it — placing the pointer onto the cleanup stack. This allows the column set object and allocated resources to be cleaned up if a subsequent leave occurs.

Return value

CDbColSet *

A pointer to the column set object.


~CDbColSet()

IMPORT_C ~CDbColSet();

Description

Frees resources owned by the object.

[Top]


Member functions


operator[]()

inline const TDbCol &operator[](TDbColNo aCol) const;

Description

Returns a column definition by its ordinal number in the set.

Note that using a TDbColSetIter is another way to iterate through the contents of a CDbColSet.

Parameters

TDbColNo aCol

The ordinal number of the column in the set. Columns in a column set are numbered from 1 to Count(), unlike Symbian OS array classes. Ordinal 0 is reserved to represent the invalid column number KDbNullColNo.

Return value

const TDbCol &

The column definition requested.


Col()

IMPORT_C const TDbCol *Col(const TDesC &aColName) const;

Description

Returns a named column definition in the set. If such a column does not exist in the set NULL is returned.

Parameters

const TDesC &aColName

The name of the column to find.

Return value

const TDbCol *

A pointer to the column definition found, or NULL.


ColNo()

IMPORT_C TDbColNo ColNo(const TDesC &aColName) const;

Description

Returns the ordinal for a particular column name in this column set. If such a column does not exist in the set the special ordinal KDbNullColNo is returned.

This function is particularly important when accessing data through a rowset. If the set of columns to be returned by a rowset is not explicitly specified, no assumptions should be made about the ordering of the columns returned. In such a case, in order to access the column data a column ordinal is required, and this can be obtained by using this function on the column set returned by RDbRowSet::ColSetL().

Parameters

const TDesC &aColName

The name of the column to find.

Return value

TDbColNo

The ordinal number of the column.


Count()

inline TInt Count() const;

Description

Returns the number of column definitions in the set.

Note that using a TDbColSetIter is another way to iterate through the contents of a CDbColSet.

Return value

TInt

The number of columns in the columns set.


Clear()

inline void Clear();

Description

Removes all of the columns from the column set.


AddL()

IMPORT_C CDbColSet &AddL(const TDbCol &aCol);

Description

Adds a column to the column set.

Parameters

const TDbCol &aCol

The column to add to the set.

Return value

CDbColSet &

A reference to this object.


Remove()

IMPORT_C void Remove(const TDesC &aColName);

Description

Removes the named column from the set.

Parameters

const TDesC &aColName

The name of the column to remove from the set.