[libgda/libgda-vala] Added GdaSqlSelect class to allow GI to create select expressions as GdaSqlExpr



commit 1b13ae7d0ba7b0caf0ffeb4bf3c8c6689362c8e0
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue May 14 18:56:01 2013 -0500

    Added GdaSqlSelect class to allow GI to create select expressions as GdaSqlExpr

 libgda/gda-sql-expression-private.h |    2 +-
 libgda/gda-sql-expression.c         |    2 +-
 libgda/gda-sql-expression.h         |    2 +-
 libgda/gda-sql-select-private.h     |   33 +++++++++++++++++
 libgda/gda-sql-select.c             |   52 +++++++++++++++++++++++++++
 libgda/gda-sql-select.h             |   66 +++++++++++++++++++++++++++++++++++
 6 files changed, 154 insertions(+), 3 deletions(-)
---
diff --git a/libgda/gda-sql-expression-private.h b/libgda/gda-sql-expression-private.h
index 2f2fac7..0c9d2bc 100644
--- a/libgda/gda-sql-expression-private.h
+++ b/libgda/gda-sql-expression-private.h
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
 /*
  * libgdadata
- * Copyright (C) Daniel Espinosa Ortiz 2011 <esodan gmail com>
+ * Copyright (C) Daniel Espinosa Ortiz 2013 <esodan gmail com>
  *
  * libgda is free software: you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
diff --git a/libgda/gda-sql-expression.c b/libgda/gda-sql-expression.c
index 14e883a..c5e29e7 100644
--- a/libgda/gda-sql-expression.c
+++ b/libgda/gda-sql-expression.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
 /*
  * libgdadata
- * Copyright (C) Daniel Espinosa Ortiz 2011 <esodan gmail com>
+ * Copyright (C) Daniel Espinosa Ortiz 2013 <esodan gmail com>
  *
  * libgda is free software: you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
diff --git a/libgda/gda-sql-expression.h b/libgda/gda-sql-expression.h
index 3e4c99b..af701f3 100644
--- a/libgda/gda-sql-expression.h
+++ b/libgda/gda-sql-expression.h
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
 /*
  * libgdadata
- * Copyright (C) Daniel Espinosa Ortiz 2011 <esodan gmail com>
+ * Copyright (C) Daniel Espinosa Ortiz 2013 <esodan gmail com>
  *
  * libgda is free software: you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
diff --git a/libgda/gda-sql-select-private.h b/libgda/gda-sql-select-private.h
new file mode 100644
index 0000000..91d9cf4
--- /dev/null
+++ b/libgda/gda-sql-select-private.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
+/*
+ * libgdadata
+ * Copyright (C) Daniel Espinosa Ortiz 2013 <esodan gmail com>
+ *
+ * libgda is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libgda is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* inclusion guard */
+#ifndef __GDA_SQL_EXPRESSION_PRIVATE_H__
+#define __GDA_SQL_EXPRESSION_PRIVATE_H__
+
+
+void                         _gda_sql_select_set_select       (GdaSqlSelect *select,
+                                                    const GdaSqlStatementSelect *s);
+const GdaSqlStatementSelect *_gda_sql_select_get_select       (GdaSqlSelect *select);
+
+/*
+ * Method definitions.
+ */
+
+#endif /* __GDA_SQL_EXPRESSION_PRIVATE_H__ */
diff --git a/libgda/gda-sql-select.c b/libgda/gda-sql-select.c
new file mode 100644
index 0000000..48ef440
--- /dev/null
+++ b/libgda/gda-sql-select.c
@@ -0,0 +1,52 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
+/*
+ * libgdadata
+ * Copyright (C) Daniel Espinosa Ortiz 2013 <esodan gmail com>
+ *
+ * libgda is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libgda is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gda-sql-select.h>
+#include <sql-parser/gda-statement-struct-parts.h>
+
+G_DEFINE_TYPE (GdaSqlSelect, gda_sql_select, G_TYPE_OBJECT);
+
+#define GDA_SQL_SELECT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDA_TYPE_SQL_SELECT, 
GdaSqlSelectPrivate))
+
+struct _GdaSqlSelectPrivate
+{
+  GdaSqlStatementSelect  *sel;
+};
+
+/* properties */
+enum
+{
+        PROP_0
+};
+
+static void
+gda_sql_select_class_init (GdaSqlSelectClass *klass)
+{
+  g_type_class_add_private (klass, sizeof (GdaSqlSelectPrivate));
+}
+
+static void
+gda_sql_select_init (GdaSqlSelect *self)
+{
+  GdaSqlSelectPrivate *priv;
+
+  self->priv = priv = GDA_SQL_SELECT_GET_PRIVATE (self);
+
+  priv->sel = g_new0 (GdaSqlStatementSelect, 1);
+}
diff --git a/libgda/gda-sql-select.h b/libgda/gda-sql-select.h
new file mode 100644
index 0000000..d78526d
--- /dev/null
+++ b/libgda/gda-sql-select.h
@@ -0,0 +1,66 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 2 -*- */
+/*
+ * libgdadata
+ * Copyright (C) Daniel Espinosa Ortiz 2013 <esodan gmail com>
+ *
+ * libgda is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libgda is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* inclusion guard */
+#ifndef __GDA_SQL_EXPRESSION_H__
+#define __GDA_SQL_EXPRESSION_H__
+
+#include <glib-object.h>
+/*
+ * Potentially, include other headers on which this header depends.
+ */
+
+/*
+ * Type macros.
+ */
+#define GDA_TYPE_SQL_EXPRESSION                  (gda_sql_expression_get_type ())
+#define GDA_SQL_EXPRESSION(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GDA_TYPE_SQL_EXPRESSION, GdaSqlSelect))
+#define GDA_IS_SQL_EXPRESSION(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GDA_TYPE_SQL_EXPRESSION))
+#define GDA_SQL_EXPRESSION_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GDA_TYPE_SQL_EXPRESSION, 
GdaSqlSelectClass))
+#define GDA_IS_SQL_EXPRESSION_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GDA_TYPE_SQL_EXPRESSION))
+#define GDA_SQL_EXPRESSION_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GDA_TYPE_SQL_EXPRESSION, 
GdaSqlSelectClass))
+
+typedef struct _GdaSqlSelect        GdaSqlSelect;
+typedef struct _GdaSqlSelectClass   GdaSqlSelectClass;
+typedef struct _GdaSqlSelectPrivate GdaSqlSelectPrivate;
+
+struct _GdaSqlSelect
+{
+  GObject parent_instance;
+
+  /* instance members */
+  GdaSqlSelectPrivate *priv;
+};
+
+struct _GdaSqlSelectClass
+{
+  GObjectClass parent_class;
+
+  /* class members */
+};
+
+/* used by GDA_TYPE_SQL_EXPRESSION */
+GType              gda_sql_select_get_type        (void);
+GdaSqlSelect      *gda_sql_select_new             (void);
+
+void               gda_sql_select_set_distinct       (GdaSqlSelect *select,
+                                                    gboolean distinct);
+const GValue      *gda_sql_select_get_distinct       (GdaSqlSelect *select);
+
+#endif /* __GDA_SQL_EXPRESSION_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]