gda-row

gda-row — Functions for accessing GdaRow

Synopsis




struct      GdaDataModel;
struct      GdaRow;
#define     GDA_TYPE_ROW
GType       gda_row_get_type                (void);
GdaRow*     gda_row_new                     (GdaDataModel *model,
                                             gint count);
GdaRow*     gda_row_new_from_list           (GdaDataModel *model,
                                             const GList *values);
GdaRow*     gda_row_copy                    (GdaRow *row);
void        gda_row_free                    (GdaRow *row);
GdaDataModel* gda_row_get_model             (GdaRow *row);
gint        gda_row_get_number              (GdaRow *row);
void        gda_row_set_number              (GdaRow *row,
                                             gint number);
const gchar* gda_row_get_id                 (GdaRow *row);
void        gda_row_set_id                  (GdaRow *row,
                                             const gchar *id);
GdaValue*   gda_row_get_value               (GdaRow *row,
                                             gint num);
gint        gda_row_get_length              (GdaRow *row);

Description

Details

struct GdaDataModel

struct GdaDataModel {

	GObject object;
	GdaDataModelPrivate *priv;
};


struct GdaRow

struct GdaRow;


GDA_TYPE_ROW

#define GDA_TYPE_ROW (gda_row_get_type())


gda_row_get_type ()

GType       gda_row_get_type                (void);

Returns :

gda_row_new ()

GdaRow*     gda_row_new                     (GdaDataModel *model,
                                             gint count);

Creates a GdaRow which can hold count GdaValue.

model : the GdaDataModel this row belongs to.
count : number of GdaValue in the new GdaRow.
Returns : the newly allocated GdaRow.

gda_row_new_from_list ()

GdaRow*     gda_row_new_from_list           (GdaDataModel *model,
                                             const GList *values);

Creates a GdaRow from a list of GdaValue's. These GdaValue's are value-copied and the user are still resposible for freeing them.

model : a GdaDataModel.
values : a list of GdaValue's.
Returns : the newly created row.

gda_row_copy ()

GdaRow*     gda_row_copy                    (GdaRow *row);

Creates a new GdaRow from an existing one.

row : quark_list to get a copy from.
Returns : a newly allocated GdaRow with a copy of the data in row.

gda_row_free ()

void        gda_row_free                    (GdaRow *row);

Deallocates all memory associated to a GdaRow.

row : the resource to free.

gda_row_get_model ()

GdaDataModel* gda_row_get_model             (GdaRow *row);

Gets the GdaDataModel the given GdaRow belongs to.

row : a GdaRow.
Returns : a GdaDataModel.

gda_row_get_number ()

gint        gda_row_get_number              (GdaRow *row);

Gets the number of the given row, that is, its position in its containing data model.

row : a GdaRow.
Returns : the row number, or -1 if there was an error.

gda_row_set_number ()

void        gda_row_set_number              (GdaRow *row,
                                             gint number);

Sets the row number for the given row.

row : a GdaRow.
number : the new row number.

gda_row_get_id ()

const gchar* gda_row_get_id                 (GdaRow *row);

Returns the unique identifier for this row. This identifier is assigned by the different providers, to uniquely identify rows returned to clients. If there is no ID, this means that the row has not been created by a provider, or that it the provider cannot identify it (ie, modifications to it won't take place into the database).

row : a GdaRow (which contains GdaValue).
Returns : the unique identifier for this row.

gda_row_set_id ()

void        gda_row_set_id                  (GdaRow *row,
                                             const gchar *id);

Assigns a new identifier to the given row. This function is usually called by providers.

row : a GdaRow (which contains GdaValue).
id : new identifier for the row.

gda_row_get_value ()

GdaValue*   gda_row_get_value               (GdaRow *row,
                                             gint num);

Gets a pointer to a GdaValue stored in a GdaRow.

This is a pointer to the internal array of values. Don't try to free or modify it!

row : a GdaRow (which contains GdaValue).
num : field index.
Returns : a pointer to the GdaValue in the position num of row.

gda_row_get_length ()

gint        gda_row_get_length              (GdaRow *row);

row : a GdaRow.
Returns : the number of columns that the row has.