Re: [gnome-db] gda_value_new_from string()
- From: "Daniel Espinosa" <esodan gmail com>
- To: "Vivien Malerba" <vmalerba gmail com>
- Cc: GNOME-DB List <gnome-db-list gnome org>, bas driessen xobas com
- Subject: Re: [gnome-db] gda_value_new_from string()
- Date: Mon, 15 May 2006 14:57:07 -0500
The set_from_string() allows to transform an int to a string, it
should be used by the
gda_value_new_from_string() function, I'll correct this ASAP.
What about to register the functions to transform the types used by GDA
in the GLib's GType system, to simplify the code implementation?
I tested the following transformation, with out register any function and it works! using the following code for each type:
integer = g_new0(GValue, 1);
g_value_init(integer, G_TYPE_INT); // Substitude to any type
g_value_set_int(integer, -255); // Use the correct g_value_set_* function
g_value_transform(integer, string); // This is the transformation itself
g_string_printf(txt, "Integer to String: int = %s\n", g_value_get_string(string)); // printing the string
I tested to string the following types using GLib 2.8.3 in Ubuntu 5.10: INT, UINT, INT64, BOOLEAN
and from String: FLOAT, DOUBLE
--
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (entrámite, pero para los cuates: LIBRE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]