This exemple shows how you can pass several types in function parameters :
static void print_value (Value val) {
print ("value-type : %s\n", val.type().name());
print ("value-content : %s\n\n", val.strdup_contents());
}
public static void main (string[] args) {
print_value (33);
print_value (24.46);
print_value ("string");
}
value-type : gint
value-content : 33
value-type : gdouble
value-content : 24.460000
value-type : gchararray
value-content : "string"
Note : if GObject can transform your value with 'string' type (gchararray), 'strdup_contents' returns converted value, instead of pointer adress
static void print_value (Value val) {
print ("value-type : %s\n", val.type().name());
print ("value-content : %s\n\n", val.strdup_contents());
}
public static void main (string[] args) {
print_value (new DateTime.now_local());
}
value-type : GDateTime
value-content : ((GDateTime*) 0x560337def040)