Top | ![]() |
![]() |
![]() |
![]() |
#define | TIMEZONE_INVALID |
enum | GdaValueType |
GdaDate | |
GdaGeometricPoint | |
GdaMoney | |
GdaNumeric | |
GdaTime | |
GdaTimestamp | |
typedef | GdaValueList |
GdaValue | |
#define | GDA_TYPE_VALUE |
GdaValue *
gda_value_new_null (void
);
Makes a new GdaValue of type GDA_VALUE_TYPE_NULL.
GdaValue *
gda_value_new_bigint (gint64 val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_BIGINT with value val
.
GdaValue *
gda_value_new_biguint (guint64 val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_BIGUINT with value val
.
GdaValue * gda_value_new_binary (gconstpointer val
,glong size
);
Makes a new GdaValue of type GDA_VALUE_TYPE_BINARY with value val
.
val |
value to set for the new GdaValue. |
|
size |
the size of the memory pool pointer to by |
GdaValue *
gda_value_new_boolean (gboolean val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_BOOLEAN with value val
.
GdaValue *
gda_value_new_date (const GdaDate *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_DATE with value val
.
GdaValue *
gda_value_new_double (gdouble val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_DOUBLE with value val
.
GdaValue *
gda_value_new_geometric_point (const GdaGeometricPoint *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_GEOMETRIC_POINT with value
val
.
GdaValue *
gda_value_new_gobject (const GObject *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_GOBJECT with value val
.
GdaValue *
gda_value_new_integer (gint val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_INTEGER with value val
.
GdaValue *
gda_value_new_list (const GdaValueList *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_LIST with value val
.
GdaValue *
gda_value_new_numeric (const GdaNumeric *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_NUMERIC with value val
.
GdaValue *
gda_value_new_single (gfloat val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_SINGLE with value val
.
GdaValue *
gda_value_new_smallint (gshort val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLINT with value val
.
GdaValue *
gda_value_new_smalluint (gushort val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLUINT with value val
.
GdaValue *
gda_value_new_string (const gchar *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_STRING with value val
.
GdaValue *
gda_value_new_time (const GdaTime *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_TIME with value val
.
GdaValue *
gda_value_new_timestamp (const GdaTimestamp *val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val
.
GdaValue *
gda_value_new_timestamp_from_timet (time_t val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val
(of type time_t).
GdaValue *
gda_value_new_tinyint (gchar val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_TINYINT with value val
.
GdaValue *
gda_value_new_tinyuint (guchar val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_TINYUINT with value val
.
GdaValue *
gda_value_new_type (GdaValueType val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_TYPE with value val
.
GdaValue *
gda_value_new_uinteger (guint val
);
Makes a new GdaValue of type GDA_VALUE_TYPE_UINTEGER with value val
.
GdaValue * gda_value_new_from_string (const gchar *as_string
,GdaValueType type
);
Makes a new GdaValue of type type
from its string representation.
GdaValue *
gda_value_new_from_xml (const xmlNodePtr node
);
Creates a GdaValue from a XML representation of it. That XML node corresponds to the following string representation: <value type="gdatype">value</value>
void
gda_value_free (GdaValue *value
);
Deallocates all memory associated to a GdaValue.
GdaValueType
gda_value_get_type (GdaValue *value
);
Retrieves the type of the given value.
gboolean
gda_value_is_null (GdaValue *value
);
Tests if a given value
is of type GDA_VALUE_TYPE_NULL.
gboolean
gda_value_is_number (GdaValue *value
);
Gets whether the value stored in the given GdaValue is of numeric type or not.
GdaValue *
gda_value_copy (GdaValue *value
);
Creates a new GdaValue from an existing one.
gint64
gda_value_get_bigint (GdaValue *value
);
Gets the value stored in value
.
void gda_value_set_bigint (GdaValue *value
,gint64 val
);
Stores val
into value
.
void gda_value_set_biguint (GdaValue *value
,guint64 val
);
Stores val
into value
.
void gda_value_set_binary (GdaValue *value
,gconstpointer val
,glong size
);
Stores val
into value
.
value |
a GdaValue that will store |
|
val |
value to be stored in |
|
size |
the size of the memory pool pointed to by |
void gda_value_set_blob (GdaValue *value
,const GdaBlob *val
);
Stores val
into value
.
void gda_value_set_boolean (GdaValue *value
,gboolean val
);
Stores val
into value
.
void gda_value_set_date (GdaValue *value
,const GdaDate *val
);
Stores val
into value
.
void gda_value_set_double (GdaValue *value
,gdouble val
);
Stores val
into value
.
const GdaGeometricPoint *
gda_value_get_geometric_point (GdaValue *value
);
void gda_value_set_geometric_point (GdaValue *value
,const GdaGeometricPoint *val
);
Stores val
into value
.
void gda_value_set_gobject (GdaValue *value
,const GObject *val
);
Stores val
into value
.
void gda_value_set_integer (GdaValue *value
,gint val
);
Stores val
into value
.
void gda_value_set_list (GdaValue *value
,const GdaValueList *val
);
Stores val
into value
.
void
gda_value_set_null (GdaValue *value
);
Sets the type of value
to GDA_VALUE_TYPE_NULL.
void gda_value_set_money (GdaValue *value
,const GdaMoney *val
);
Stores val
into value
.
void gda_value_set_numeric (GdaValue *value
,const GdaNumeric *val
);
Stores val
into value
.
void gda_value_set_single (GdaValue *value
,gfloat val
);
Stores val
into value
.
void gda_value_set_smallint (GdaValue *value
,gshort val
);
Stores val
into value
.
void gda_value_set_smalluint (GdaValue *value
,gushort val
);
Stores val
into value
.
void gda_value_set_string (GdaValue *value
,const gchar *val
);
Stores val
into value
.
void gda_value_set_time (GdaValue *value
,const GdaTime *val
);
Stores val
into value
.
void gda_value_set_timestamp (GdaValue *value
,const GdaTimestamp *val
);
Stores val
into value
.
void gda_value_set_tinyint (GdaValue *value
,gchar val
);
Stores val
into value
.
void gda_value_set_tinyuint (GdaValue *value
,guchar val
);
Stores val
into value
.
void gda_value_set_uinteger (GdaValue *value
,guint val
);
Stores val
into value
.
void gda_value_set_vtype (GdaValue *value
,GdaValueType type
);
Stores type
into value
.
gboolean gda_value_set_from_string (GdaValue *value
,const gchar *as_string
,GdaValueType type
);
Stores the value data from its string representation as type
.
value |
a GdaValue that will store |
|
as_string |
the stringified representation of the value. |
|
type |
the type of the value |
gboolean gda_value_set_from_value (GdaValue *value
,const GdaValue *from
);
Sets the value of a GdaValue from another GdaValue. This
is different from gda_value_copy, which creates a new GdaValue.
gda_value_set_from_value, on the other hand, copies the contents
of copy
into value
, which must already be allocated.
gint gda_value_compare (GdaValue *value1
,GdaValue *value2
);
Compares two values of the same type.
gchar *
gda_value_stringify (GdaValue *value
);
Converts a GdaValue to its string representation as indicated by this table:
typedef struct { gushort hour; gushort minute; gushort second; glong timezone; /* # of seconds to the east UTC */ } GdaTime;
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;
typedef struct { GdaValueType type; union { gint64 v_bigint; guint64 v_biguint; gpointer v_binary; GdaBlob v_blob; gboolean v_boolean; GdaDate v_date; gdouble v_double; GdaGeometricPoint v_point; GObject *v_gobj; gint v_integer; GdaValueList *v_list; GdaMoney v_money; GdaNumeric v_numeric; gfloat v_single; gshort v_smallint; gushort v_smalluint; gchar *v_string; GdaTime v_time; GdaTimestamp v_timestamp; gchar v_tinyint; guchar v_tinyuint; GdaValueType v_type; guint v_uinteger; } value; glong binary_length; } GdaValue;