Dee.ModelReader

Fields

Name

Type

Access

Description

destroy

GLib.DestroyNotify

r/w

Called when the reader is destroyed

reader_func

Dee.ModelReaderFunc

r/w

The Dee.ModelReaderFunc used to extract string from a model

userdata

object

r/w

user data to pass to reader_func

Methods

class

new (reader_func, *userdata)

class

new_for_int32_column (column)

class

new_for_string_column (column)

class

new_for_uint32_column (column)

read (model, iter)

Details

class Dee.ModelReader

Structure encapsulating the information needed to read strings from a model. Used for example by Dee.Index.

classmethod new(reader_func, *userdata)
Parameters:
Returns:

A pointer to an uninitialized Dee.ModelReader struct

Return type:

out_reader: Dee.ModelReader

Create a new Dee.ModelReader with the given parameters. This call will zero the out_reader struct.

classmethod new_for_int32_column(column)
Parameters:

column (int) – The column index to read a %gint32 from

Returns:

A pointer to a Dee.ModelReader instance which will have all fields initialized appropriately

Return type:

out_reader: Dee.ModelReader

A Dee.ModelReader reading a %gint32 from a Dee.Model at a given column

classmethod new_for_string_column(column)
Parameters:

column (int) – The column index to read a string from

Returns:

A pointer to a Dee.ModelReader instance which will have all fields initialized appropriately

Return type:

out_reader: Dee.ModelReader

A Dee.ModelReader reading a string from a Dee.Model at a given column

classmethod new_for_uint32_column(column)
Parameters:

column (int) – The column index to read a %guint32 from

Returns:

A pointer to a Dee.ModelReader instance which will have all fields initialized appropriately

Return type:

out_reader: Dee.ModelReader

A Dee.ModelReader reading a %guint32 from a Dee.Model at a given column

read(model, iter)
Parameters:
Returns:

A newly allocated string. Free with GLib.free().

Return type:

str

Read data from a row in a Dee.Model and extract a string representation from it.

Note that generally a Dee.ModelReader need not be confined to reading from one specific column, although in practice most are.