GNOME Data Access manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
A GdaValue holds the data for a (row, column) retrieved from a query to a database backend. The function provided here can get/set the data contained in it, obtain information about the type, get a string representation of the value... The functions gda_value_set_*() and gda_value_new_*() that receive a pointer to any data, get a newly allocated copy of the data.
#define GDA_VALUE_TYPE_GEOMETRIC_POINT TC_GNOME_Database_GeometricPoint |
GdaValue* gda_value_new_null (void); |
Make a new GdaValue of type GDA_VALUE_TYPE_NULL.
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_bigint (gint64 val); |
Make a new GdaValue of type GDA_VALUE_TYPE_BIGINT with value val.
GdaValue* gda_value_new_binary (gconstpointer val); |
NOT IMPLEMENTED YET!!! Make a new GdaValue of type GDA_VALUE_TYPE_BINARY with value val.
GdaValue* gda_value_new_boolean (gboolean val); |
Make a new GdaValue of type GDA_VALUE_TYPE_BOOLEAN with value val.
GdaValue* gda_value_new_date (const GdaDate *val); |
Make a new GdaValue of type GDA_VALUE_TYPE_DATE with value val.
GdaValue* gda_value_new_double (gdouble val); |
Make a new GdaValue of type GDA_VALUE_TYPE_DOUBLE with value val.
GdaValue* gda_value_new_geometric_point (const GdaGeometricPoint *val); |
Make a new GdaValue of type GDA_VALUE_TYPE_GEOMETRIC_POINT with value val.
GdaValue* gda_value_new_integer (gint val); |
Make a new GdaValue of type GDA_VALUE_TYPE_INTEGER with value val.
GdaValue* gda_value_new_list (const GdaValueList *val); |
Make a new GdaValue of type GDA_VALUE_TYPE_LIST with value val.
GdaValue* gda_value_new_single (gfloat val); |
Make a new GdaValue of type GDA_VALUE_TYPE_SINGLE with value val.
GdaValue* gda_value_new_smallint (gshort val); |
Make a new GdaValue of type GDA_VALUE_TYPE_SMALLINT with value val.
GdaValue* gda_value_new_string (const gchar *val); |
Make a new GdaValue of type GDA_VALUE_TYPE_STRING with value val.
GdaValue* gda_value_new_time (const GdaTime *val); |
Make a new GdaValue of type GDA_VALUE_TYPE_TIME with value val.
GdaValue* gda_value_new_timestamp (const GdaTimestamp *val); |
Make a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val.
GdaValue* gda_value_new_tinyint (gchar val); |
Make a new GdaValue of type GDA_VALUE_TYPE_TINYINT with value val.
void gda_value_free (GdaValue *value); |
Deallocates all memory associated to a GdaValue.
gboolean gda_value_isa (const GdaValue *value, GdaValueType type); |
Test if a given value is of type type.
gboolean gda_value_is_null (GdaValue *value); |
Tests if a given value is of type GDA_VALUE_TYPE_NULL.
value : | value to test. |
Returns : | a boolean that says whether or not value is of type GDA_VALUE_TYPE_NULL. |
GdaValue* gda_value_copy (GdaValue *value); |
Creates a new GdaValue from an existing one.
value : | value to get a copy from. |
Returns : | a newly allocated GdaValue with a copy of the data in value. |
gint64 gda_value_get_bigint (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_bigint (GdaValue *value, gint64 val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
gconstpointer gda_value_get_binary (GdaValue *value); |
NOT IMPLEMENTED YET!!! Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_binary (GdaValue *value, gconstpointer val, glong size); |
NOT IMPLEMENTED YET!!! Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
size : | the size of the memory pool pointed to by val. |
gboolean gda_value_get_boolean (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_boolean (GdaValue *value, gboolean val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GdaDate* gda_value_get_date (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_date (GdaValue *value, GdaDate *val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
gdouble gda_value_get_double (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_double (GdaValue *value, gdouble val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GdaGeometricPoint* gda_value_get_geometric_point (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_geometric_point (GdaValue *value, GdaGeometricPoint *val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
gint gda_value_get_integer (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_integer (GdaValue *value, gint val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GdaValueList* gda_value_get_list (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_list (GdaValue *value, GdaValueList *val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
void gda_value_set_null (GdaValue *value); |
Sets the type of value to GDA_VALUE_TYPE_NULL.
value : | a GdaValue that will store a value of type GDA_VALUE_TYPE_NULL. |
gfloat gda_value_get_single (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_single (GdaValue *value, gfloat val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
gshort gda_value_get_smallint (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_smallint (GdaValue *value, gshort val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const gchar* gda_value_get_string (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_string (GdaValue *value, const gchar *val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GdaTime* gda_value_get_time (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_time (GdaValue *value, GdaTime *val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GdaTimestamp* gda_value_get_timestamp (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_timestamp (GdaValue *value, GdaTimestamp *val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
gchar gda_value_get_tinyint (GdaValue *value); |
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : | the value contained in value. |
void gda_value_set_tinyint (GdaValue *value, gchar val); |
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
gchar* gda_value_stringify (GdaValue *value); |
Converts a GdaValue to its string representation as indicated by this table:
Data type | String representation in printf() format |
---|---|
GDA_VALUE_TYPE_BIGINT | "%ld" |
GDA_VALUE_TYPE_BOOLEAN | "TRUE" | "FALSE" |
GDA_VALUE_TYPE_STRING | "%s" |
GDA_VALUE_TYPE_INTEGER | "%d" |
GDA_VALUE_TYPE_SMALLINT | "%d" |
GDA_VALUE_TYPE_SINGLE | "%f" |
GDA_VALUE_TYPE_DOUBLE | "%f" |
GDA_VALUE_TYPE_TIME (w/o TZ) | "%02u:%02u:%02u" |
GDA_VALUE_TYPE_TIME (with TZ) | "%02u:%02u:%02u%+03d" |
GDA_VALUE_TYPE_DATE | "%04u-%02u-%02u" |
GDA_VALUE_TYPE_TIMESTAMP (w/o TZ) | "%04u-%02u-%02u %02u:%02u:%02u.%03d" |
GDA_VALUE_TYPE_TIMESTAMP (with TZ) | "%04u-%02u-%02u %02u:%02u:%02u.%03d%+03d" |
GDA_VALUE_TYPE_GEOMETRIC_POINT | "(%.*g,%.*g)" (precision set to the maximum) |
GDA_VALUE_TYPE_NULL | "NULL" |
GDA_VALUE_TYPE_LIST | { "%s", "%s"... } |
Not in the list | "" |
value : | a GdaValue. |
Returns : | a string formatted according to the printf() style indicated in the preceding table. |