1 #include <libmmanager/mm.h>
3 int main (int argc
, char ** argv
)
5 MMFilter
*filter
, *unserialized
;
9 MMAttributeManager
*am
;
14 am
= mm_attribute_base_manager_get ();
15 filter
= mm_filter_new ();
17 attr
= mm_attribute_manager_lookup_attribute (am
, "base::uri");
18 val
= mm_create_gvalue_for_attribute (attr
);
19 g_value_set_string (val
, "file:///foo");
20 fp
= mm_filter_param_new (attr
, val
, MM_COMP_EQUAL
);
21 mm_filter_add_filtering_param (filter
, fp
);
25 attr
= mm_attribute_manager_lookup_attribute (am
, "base::name");
26 val
= mm_create_gvalue_for_attribute (attr
);
27 g_value_set_string (val
, "Pippo");
28 fp
= mm_filter_param_new (attr
, val
, MM_COMP_GREATER
);
29 mm_filter_add_filtering_param (filter
, fp
);
33 serialized
= mm_filter_serialize (filter
);
34 g_print ("serialized filter \n%s\n", serialized
);
36 unserialized
= mm_filter_unserialize (serialized
);
39 g_object_unref (filter
);