1 /* 2 * Copyright (C) 2001 - 2003 Rodrigo Moya <rodrigo@gnome-db.org> 3 * Copyright (C) 2001 - 2011 Vivien Malerba <malerba@gnome-db.org> 4 * Copyright (C) 2002 Gonzalo Paniagua Javier <gonzalo@gnome-db.org> 5 * Copyright (C) 2003 Laurent Sansonetti <laurent@datarescue.be> 6 * Copyright (C) 2003 Xabier Rodríguez Calvar <xrcalvar@igalia.com> 7 * Copyright (C) 2004 Paisa Seeluangsawat <paisa@users.sf.net> 8 * Copyright (C) 2005 Bas Driessen <bas.driessen@xobas.com> 9 * Copyright (C) 2005 Álvaro Peña <alvaropg@telefonica.net> 10 * 11 * This library is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2 of the License, or (at your option) any later version. 15 * 16 * This library is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public 22 * License along with this library; if not, write to the 23 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 24 * Boston, MA 02110-1301, USA. 25 */ 26 27 #ifndef __GDA_ROW_H__ 28 #define __GDA_ROW_H__ 29 30 #include <glib-object.h> 31 #include <libgda/gda-decl.h> 32 33 G_BEGIN_DECLS 34 35 #define GDA_TYPE_ROW (gda_row_get_type()) 36 #define GDA_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GDA_TYPE_ROW, GdaRow)) 37 #define GDA_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, GDA_TYPE_ROW, GdaRowClass)) 38 #define GDA_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GDA_TYPE_ROW)) 39 #define GDA_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDA_TYPE_ROW)) 40 41 typedef struct _GdaRow GdaRow; 42 typedef struct _GdaRowClass GdaRowClass; 43 typedef struct _GdaRowPrivate GdaRowPrivate; 44 45 struct _GdaRow { 46 GObject object; 47 GdaRowPrivate *priv; 48 }; 49 50 struct _GdaRowClass { 51 GObjectClass parent_class; 52 53 /*< private >*/ 54 /* Padding for future expansion */ 55 void (*_gda_reserved1) (void); 56 void (*_gda_reserved2) (void); 57 void (*_gda_reserved3) (void); 58 void (*_gda_reserved4) (void); 59 }; 60 61 /** 62 * SECTION:gda-row 63 * @short_description: Individual row of a #GdaDataModelArray object 64 * @title: GdaRow 65 * @stability: Stable 66 * @see_also: #GdaDataModelArray 67 * 68 * The #GdaDataModelArray object uses #GdaRow to store each row of data. Each #GdaRow has the same 69 * number of #GValue values (equal to the number of columns of the data model). 70 * 71 * As a side note, the #GdaRow object is also used internally by the implementation of the data models returned 72 * when executing a SELECT statement. 73 */ 74 75 GType gda_row_get_type (void) G_GNUC_CONST; 76 77 GdaRow *gda_row_new (gint count); 78 gint gda_row_get_length (GdaRow *row); 79 GValue *gda_row_get_value (GdaRow *row, gint num); 80 81 /* for database providers mainly */ 82 void gda_row_invalidate_value (GdaRow *row, GValue *value); 83 void gda_row_invalidate_value_e (GdaRow *row, GValue *value, GError *error); 84 gboolean gda_row_value_is_valid (GdaRow *row, GValue *value); 85 gboolean gda_row_value_is_valid_e (GdaRow *row, GValue *value, GError **error); 86 87 G_END_DECLS 88 89 #endif 90