Top | ![]() |
![]() |
![]() |
![]() |
#define | RYGEL_DATABASE_TYPE_CURSOR |
#define | RYGEL_DATABASE_CURSOR_TYPE_ITERATOR |
struct | RygelDatabaseCursorIterator |
struct | RygelDatabaseCursorIteratorClass |
struct | RygelDatabaseCursor |
struct | RygelDatabaseCursorClass |
void rygel_database_cursor_bind (RygelDatabaseCursor *self
,GValue *arguments
,int arguments_length1
,GError **error
);
Bind new values to a cursor.
The cursor will be reset.
This function uses the type of the GValue passed in values to determine which _bind function to use.
Supported types are: int, long, int64, uint64, string and pointer. Note: The only pointer supported is the null pointer as provided by Database.null
. This is a special value to bind a column to NULL
self |
the RygelDatabaseCursor instance |
|
arguments |
. array of values to bind to the SQL statement or null if none . |
[in][allow-none][array length=arguments_length1] |
arguments_length1 |
length of the |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
gboolean rygel_database_cursor_has_next (RygelDatabaseCursor *self
,GError **error
);
Check if the cursor has more rows left
self |
the RygelDatabaseCursor instance |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
sqlite3_stmt * rygel_database_cursor_next (RygelDatabaseCursor *self
,GError **error
);
Get the next row of this cursor.
This function uses pointers instead of unowned because var doesn't work with unowned.
self |
the RygelDatabaseCursor instance |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
RygelDatabaseCursorIterator *
rygel_database_cursor_iterator (RygelDatabaseCursor *self
);
Return an iterator to the cursor to use with foreach
void rygel_database_cursor_throw_if_code_is_error (RygelDatabaseCursor *self
,gint sqlite_error
,GError **error
);
Convert a SQLite return code to a DatabaseError
self |
the RygelDatabaseCursor instance |
|
sqlite_error |
|
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
void rygel_database_cursor_throw_if_db_has_error (RygelDatabaseCursor *self
,GError **error
);
Check if the last operation on the database was an error
self |
the RygelDatabaseCursor instance |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
gboolean rygel_database_cursor_iterator_next (RygelDatabaseCursorIterator *self
,GError **error
);
self |
the RygelDatabaseCursorIterator instance |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
sqlite3_stmt * rygel_database_cursor_iterator_get (RygelDatabaseCursorIterator *self
,GError **error
);
self |
the RygelDatabaseCursorIterator instance |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
RygelDatabaseCursorIterator *
rygel_database_cursor_iterator_new (RygelDatabaseCursor *cursor
);
gpointer
rygel_database_cursor_iterator_ref (gpointer instance
);
Increases the reference count of object
.
void
rygel_database_cursor_iterator_unref (gpointer instance
);
Decreases the reference count of object
. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).
GParamSpec * rygel_database_cursor_param_spec_iterator (const gchar *name
,const gchar *nick
,const gchar *blurb
,GType object_type
,GParamFlags flags
);
Creates a new GParamSpecBoxed instance specifying a RYGEL_DATABASE_CURSOR_TYPE_ITERATOR
derived property.
See
for details on property names.g_param_spec_internal()
name |
canonical name of the property specified |
|
nick |
nick name for the property specified |
|
blurb |
description of the property specified |
|
object_type |
RYGEL_DATABASE_CURSOR_TYPE_ITERATOR derived type of this property |
|
flags |
flags for the property specified |
void rygel_database_cursor_value_set_iterator (GValue *value
,gpointer v_object
);
Set the contents of a RYGEL_DATABASE_CURSOR_TYPE_ITERATOR
derived GValue to v_object
.
rygel_database_cursor_value_set_iterator()
increases the reference count of v_object
(the GValue holds a reference to v_object
). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the GValue because you no longer need it), use rygel_database_cursor_value_take_iterator()
instead.
It is important that your GValue holds a reference to v_object
(either its own, or one it has taken) to ensure that the object won't be destroyed while the GValue still exists).
value |
a valid GValue of |
|
v_object |
object value to be set |
gpointer
rygel_database_cursor_value_get_iterator
(const GValue *value
);
Get the contents of a RYGEL_DATABASE_CURSOR_TYPE_ITERATOR
derived GValue.
void rygel_database_cursor_value_take_iterator (GValue *value
,gpointer v_object
);
Sets the contents of a RYGEL_DATABASE_CURSOR_TYPE_ITERATOR
derived GValue to v_object
and takes over the ownership of the callers reference to v_object
; the caller doesn't have to unref it any more (i.e. the reference count of the object is not increased).
If you want the GValue to hold its own reference to v_object
, use rygel_database_cursor_value_set_iterator()
instead.
value |
a valid GValue of |
|
v_object |
object value to be set |
RygelDatabaseCursor * rygel_database_cursor_new (sqlite3 *db
,const gchar *sql
,GValue *arguments
,int arguments_length1
,GError **error
);
Prepare a SQLite statement from a SQL string
If arguments
is non-null, it will call bind()
db |
. SQLite database this cursor belongs to . |
[in] |
sql |
. statement to execute . |
[in] |
arguments |
. array of values to bind to the SQL statement or null if none . |
[in][allow-none][array length=arguments_length1] |
arguments_length1 |
length of the |
|
error |
location to store the error occuring, or |
[error-domains RygelDatabaseDatabaseError] |
#define RYGEL_DATABASE_TYPE_CURSOR (rygel_database_cursor_get_type ())
The type for RygelDatabaseCursor.
#define RYGEL_DATABASE_CURSOR_TYPE_ITERATOR (rygel_database_cursor_iterator_get_type ())
The type for RygelDatabaseCursorIterator.
struct RygelDatabaseCursorIteratorClass { GTypeClass parent_class; void (*finalize) (RygelDatabaseCursorIterator *self); };
The class structure for RYGEL_DATABASE_CURSOR_TYPE_ITERATOR
. All the fields in this structure are private and should never be accessed directly.
struct RygelDatabaseCursorClass { GObjectClass parent_class; };
The class structure for RYGEL_DATABASE_TYPE_CURSOR
. All the fields in this structure are private and should never be accessed directly.