OsinfoFilter

## OsinfoFilter OsinfoFilter — An entity filter |

## Synopsis

    struct              OsinfoFilter;
    struct              OsinfoFilterClass;
    OsinfoFilter *      osinfo_filter_new                   (void);
    void                osinfo_filter_add_constraint        (OsinfoFilter *filter,
                                                             const gchar *propName,
                                                             const gchar *propVal);
    void                osinfo_filter_clear_constraint      (OsinfoFilter *filter,
                                                             const gchar *propName);
    void                osinfo_filter_clear_constraints     (OsinfoFilter *filter);
    GList *             osinfo_filter_get_constraint_keys   (OsinfoFilter *filter);
    GList *             osinfo_filter_get_constraint_values (OsinfoFilter *filter,
                                                             const gchar *propName);
    gboolean            osinfo_filter_matches               (OsinfoFilter *filter,
                                                             OsinfoEntity *entity);

## Object Hierarchy

      GObject
       +----OsinfoFilter
             +----OsinfoDeviceLinkFilter
             +----OsinfoProductFilter

## Description

OsinfoFilter provides a way to filter OsinfoEntity instances based on their parameter values.

## Details

### struct OsinfoFilter

    struct OsinfoFilter;

### struct OsinfoFilterClass

    struct OsinfoFilterClass {
    };

### osinfo_filter_new ()

    OsinfoFilter *      osinfo_filter_new                   (void);

Construct a new filter that matches all entities

Returns : | a filter object. [transfer full]

### osinfo_filter_add_constraint ()

    void                osinfo_filter_add_constraint        (OsinfoFilter *filter,
                                                             const gchar *propName,
                                                             const gchar *propVal);

Adds a constraint that requires the entity to have a property key `propName` with a value of `propVal`. If multiple constraints are added for the same `propName`, with different values, the entity have all property values.

`filter` : | a filter object
`propName` : | the name of the parameter key
`propVal` : | the required property value

### osinfo_filter_clear_constraint ()

    void                osinfo_filter_clear_constraint      (OsinfoFilter *filter,
                                                             const gchar *propName);

Remove all filter constraints for the matching property name.

`filter` : | a filter object
`propName` : | name of the key to remove constraints for

### osinfo_filter_clear_constraints ()

    void                osinfo_filter_clear_constraints     (OsinfoFilter *filter);

Remove all filter property constraints

`filter` : | a filter object

### osinfo_filter_get_constraint_keys ()

    GList *             osinfo_filter_get_constraint_keys   (OsinfoFilter *filter);

Get a list of all constraint property keys

`filter` : | a filter object
Returns : | List of constraint keys. [transfer container][element-type utf8]

### osinfo_filter_get_constraint_values ()

    GList *             osinfo_filter_get_constraint_values (OsinfoFilter *filter,
                                                             const gchar *propName);

Get a list values for filter constriants with the named key

`filter` : | a filter object
`propName` : | the name of the key
Returns : | List of constraint values. [transfer container][element-type utf8]

### osinfo_filter_matches ()

    gboolean            osinfo_filter_matches               (OsinfoFilter *filter,
                                                             OsinfoEntity *entity);

Determine of an entity matches a filter

`filter` : | a filter object
`entity` : | an entity to query
Returns : | TRUE if entity passes the filter, FALSE otherwise

## See Also

OsinfoEntity