| Dee Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | ||||
#include <dee.h>
DeeResultSetIface;
DeeResultSet;
guint dee_result_set_get_n_rows (DeeResultSet *self);
DeeModelIter* dee_result_set_next (DeeResultSet *self);
gboolean dee_result_set_has_next (DeeResultSet *self);
DeeModelIter* dee_result_set_peek (DeeResultSet *self);
void dee_result_set_seek (DeeResultSet *self,
guint pos);
guint dee_result_set_tell (DeeResultSet *self);
DeeModel* dee_result_set_get_model (DeeResultSet *self);
Interface for results returned by dee_index_lookup().
This interface utilizes a cursor-like metaphor. You advance the cursor
by calling dee_result_set_next() or adjust it manually by calling
dee_result_set_seek().
Calling dee_result_set_next() will also return the row at the
current cursor position. You may retrieve the current row without advancing
the cursor by calling dee_result_set_peek().
typedef struct {
GTypeInterface g_iface;
guint (*get_n_rows) (DeeResultSet *self);
DeeModelIter* (*next) (DeeResultSet *self);
gboolean (*has_next) (DeeResultSet *self);
DeeModelIter* (*peek) (DeeResultSet *self);
void (*seek) (DeeResultSet *self,
guint pos);
guint (*tell) (DeeResultSet *self);
DeeModel* (*get_model) (DeeResultSet *self);
} DeeResultSetIface;
guint dee_result_set_get_n_rows (DeeResultSet *self);
Get the number of DeeModelIters held in a DeeResultSet.
|
The DeeResultSet to get the size of |
Returns : |
The number of rows held in the result set |
DeeModelIter* dee_result_set_next (DeeResultSet *self);
Get the current row from the result set and advance the cursor.
To ensure that calls to this method will succeed you can call
dee_result_set_has_next().
To retrieve the current row without advancing the cursor call
dee_result_set_peek() in stead of this method.
|
The DeeResultSet to get a row from |
Returns : |
The DeeModelIter at the current cursor position |
gboolean dee_result_set_has_next (DeeResultSet *self);
Check if a call to dee_result_set_next() will succeed.
|
The DeeResultSet to check |
Returns : |
TRUE if and only if more rows can be retrieved by calling
dee_result_set_next()
|
DeeModelIter* dee_result_set_peek (DeeResultSet *self);
Get the row at the current cursor position.
To retrieve the current row and advance the cursor position call
dee_result_set_next() in stead of this method.
|
The DeeResultSet to get a row from |
Returns : |
The DeeModelIter at the current cursor position |
void dee_result_set_seek (DeeResultSet *self,guint pos);
Set the cursor position. Following calls to dee_result_set_peek()
or dee_result_set_next() will read the row at position pos.
|
The DeeResultSet to seek in |
|
The position to seek to |
guint dee_result_set_tell (DeeResultSet *self);
Get the current position of the cursor.
|
The DeeResultSet to check the cursor position for |
Returns : |
The current position of the cursor |
DeeModel* dee_result_set_get_model (DeeResultSet *self);
Get the model associated with a result set
|
The DeeResultSet to get the mode for |
Returns : |
The model that the rows point into |