Description
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.
Details
TIMEZONE_INVALID
#define TIMEZONE_INVALID (2*12*60*60) |
GdaValue
typedef struct {
GdaValueType type;
union {
gint64 v_bigint;
gpointer v_binary;
gboolean v_boolean;
GdaDate v_date;
gdouble v_double;
GdaGeometricPoint v_point;
gint v_integer;
GdaValueList *v_list;
GdaNumeric v_numeric;
gfloat v_single;
gshort v_smallint;
gchar *v_string;
GdaTime v_time;
GdaTimestamp v_timestamp;
gchar v_tinyint;
} value;
} GdaValue; |
GdaValueList
typedef GList GdaValueList; |
enum GdaValueType
typedef enum {
GDA_VALUE_TYPE_NULL,
GDA_VALUE_TYPE_BIGINT,
GDA_VALUE_TYPE_BINARY,
GDA_VALUE_TYPE_BOOLEAN,
GDA_VALUE_TYPE_DATE,
GDA_VALUE_TYPE_DOUBLE,
GDA_VALUE_TYPE_GEOMETRIC_POINT,
GDA_VALUE_TYPE_INTEGER,
GDA_VALUE_TYPE_LIST,
GDA_VALUE_TYPE_NUMERIC,
GDA_VALUE_TYPE_SINGLE,
GDA_VALUE_TYPE_SMALLINT,
GDA_VALUE_TYPE_STRING,
GDA_VALUE_TYPE_TIME,
GDA_VALUE_TYPE_TIMESTAMP,
GDA_VALUE_TYPE_TINYINT,
GDA_VALUE_TYPE_UNKNOWN
} GdaValueType; |
GdaDate
typedef struct {
gshort year;
gushort month;
gushort day;
} GdaDate; |
GdaGeometricPoint
typedef struct {
gdouble x;
gdouble y;
} GdaGeometricPoint; |
GdaNumeric
typedef struct {
gchar *number;
glong precision;
glong width;
} GdaNumeric; |
GdaTime
typedef struct {
gushort hour;
gushort minute;
gushort second;
glong timezone; // # of seconds to the east UTC
} GdaTime; |
GdaTimestamp
typedef struct {
gshort year;
gushort month;
gushort day;
gushort hour;
gushort minute;
gushort second;
gulong fraction;
glong timezone; // # of seconds to the east UTC
} GdaTimestamp; |
gda_value_new_null ()
Make a new GdaValue of type GDA_VALUE_TYPE_NULL.
gda_value_new_bigint ()
Make a new GdaValue of type GDA_VALUE_TYPE_BIGINT with value val.
gda_value_new_binary ()
NOT IMPLEMENTED YET!!!
Make a new GdaValue of type GDA_VALUE_TYPE_BINARY with value val.
gda_value_new_boolean ()
Make a new GdaValue of type GDA_VALUE_TYPE_BOOLEAN with value val.
gda_value_new_date ()
Make a new GdaValue of type GDA_VALUE_TYPE_DATE with value val.
gda_value_new_double ()
Make a new GdaValue of type GDA_VALUE_TYPE_DOUBLE with value val.
gda_value_new_geometric_point ()
Make a new GdaValue of type GDA_VALUE_TYPE_GEOMETRIC_POINT with value
val.
gda_value_new_integer ()
Make a new GdaValue of type GDA_VALUE_TYPE_INTEGER with value val.
gda_value_new_list ()
Make a new GdaValue of type GDA_VALUE_TYPE_LIST with value val.
gda_value_new_numeric ()
Make a new GdaValue of type GDA_VALUE_TYPE_NUMERIC with value val.
gda_value_new_single ()
Make a new GdaValue of type GDA_VALUE_TYPE_SINGLE with value val.
gda_value_new_smallint ()
Make a new GdaValue of type GDA_VALUE_TYPE_SMALLINT with value val.
gda_value_new_string ()
Make a new GdaValue of type GDA_VALUE_TYPE_STRING with value val.
gda_value_new_time ()
Make a new GdaValue of type GDA_VALUE_TYPE_TIME with value val.
gda_value_new_timestamp ()
Make a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val.
gda_value_new_tinyint ()
Make a new GdaValue of type GDA_VALUE_TYPE_TINYINT with value val.
gda_value_free ()
Deallocates all memory associated to a GdaValue.
gda_value_isa ()
Test if a given value is of type type.
gda_value_is_null ()
Tests if a given value is of type GDA_VALUE_TYPE_NULL.
gda_value_copy ()
Creates a new GdaValue from an existing one.
gda_value_get_bigint ()
Gets the value stored in value.
gda_value_set_bigint ()
Stores val into value.
gda_value_get_binary ()
NOT IMPLEMENTED YET!!!
Gets the value stored in value.
gda_value_set_binary ()
NOT IMPLEMENTED YET!!!
Stores val into value.
gda_value_get_boolean ()
Gets the value stored in value.
gda_value_set_boolean ()
Stores val into value.
gda_value_get_date ()
Gets the value stored in value.
gda_value_set_date ()
Stores val into value.
gda_value_get_double ()
Gets the value stored in value.
gda_value_set_double ()
Stores val into value.
gda_value_get_geometric_point ()
Gets the value stored in value.
gda_value_set_geometric_point ()
Stores val into value.
gda_value_get_integer ()
Gets the value stored in value.
gda_value_set_integer ()
Stores val into value.
gda_value_get_list ()
Gets the value stored in value.
gda_value_set_list ()
Stores val into value.
gda_value_set_null ()
void gda_value_set_null (GdaValue *value); |
Sets the type of value to GDA_VALUE_TYPE_NULL.
gda_value_get_numeric ()
Gets the value stored in value.
gda_value_set_numeric ()
Stores val into value.
gda_value_get_single ()
Gets the value stored in value.
gda_value_set_single ()
Stores val into value.
gda_value_get_smallint ()
Gets the value stored in value.
gda_value_set_smallint ()
Stores val into value.
gda_value_get_string ()
Gets the value stored in value.
gda_value_set_string ()
Stores val into value.
gda_value_get_time ()
Gets the value stored in value.
gda_value_set_time ()
Stores val into value.
gda_value_get_timestamp ()
Gets the value stored in value.
gda_value_set_timestamp ()
Stores val into value.
gda_value_get_tinyint ()
Gets the value stored in value.
gda_value_set_tinyint ()
Stores val into value.
gda_value_stringify ()
Converts a GdaValue to its string representation as indicated by this
table: