| Libosinfo Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
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);
OsinfoFilter provides a way to filter OsinfoEntity instances based on their parameter values.
struct OsinfoFilterClass {
GObjectClass parent_class;
/* class members */
gboolean (*matches)(OsinfoFilter *filter, OsinfoEntity *entity);
};
OsinfoFilter * osinfo_filter_new (void);
Construct a new filter that matches all entities
Returns : |
a filter object. [transfer full] |
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.
|
a filter object |
|
the name of the parameter key |
|
the required property value |
void osinfo_filter_clear_constraint (OsinfoFilter *filter,const gchar *propName);
Remove all filter constraints for the matching property name.
|
a filter object |
|
name of the key to remove constraints for |
void osinfo_filter_clear_constraints (OsinfoFilter *filter);
Remove all filter property constraints
|
a filter object |
GList * osinfo_filter_get_constraint_keys (OsinfoFilter *filter);
Get a list of all constraint property keys
|
a filter object |
Returns : |
List of constraint keys. [transfer container][element-type utf8] |
GList * osinfo_filter_get_constraint_values (OsinfoFilter *filter,const gchar *propName);
Get a list values for filter constriants with the named key
|
a filter object |
|
the name of the key |
Returns : |
List of constraint values. [transfer container][element-type utf8] |
gboolean osinfo_filter_matches (OsinfoFilter *filter,OsinfoEntity *entity);
Determine of an entity matches a filter
|
a filter object |
|
a entity to query |
Returns : |
TRUE if entity passes the filter, FALSE otherwise |