[Vala] Reflection : getting values in Gee.Collection
- From: Baptiste Gelez <gelezbaptiste openmailbox org>
- To: vala-list gnome org
- Subject: [Vala] Reflection : getting values in Gee.Collection
- Date: Sat, 09 Apr 2016 18:02:16 +0100
Hello everyone !
I would like to retrieve any property of an object. I presently use this
code :
HashMap<string, string> result = new HashMap<string, string> ();
foreach (ParamSpec spec in obj.get_class ().list_properties ()) {
GLib.Value val = GLib.Value (typeof (string));
obj.get_property (spec.get_nick (), ref val);
result [spec.get_nick ()] = (string) val;
}
return result;
There is no problem when I'm getting "simple" values like int, string,
double, etc ... But I would like to be able to get all the elements of
Gee.Collection. Have you got any idea of how to do that ?
Thanks ! (And excuse me for possible English mistakes)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]