[Vala] GValue get type
- From: Antono Vasiljev <self antono info>
- To: vala-list gnome org
- Subject: [Vala] GValue get type
- Date: Sun, 11 Dec 2011 22:32:25 +0300
Hello All.
I trying to work with collections of (G)Values
and faced a problem. Sometimes i need to get type
of object in referenced by Value.
------------------------------------------
using Gee;
Value v = "hello";
var hash = new HashMap<string, Value?>();
hash["one"] = 1;
hash["two"] = "two";
int counter = 0;
foreach (var e in hash.entries) {
// THIS IS PSEUDOCODE
if (e.value.type == typeof(int)) {
counter += e.value;
}
}
------------------------------------------
How can i do it?
--
http://antono.info/
http://github.com/antono
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]