[libgda/libgda-vala] Added documentation to GdaSqlExpression methods. Removed GdaSqlSelect object.



commit 88251ffd59b22720bec1422850616a794cde6365
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed May 15 12:57:44 2013 -0500

    Added documentation to GdaSqlExpression methods. Removed GdaSqlSelect object.

 libgda/gda-sql-expression.c     |  174 +++++++++++++++++++++++++++++++++++----
 libgda/gda-sql-expression.h     |   14 ++--
 libgda/gda-sql-select-private.h |   33 --------
 libgda/gda-sql-select.c         |   52 ------------
 libgda/gda-sql-select.h         |   74 -----------------
 5 files changed, 165 insertions(+), 182 deletions(-)
---
diff --git a/libgda/gda-sql-expression.c b/libgda/gda-sql-expression.c
index 74761bd..f84765d 100644
--- a/libgda/gda-sql-expression.c
+++ b/libgda/gda-sql-expression.c
@@ -57,106 +57,250 @@ gda_sql_expression_init (GdaSqlExpression *self)
   priv->type = GDA_SQL_EXPRESSION_TYPE_VALUE;
 }
 
+
+/**
+ * gda_sql_expression_new:
+ * @type: a #GdaSqlExpressionType
+ *
+ * Returns: (transfer-full): a new #GdaSqlExpression object
+ */
 GdaSqlExpression *
 gda_sql_expression_new (GdaSqlExpressionType type)
 {}
 
+/**
+ * gda_sql_expression_new_from_string:
+ * @str: a string describing an expression
+ *
+ * Returns: (transfer-full): a new #GdaSqlExpression object
+ */
 GdaSqlExpression*
 gda_sql_expression_new_from_string (const gchar* str)
 {}
 
+/**
+ * gda_sql_expression_to_string:
+ * @expr: a #GdaSqlExpression
+ *
+ * Returns: (transfer-full): a new string representing a #GdaSqlExpression
+ */
 gchar*
 gda_sql_expression_to_string (GdaSqlExpression *expr)
 {}
 
+/**
+ * gda_sql_expression_check_clean:
+ * @expr: a #GdaSqlExpression
+ *
+ */
 void
 gda_sql_expression_check_clean (GdaSqlExpression *expr)
 {}
 
-void
-gda_sql_expression_take_select (GdaSqlExpression *expr, 
-                                GdaStatement *stm)
-{}
-
+/**
+ * gda_sql_expression_set_value:
+ * @expr: a #GdaSqlExpression
+ * @val: a #GValue to be used by @expr
+ *
+ * Sets @val to be used by a #GdaSqlExpression of type
+ * #GDA_SQL_EXPRESSION_TYPE_VALUE
+ */
 void
 gda_sql_expression_set_value (GdaSqlExpression *expr,
                               const GValue *val)
 {}
 
+/**
+ * gda_sql_expression_get_value:
+ * @expr: a #GdaSqlExpression
+ *
+ * Returns: (transfer-none): the #GValue used as an expresion
+ */
 const GValue*
 gda_sql_expression_get_value (GdaSqlExpression *expr)
 {}
 
-
+/**
+ * gda_sql_expression_set_variable_pspec:
+ * @expr: a #GdaSqlExpression
+ * @spec: a #GdaSqlParamSpec
+ *
+ * To be used by a #GdaSqlExpression of type #GDA_SQL_EXPRESSION_TYPE_VALUE.
+ */
 void
 gda_sql_expression_set_variable_pspec (GdaSqlExpression *expr,
                                        const GdaSqlParamSpec *spec)
 {}
 
+/**
+ * gda_sql_expression_get_variable_pspec:
+ * @expr: a #GdaSqlExpression
+ *
+ * Returns: (transfer-full): a #GdaSqlParamSpec used by @expr of type
+ * #GDA_SQL_EXPRESSION_TYPE_VALUE
+ */
 GdaSqlParamSpec*
 gda_sql_expression_get_variable_pspec (GdaSqlExpression *expr)
 {}
 
-
+/**
+ * gda_sql_expression_set_function_name:
+ * @expr: a #GdaSqlExpression
+ * @name: a string with the function's name
+ *
+ * Sets a function's name of a #GdaSqlExpression of type
+ * #GDA_SQL_EXPRESSION_TYPE_FUNCTION
+ */
 void
 gda_sql_expression_set_function_name (GdaSqlExpression *expr,
                                       const gchar *name)
 {}
 
+/**
+ * gda_sql_expression_set_function_args:
+ * @expr: a #GdaSqlExpression
+ * @args: (element-type Gda.SqlExpression): a list of arguments for a function
+ *
+ * Sets arguments of a function to a #GdaSqlExpression of type
+ * #GDA_SQL_EXPRESSION_TYPE_FUNCTION.
+ */
 void
 gda_sql_expression_set_function_args (GdaSqlExpression *expr,
                                       const GSList *args)
 {}
 
+/**
+ * gda_sql_expression_set_operator_type:
+ * @expr: a #GdaSqlExpression
+ * @optype: a #GdaSqlExpressionType
+ *
+ * Sets operator's type of a #GdaSqlExpression of type
+ * #GDA_SQL_EXPRESSION_TYPE_CONDITION
+ */
 void
 gda_sql_expression_set_operator_type  (GdaSqlExpression *expr,
                                        GdaSqlOperatorType optype)
 {}
 
+/**
+ * gda_sql_expression_set_operator_operands:
+ * @expr: a #GdaSqlExpression
+ * @operands: (element-type Gda.SqlExpression): a lists of #GdaSqlExpression
+ * expresions
+ *
+ */
 void
 gda_sql_expression_set_operator_operands (GdaSqlExpression *expr,
                                           const GSList *operands)
 {}
 
+/**
+ * gda_sql_expression_set_select:
+ * @expr: a #GdaSqlExpression
+ * @select: a #GdaStatement to be used as a sub-select expression
+ *
+ */
 void
 gda_sql_expression_set_select (GdaSqlExpression *expr,
                                GdaStatement *select)
 {}
 
-GdaSqlSelect*
+/**
+ * gda_sql_expression_get_select:
+ * @expr: a #GdaSqlExpression
+ *
+ * Returns: a #GdaStatement of type #GDA_SQL_STATEMENT_SELECT
+ */
+GdaStatement*
 gda_sql_expression_get_select (GdaSqlExpression *expr)
 {}
 
+/**
+ * gda_sql_expression_set_compound:
+ * @expr: a #GdaSqlExpression
+ * @compound: a #GdaStatement
+ *
+ * Uses a #GdaStatement of type #GDA_SQL_STATEMENT_COMPOUND as an expression
+ * when @expr is of type #GDA_SQL_EXPRESSION_TYPE_COMPOUND.
+ */
 void
 gda_sql_expression_set_compound (GdaSqlExpression *expr,
                                  GdaStatement *compound)
 {}
 
-GdaSqlCompound*
-gda_sql_expression_set_compound (GdaSqlExpression *expr)
+/**
+ * gda_sql_expression_get_compound:
+ * @expr: a #GdaSqlExpression
+ *
+ * Used to get a #GdaStatement of type #GDA_SQL_STATEMENT_COMPOUND used as an
+ * expression when @expr is of type #GDA_SQL_EXPRESSION_TYPE_COMPOUND.
+ *
+ * Returns: (transfer-none): a #GdaStatement of type #GDA_SQL_STATEMENT_COMPOUND
+ */
+GdaStatement*
+gda_sql_expression_get_compound (GdaSqlExpression *expr)
 {}
 
+/**
+ * gda_sql_expression_set_case_expr:
+ * @expr: a #GdaSqlExpression
+ * @case_expr: a #GdaSqlExpression used by a CASE expresion
+ *
+ * Sets a #GdaSqlExpression to be used as the expression by an CASE clausure,
+ * when @expr is of type #GDA_SQL_EXPRESSION_TYPE_CASE.
+ */
 void
 gda_sql_expression_set_case_expr (GdaSqlExpression *expr,
-                                  GdaSqlExpression *e)
+                                  GdaSqlExpression *case_expr)
 {}
 
+/**
+ * gda_sql_expression_set_case_when:
+ * @expr: a #GdaSqlExpression
+ * @when_exprs: (element-type Gda.SqlExpression): a list of #GdaSqlExpression
+ *
+ * Sets the expressions in the WHEN clause of a CASE, when @expr is of type
+ * #GDA_SQL_EXPRESSION_TYPE_CASE.
+ */
 void
 gda_sql_expression_set_case_when (GdaSqlExpression *expr,
-                                  const GSList *when)
+                                  const GSList *when_exprs)
 {}
 
+/**
+ * gda_sql_expression_set_case_then:
+ * @expr: a #GdaSqlExpression
+ * @then_exprs: (element-type Gda.SqlExpression): a list of #GdaSqlExpression
+ *
+ * Sets the expressions in the THEN clause of a CASE, when @expr is of type
+ * #GDA_SQL_EXPRESSION_TYPE_CASE.
+ */
 void
 gda_sql_expression_set_case_then (GdaSqlExpression *expr,
-                                  const GSList *then)
+                                  const GSList *then_exprs)
 {}
 
+/**
+ * gda_sql_expression_set_case_else:
+ * @expr: a #GdaSqlExpression
+ * @else_exprs: (element-type Gda.SqlExpression): a list of #GdaSqlExpression
+ *
+ * Sets the expressions in the ELSE clause of a CASE, when @expr is of type
+ * #GDA_SQL_EXPRESSION_TYPE_CASE.
+ *
+ */
 void
 gda_sql_expression_set_case_else (GdaSqlExpression *expr,
-                                  const GSList *_else)
+                                  const GSList *else_exprs)
 {}
 
+/**
+ * gda_sql_expression_set_cast_as:
+ * @expr: a #GdaSqlExpression
+ * @cast_as: a #GType representing a data type to cast to
+ *
+ */
 void
 gda_sql_expression_set_cast_as (GdaSqlExpression *expr,
-                                const gchar *cast_as)
+                                GType cast_as)
 {}
diff --git a/libgda/gda-sql-expression.h b/libgda/gda-sql-expression.h
index 06571ed..911fbb6 100644
--- a/libgda/gda-sql-expression.h
+++ b/libgda/gda-sql-expression.h
@@ -74,8 +74,6 @@ GdaSqlExpression  *gda_sql_expression_new             (GdaSqlExpressionType type
 GdaSqlExpression  *gda_sql_expression_new_from_string (const gchar* str);
 gchar             *gda_sql_expression_to_string       (GdaSqlExpression *expr);
 void               gda_sql_expression_check_clean     (GdaSqlExpression *expr);
-void               gda_sql_expression_take_select     (GdaSqlExpression *expr, 
-                                                    GdaStatement *stm);
 
 void               gda_sql_expression_set_value       (GdaSqlExpression *expr,
                                                     const GValue *val);
@@ -104,20 +102,20 @@ GdaSqlSelect      *gda_sql_expression_get_select      (GdaSqlExpression *expr);
 
 void               gda_sql_expression_set_compound    (GdaSqlExpression *expr,
                                                     GdaStatement *compound);
-GdaSqlCompound    *gda_sql_expression_set_compound    (GdaSqlExpression *expr);
+GdaStatement      *gda_sql_expression_get_compound    (GdaSqlExpression *expr);
 
 
 void               gda_sql_expression_set_case_expr   (GdaSqlExpression *expr,
-                                                    GdaSqlExpression *e);
+                                                    GdaSqlExpression *case_expr);
 void               gda_sql_expression_set_case_when   (GdaSqlExpression *expr,
-                                                    const GSList *when);
+                                                    const GSList *when_exprs);
 void               gda_sql_expression_set_case_then   (GdaSqlExpression *expr,
-                                                    const GSList *then);
+                                                    const GSList *then_exprs);
 void               gda_sql_expression_set_case_else   (GdaSqlExpression *expr,
-                                                    const GSList *_else);
+                                                    const GSList *else_exprs);
 
 
 void               gda_sql_expression_set_cast_as     (GdaSqlExpression *expr,
-                                                    const gchar *cast_as);
+                                                    GType cast_as);
 
 #endif /* __GDA_SQL_EXPRESSION_H__ */


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