RDbRowSet Class Reference

class RDbRowSet

An abstract base class that provides functionality which is shared between SQL view objects and Table objects. This functionality includes most of the cursor navigation, row retrieval and update behaviour of rowsets.

Rowset objects do not provide the data for the rowset on which they operate. It is the responsibility of the derived classes RDbView and RDbTable to specify the data source.

This class is not intended for user derivation.

Public Member Functions
IMPORT_C TBoolAtBeginning()
IMPORT_C TBoolAtEnd()
IMPORT_C TBoolAtRow()
voidBeginningL()
IMPORT_C TDbBookmarkBookmark()
IMPORT_C voidCancel()
IMPORT_C voidClose()
IMPORT_C TIntColCount()
IMPORT_C TDbColColDef(TDbColNo)
IMPORT_C TPtrCColDes(TDbColNo)
IMPORT_C TPtrC16ColDes16(TDbColNo)
IMPORT_C TPtrC8ColDes8(TDbColNo)
TInt ColInt(TDbColNo)
IMPORT_C TInt16ColInt16(TDbColNo)
IMPORT_C TInt32ColInt32(TDbColNo)
IMPORT_C TInt64ColInt64(TDbColNo)
IMPORT_C TInt8ColInt8(TDbColNo)
IMPORT_C TIntColLength(TDbColNo)
TReal ColReal(TDbColNo)
IMPORT_C TReal32ColReal32(TDbColNo)
IMPORT_C TReal64ColReal64(TDbColNo)
IMPORT_C CDbColSet *ColSetL()
IMPORT_C TIntColSize(TDbColNo)
IMPORT_C TTimeColTime(TDbColNo)
IMPORT_C TDbColTypeColType(TDbColNo)
TUint ColUint(TDbColNo)
IMPORT_C TUint16ColUint16(TDbColNo)
IMPORT_C TUint32ColUint32(TDbColNo)
IMPORT_C TUint8ColUint8(TDbColNo)
IMPORT_C TIntCountL(TAccuracy)
IMPORT_C voidDeleteL()
voidEndL()
IMPORT_C TIntFindL(TDirection, TDbQuery)
TBool FirstL()
IMPORT_C voidGetL()
IMPORT_C TBoolGotoL(TPosition)
IMPORT_C voidGotoL(const TDbBookmark &)
IMPORT_C voidInsertCopyL()
IMPORT_C voidInsertL()
TBool IsColNull(TDbColNo)
IMPORT_C TBoolIsEmptyL()
TBool LastL()
IMPORT_C TBoolMatchL(const RDbRowConstraint &)
TBool NextL()
TBool PreviousL()
IMPORT_C voidPutL()
IMPORT_C voidReset()
voidSetColL(TDbColNo, TInt)
IMPORT_C voidSetColL(TDbColNo, TInt32)
IMPORT_C voidSetColL(TDbColNo, TInt64)
voidSetColL(TDbColNo, TUint)
IMPORT_C voidSetColL(TDbColNo, TUint32)
IMPORT_C voidSetColL(TDbColNo, TReal32)
IMPORT_C voidSetColL(TDbColNo, TReal64)
IMPORT_C voidSetColL(TDbColNo, TTime)
IMPORT_C voidSetColL(TDbColNo, const TDesC8 &)
IMPORT_C voidSetColL(TDbColNo, const TDesC16 &)
IMPORT_C voidSetColNullL(TDbColNo)
IMPORT_C voidUpdateL()
Private Member Functions
CDbCursor &CheckCol(TDbColNo)
MStreamBuf *ColSinkL(TDbColNo)
MStreamBuf *ColSourceL(TDbColNo)
TDbColumnColumn(TDbColNo, TDbColType)
TDbColumnCColumnC(TDbColNo, TDbColType)
Public Member Enumerations
enumTAccess { EUpdatable, EReadOnly, EInsertOnly }
enumTAccuracy { EEnsure, EQuick }
enumTDirection { EForwards, EBackwards }
enumTPosition {
EFirst, ENext, EPrevious, ELast, EBeginning, EEnd
}
Protected Attributes
RDbHandle< CDbCursor >iCursor

Member Functions Documentation

AtBeginning()

IMPORT_C TBoolAtBeginning()const

AtEnd()

IMPORT_C TBoolAtEnd()const

AtRow()

IMPORT_C TBoolAtRow()const

BeginningL()

voidBeginningL()[inline]

Positions the cursor at the beginning of the rowset.

capability

Note For a secure shared database, the caller must satisfy the read access policy for the table.

Bookmark()

IMPORT_C TDbBookmarkBookmark()const

Cancel()

IMPORT_C voidCancel()

CheckCol(TDbColNo)

CDbCursor &CheckCol(TDbColNoaCol)const [private]

Parameters

TDbColNo aCol

Close()

IMPORT_C voidClose()

ColCount()

IMPORT_C TIntColCount()const

ColDef(TDbColNo)

IMPORT_C TDbColColDef(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColDes(TDbColNo)

IMPORT_C TPtrCColDes(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColDes16(TDbColNo)

IMPORT_C TPtrC16ColDes16(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColDes8(TDbColNo)

IMPORT_C TPtrC8ColDes8(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColInt(TDbColNo)

TInt ColInt(TDbColNoaCol)const [inline]

Extracts a signed integer column value. The type should fit within a TInt.

The value of column aCol.

Parameters

TDbColNo aColThe column ordinal of the column to extract.

ColInt16(TDbColNo)

IMPORT_C TInt16ColInt16(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColInt32(TDbColNo)

IMPORT_C TInt32ColInt32(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColInt64(TDbColNo)

IMPORT_C TInt64ColInt64(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColInt8(TDbColNo)

IMPORT_C TInt8ColInt8(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColLength(TDbColNo)

IMPORT_C TIntColLength(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColReal(TDbColNo)

TReal ColReal(TDbColNoaCol)const [inline]

Extracts a TReal64 column value.

The value of column aCol.

Parameters

TDbColNo aColThe column ordinal of the column to extract.

ColReal32(TDbColNo)

IMPORT_C TReal32ColReal32(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColReal64(TDbColNo)

IMPORT_C TReal64ColReal64(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColSetL()

IMPORT_C CDbColSet *ColSetL()const

ColSinkL(TDbColNo)

MStreamBuf *ColSinkL(TDbColNoaCol)[private, inline]

Parameters

TDbColNo aCol

ColSize(TDbColNo)

IMPORT_C TIntColSize(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColSourceL(TDbColNo)

MStreamBuf *ColSourceL(TDbColNoaCol)const [private, inline]

Parameters

TDbColNo aCol

ColTime(TDbColNo)

IMPORT_C TTimeColTime(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColType(TDbColNo)

IMPORT_C TDbColTypeColType(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColUint(TDbColNo)

TUint ColUint(TDbColNoaCol)const [inline]

Extracts an unsigned integer column value.

The value of column aCol.

Parameters

TDbColNo aColThe column ordinal of the column to extract.

ColUint16(TDbColNo)

IMPORT_C TUint16ColUint16(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColUint32(TDbColNo)

IMPORT_C TUint32ColUint32(TDbColNoaCol)const

Parameters

TDbColNo aCol

ColUint8(TDbColNo)

IMPORT_C TUint8ColUint8(TDbColNoaCol)const

Parameters

TDbColNo aCol

Column(TDbColNo, TDbColType)

TDbColumnColumn(TDbColNoaCol,
TDbColTypeaType
)[private]

Parameters

TDbColNo aCol
TDbColType aType

ColumnC(TDbColNo, TDbColType)

TDbColumnCColumnC(TDbColNoaCol,
TDbColTypeaType
)const [private]

Parameters

TDbColNo aCol
TDbColType aType

CountL(TAccuracy)

IMPORT_C TIntCountL(TAccuracyanAccuracy = EEnsure)const

Parameters

TAccuracy anAccuracy = EEnsure

DeleteL()

IMPORT_C voidDeleteL()

EndL()

voidEndL()[inline]

Positions the cursor at the end of the rowset.

capability

Note For a secure shared database, the caller must satisfy the read access policy for the table.

FindL(TDirection, TDbQuery)

IMPORT_C TIntFindL(TDirectionaDirection,
TDbQueryaCriteria
)

Parameters

TDirection aDirection
TDbQuery aCriteria

FirstL()

TBool FirstL()[inline]

Positions the cursor on the first row in the rowset. If there are no rows, the cursor is positioned at the end.

ETrue if the cursor is now at a row, EFalse if it is at the end.

capability

Note For a secure shared database, the caller must satisfy the read access policy for the table.

GetL()

IMPORT_C voidGetL()

GotoL(TPosition)

IMPORT_C TBoolGotoL(TPositionaPosition)

Parameters

TPosition aPosition

GotoL(const TDbBookmark &)

IMPORT_C voidGotoL(const TDbBookmark &aMark)

Parameters

const TDbBookmark & aMark

InsertCopyL()

IMPORT_C voidInsertCopyL()

InsertL()

IMPORT_C voidInsertL()

IsColNull(TDbColNo)

TBool IsColNull(TDbColNoaCol)const [inline]

Tests whether a column has the NULL value.

Columns which have the NULL value can still be extracted with the correct accessor function, in which case numerical columns will return a 0 (or equivalent) value, and text and binary columns will have a zero length.

ETrue if column aCol is NULL, otherwise EFalse.

Parameters

TDbColNo aColThe column ordinal for the column to test.

IsEmptyL()

IMPORT_C TBoolIsEmptyL()const

LastL()

TBool LastL()[inline]

Positions the cursor on the last row in the rowset. If there are no rows, the cursor is positioned at the beginning.

ETrue if the cursor is now at a row, EFalse if it is at the beginning.

capability

Note For a secure shared database, the caller must satisfy the read access policy for the table.

MatchL(const RDbRowConstraint &)

IMPORT_C TBoolMatchL(const RDbRowConstraint &aConstraint)

Parameters

const RDbRowConstraint & aConstraint

NextL()

TBool NextL()[inline]

Moves the cursor to the next row in the rowset. If there are no more rows, the cursor is positioned to the end.

If the cursor is at the beginning prior to the function, it is equivalent to FirstL().

capability

Note For a secure shared database, the caller must satisfy the read access policy for the table.

PreviousL()

TBool PreviousL()[inline]

Moves the cursor to the previous row in the rowset. If there are no more rows, the cursor is positioned to the beginning.

If the cursor is at the end prior to the function, it is equivalent to LastL().

ETrue if the cursor is now at a row, EFalse if it is at the beginning.

capability

Note For a secure shared database, the caller must satisfy the read access policy for the table.

PutL()

IMPORT_C voidPutL()

Reset()

IMPORT_C voidReset()

SetColL(TDbColNo, TInt)

voidSetColL(TDbColNoaCol,
TIntaValue
)[inline]

Sets a signed integer column value. The type should fit into a TInt.

Parameters

TDbColNo aColThe column ordinal of the column to set.
TInt aValueThe new column value.

SetColL(TDbColNo, TInt32)

IMPORT_C voidSetColL(TDbColNoaCol,
TInt32aValue
)

Parameters

TDbColNo aCol
TInt32 aValue

SetColL(TDbColNo, TInt64)

IMPORT_C voidSetColL(TDbColNoaCol,
TInt64aValue
)

Parameters

TDbColNo aCol
TInt64 aValue

SetColL(TDbColNo, TUint)

voidSetColL(TDbColNoaCol,
TUintaValue
)[inline]

Sets a signed integer column value. The type should fit into a TInt.

Parameters

TDbColNo aColThe column ordinal of the column to set.
TUint aValueThe new column value.

SetColL(TDbColNo, TUint32)

IMPORT_C voidSetColL(TDbColNoaCol,
TUint32aValue
)

Parameters

TDbColNo aCol
TUint32 aValue

SetColL(TDbColNo, TReal32)

IMPORT_C voidSetColL(TDbColNoaCol,
TReal32aValue
)

Parameters

TDbColNo aCol
TReal32 aValue

SetColL(TDbColNo, TReal64)

IMPORT_C voidSetColL(TDbColNoaCol,
TReal64aValue
)

Parameters

TDbColNo aCol
TReal64 aValue

SetColL(TDbColNo, TTime)

IMPORT_C voidSetColL(TDbColNoaCol,
TTimeaValue
)

Parameters

TDbColNo aCol
TTime aValue

SetColL(TDbColNo, const TDesC8 &)

IMPORT_C voidSetColL(TDbColNoaCol,
const TDesC8 &aValue
)

Parameters

TDbColNo aCol
const TDesC8 & aValue

SetColL(TDbColNo, const TDesC16 &)

IMPORT_C voidSetColL(TDbColNoaCol,
const TDesC16 &aValue
)

Parameters

TDbColNo aCol
const TDesC16 & aValue

SetColNullL(TDbColNo)

IMPORT_C voidSetColNullL(TDbColNoaCol)

Parameters

TDbColNo aCol

UpdateL()

IMPORT_C voidUpdateL()

Member Enumerations Documentation

Enum TAccess

Specifies which operations can be performed on a rowset.

Enumerators

EUpdatable

All operations can be performed on the rowset.

EReadOnly

Row navigation and reading are permitted.

EInsertOnly

Inserting new rows is the only valid operation on the rowset.

Enum TAccuracy

Specifies whether the CountL() function should ensure that it returns the exact value which may be a non-trivial task.

Enumerators

EEnsure

Take the time, if necessary, to return the exact value.

EQuick

Return any immediately available value.

Enum TDirection

Specifies the direction to search through the rowset when using the FindL() function.

Enumerators

EForwards

Search from the current row forwards through the set.

EBackwards

Search from the current row backwards through the set.

Enum TPosition

Specifies where the rowset should navigate to in the GotoL() function. Their use is encapsulated by the respective member functions FirstL(), NextL() etc.

Enumerators

EFirst

Move to the first row in the rowset.

ENext

Move to the next row in the rowset.

EPrevious

Move to the previous row in the rowset.

ELast

Move to the last row in the rowset.

EBeginning

Move to the position before the first row in the rowset.

EEnd

Move to the position after the last row in the rowset.

Member Data Documentation

RDbHandle< CDbCursor > iCursor

RDbHandle< CDbCursor >iCursor[protected]