kexi

KexiDB::SQLiteCursor Class Reference

Inheritance diagram for KexiDB::SQLiteCursor:

KexiDB::Cursor KexiDB::Object List of all members.

Detailed Description

Definition at line 35 of file sqlitecursor.h.


Public Member Functions

virtual ~SQLiteCursor ()
virtual QVariant value (uint i)
virtual const char ** rowData () const
virtual void storeCurrentRow (RowData &data) const
virtual int serverResult ()
virtual QString serverResultName ()
virtual QString serverErrorMsg ()

Protected Member Functions

 SQLiteCursor (Connection *conn, const QString &statement, uint options=NoOptions)
 SQLiteCursor (Connection *conn, QuerySchema &query, uint options=NoOptions)
virtual bool drv_open ()
virtual bool drv_close ()
virtual void drv_getNextRecord ()
virtual void drv_appendCurrentRecordToBuffer ()
virtual void drv_bufferMovePointerNext ()
virtual void drv_bufferMovePointerPrev ()
virtual void drv_bufferMovePointerTo (Q_LLONG at)
virtual void drv_clearBuffer ()
virtual void drv_clearServerResult ()

Protected Attributes

SQLiteCursorData * d

Friends

class SQLiteConnection

Constructor & Destructor Documentation

SQLiteCursor::SQLiteCursor ( Connection conn,
const QString &  statement,
uint  options = NoOptions 
) [protected]

Cursor will operate on conn, raw statement will be used to execute query.

Definition at line 200 of file sqlitecursor.cpp.

SQLiteCursor::SQLiteCursor ( Connection conn,
QuerySchema query,
uint  options = NoOptions 
) [protected]

Cursor will operate on conn, query schema will be used to execute query.

Definition at line 207 of file sqlitecursor.cpp.


Member Function Documentation

QVariant SQLiteCursor::value ( uint  i  )  [virtual]

Returns:
a value stored in column number i (counting from 0). Is has unspecified behaviour if the cursor is not at valid record. Note for driver developers: If i is >= than m_fieldCount, null QVariant value should be returned. To return a value typically you can use a pointer to internal structure that contain current row data (buffered or unbuffered).

Implements KexiDB::Cursor.

Definition at line 508 of file sqlitecursor.cpp.

const char ** SQLiteCursor::rowData (  )  const [virtual]

[PROTOTYPE]

Returns:
current record data or NULL if there is no current records.

Implements KexiDB::Cursor.

Definition at line 420 of file sqlitecursor.cpp.

void SQLiteCursor::storeCurrentRow ( RowData data  )  const [virtual]

Puts current record's data into data (makes a deep copy). This have unspecified behaviour if the cursor is not at valid record. Note: For reimplementation in driver's code. Shortly, this method translates a row data from internal representation (probably also used in buffer) to simple public RecordData representation.

Implements KexiDB::Cursor.

Definition at line 425 of file sqlitecursor.cpp.

int SQLiteCursor::serverResult (  )  [virtual]

Stores string value taken from field number i to str.

Returns:
false when range checking failed. bool SQLiteCursor::storeStringValue(uint i, QString &str) { if (i > (m_fieldCount-1)) //range checking return false; str = d->curr_coldata[i]; return true; }

Reimplemented from KexiDB::Cursor.

Definition at line 543 of file sqlitecursor.cpp.

QString SQLiteCursor::serverResultName (  )  [virtual]

Returns:
(not i18n'd) name of last executed operation's result at the server side. Sometimes engines have predefined its result names that can be used e.g. to refer a documentation. SQLite is one of such engines. Note for driver developers: Leave the default implementation (null string is returned ) if your engine has no such capability.

Reimplemented from KexiDB::Cursor.

Definition at line 548 of file sqlitecursor.cpp.

QString SQLiteCursor::serverErrorMsg (  )  [virtual]

Returns:
(not i18n'd) description text (message) of last operation's error/result. In most cases engines do return such a messages, any user can then use this to refer a documentation. Note for driver developers: Leave the default implementation (null string is returned ) if your engine has no such capability.

Reimplemented from KexiDB::Cursor.

Definition at line 557 of file sqlitecursor.cpp.

void SQLiteCursor::drv_appendCurrentRecordToBuffer (  )  [protected, virtual]

Stores currently fetched record's values in appropriate place of the buffer. Note for driver developers: This place can be computed using m_at. Do not change value of m_at or any other Cursor members, only change your internal structures like pointer to current row, etc. If your database engine's API function (for record fetching) do not allocates such a space, you want to allocate a space for current record. Otherwise, reuse existing structure, what could be more efficient. All functions like drv_appendCurrentRecordToBuffer() operates on the buffer, i.e. array of stored rows. You are not forced to have any particular fixed structure for buffer item or buffer itself - the structure is internal and only methods like storeCurrentRecord() visible to public.

Implements KexiDB::Cursor.

Definition at line 337 of file sqlitecursor.cpp.

void SQLiteCursor::drv_bufferMovePointerNext (  )  [protected, virtual]

Moves pointer (that points to the buffer) -- to next item in this buffer. Note for driver developers: probably just execute "your_pointer++" is enough.

Implements KexiDB::Cursor.

Definition at line 354 of file sqlitecursor.cpp.

void SQLiteCursor::drv_bufferMovePointerPrev (  )  [protected, virtual]

Like drv_bufferMovePointerNext() but execute "your_pointer--".

Implements KexiDB::Cursor.

Definition at line 359 of file sqlitecursor.cpp.

void SQLiteCursor::drv_bufferMovePointerTo ( Q_LLONG  at  )  [protected, virtual]

Moves pointer (that points to the buffer) to a new place: at.

Implements KexiDB::Cursor.

Definition at line 366 of file sqlitecursor.cpp.

void SQLiteCursor::drv_clearBuffer (  )  [protected, virtual]

Method called when cursor's buffer need to be cleared (only for buffered cursor type), eg. in close().

Reimplemented from KexiDB::Cursor.

Definition at line 371 of file sqlitecursor.cpp.

void SQLiteCursor::drv_clearServerResult (  )  [protected, virtual]

Clears an internal member that is used to storing last result code, the same that is returend by serverResult().

Implements KexiDB::Cursor.

Definition at line 562 of file sqlitecursor.cpp.


Member Data Documentation

SQLiteCursorData* KexiDB::SQLiteCursor::d [protected]

for future extensions

Reimplemented from KexiDB::Cursor.

Definition at line 83 of file sqlitecursor.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys