Changeset 26142


Ignore:
Timestamp:
05/18/10 15:29:56 (7 years ago)
Author:
piotras
Message:

Copied r26141

Location:
trunk/midgard/core/midgard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/midgard/core/midgard/doc/C/midgard-2.0-sections.txt

    r25944 r26142  
    557557MidgardQueryConstraintClass
    558558midgard_query_constraint_new
    559 midgard_query_constraint_get_value 
    560 midgard_query_constraint_set_value
    561559midgard_query_constraint_get_storage
    562560midgard_query_constraint_set_storage
     
    594592MidgardQueryConstraintGroupClass
    595593midgard_query_constraint_group_new
     594midgard_query_constraint_group_new_valist
     595midgard_query_constraint_group_new_with_constraints
    596596midgard_query_constraint_group_get_group_type
     597midgard_query_constraint_group_set_group_type
    597598midgard_query_constraint_group_add_constraint
    598599<SUBSECTION Standard>
  • trunk/midgard/core/midgard/src/midgard_query_constraint_group.c

    r25919 r26142  
    3333/**
    3434 * midgard_query_constraint_group_new:
     35 *
     36 * Create new #MidgardQueryConstraintGroup instance with default "AND" group type.
     37 *
     38 * Returns: #MidgardQueryConstraintGroup instance or %NULL
     39 *
     40 * Since: 10.05.1
     41 */
     42MidgardQueryConstraintGroup *
     43midgard_query_constraint_group_new (void)
     44{       
     45        return midgard_query_constraint_group_new_valist ("AND", NULL);
     46}
     47
     48/**
     49 * midgard_query_constraint_group_new_with_constraints:
     50 * @type: constraints group type
     51 * @constraints: an array of #MidgardQueryConstraintSimple constraints
     52 * @n_constraints: the length of given constraints array
     53 *
     54 * Returns: #MidgardQueryConstraintGroup instance or %NULL
     55 *
     56 * Since: 10.05.1
     57 */
     58MidgardQueryConstraintGroup *
     59midgard_query_constraint_group_new_with_constraints (const gchar *type, MidgardQueryConstraintSimple **constraints, guint n_constraints)
     60{
     61        g_return_val_if_fail (type != NULL, NULL);
     62        g_return_val_if_fail (constraints != NULL, NULL);
     63
     64        MidgardQueryConstraintGroup *self = midgard_query_constraint_group_new_valist (type, NULL);
     65        if (!self)
     66                return NULL;
     67
     68        if (n_constraints == 0)
     69                return self;
     70
     71        guint i;
     72        for (i = 0; i < n_constraints; i++) {
     73                midgard_query_constraint_group_add_constraint (self, constraints[i], NULL);
     74        }
     75
     76        return self;
     77}
     78
     79/**
     80 * midgard_query_constraint_group_new_valist:
    3581 * @type: constraints group type ('OR' or 'AND')
    3682 * @constraint: list of constraints to add to group or NULL
     83 *
     84 * This is C convinient function. It's not designed for language bindings.
    3785 *
    3886 * Returns: #MidgardQueryConstraintGroup instance or %NULL
    3987 *
    40  * Since: 10.05
     88 * Since: 10.05.1
    4189 */
    4290MidgardQueryConstraintGroup *
    43 midgard_query_constraint_group_new (const gchar *type, MidgardQueryConstraintSimple *constraint, ...)
     91midgard_query_constraint_group_new_valist (const gchar *type, MidgardQueryConstraintSimple *constraint, ...)
    4492{
    4593        g_return_val_if_fail (type != NULL, NULL);
  • trunk/midgard/core/midgard/src/midgard_query_constraint_group.h

    r25919 r26142  
    5353
    5454GType                           midgard_query_constraint_group_get_type         (void);
    55 MidgardQueryConstraintGroup     *midgard_query_constraint_group_new             (const gchar *type, MidgardQueryConstraintSimple *constraint, ...);
     55MidgardQueryConstraintGroup     *midgard_query_constraint_group_new             (void);
     56MidgardQueryConstraintGroup     *midgard_query_constraint_group_new_valist      (const gchar *type, MidgardQueryConstraintSimple *constraint, ...);
     57MidgardQueryConstraintGroup     *midgard_query_constraint_group_new_with_constraints    (const gchar *type, MidgardQueryConstraintSimple **constraints, guint n_constraints);
    5658const gchar                     *midgard_query_constraint_group_get_group_type  (MidgardQueryConstraintGroup *self);
    5759gboolean                        midgard_query_constraint_group_set_group_type           (MidgardQueryConstraintGroup *self, const gchar *type);
Note: See TracChangeset for help on using the changeset viewer.