GNOME Data Access manual |
---|
#define TIMEZONE_INVALID enum GdaValueType; typedef GdaDate; typedef GdaGeometricPoint; typedef GdaMoney; typedef GdaNumeric; typedef GdaTime; typedef GdaTimestamp; typedef GdaValueList; typedef GdaValue; GdaValue* gda_value_new_null (void); GdaValue* gda_value_new_bigint (gint64 val); GdaValue* gda_value_new_binary (gconstpointer val, glong size); GdaValue* gda_value_new_boolean (gboolean val); GdaValue* gda_value_new_date (const GdaDate *val); GdaValue* gda_value_new_double (gdouble val); GdaValue* gda_value_new_geometric_point (const GdaGeometricPoint *val); GdaValue* gda_value_new_gobject (const GObject *val); GdaValue* gda_value_new_integer (gint val); GdaValue* gda_value_new_list (const GdaValueList *val); GdaValue* gda_value_new_money (const GdaMoney *val); GdaValue* gda_value_new_numeric (const GdaNumeric *val); GdaValue* gda_value_new_single (gfloat val); GdaValue* gda_value_new_smallint (gshort val); GdaValue* gda_value_new_string (const gchar *val); GdaValue* gda_value_new_time (const GdaTime *val); GdaValue* gda_value_new_timestamp (const GdaTimestamp *val); GdaValue* gda_value_new_timestamp_from_timet (time_t val); GdaValue* gda_value_new_tinyint (gchar val); GdaValue* gda_value_new_type (GdaValueType val); GdaValue* gda_value_new_from_string (const gchar *as_string, GdaValueType type); GdaValue* gda_value_new_from_xml (const xmlNodePtr node); void gda_value_free (GdaValue *value); GdaValueType gda_value_get_type (GdaValue *value); #define gda_value_isa (value,type) gboolean gda_value_is_null (GdaValue *value); gboolean gda_value_is_number (GdaValue *value); GdaValue* gda_value_copy (const GdaValue *value); gint64 gda_value_get_bigint (GdaValue *value); void gda_value_set_bigint (GdaValue *value, gint64 val); gconstpointer gda_value_get_binary (GdaValue *value, glong *size); void gda_value_set_binary (GdaValue *value, gconstpointer val, glong size); gboolean gda_value_get_boolean (GdaValue *value); void gda_value_set_boolean (GdaValue *value, gboolean val); const GdaDate* gda_value_get_date (GdaValue *value); void gda_value_set_date (GdaValue *value, const GdaDate *val); gdouble gda_value_get_double (GdaValue *value); void gda_value_set_double (GdaValue *value, gdouble val); const GdaGeometricPoint* gda_value_get_geometric_point (GdaValue *value); void gda_value_set_geometric_point (GdaValue *value, const GdaGeometricPoint *val); const GObject* gda_value_get_gobject (GdaValue *value); void gda_value_set_gobject (GdaValue *value, const GObject *val); gint gda_value_get_integer (GdaValue *value); void gda_value_set_integer (GdaValue *value, gint val); const GdaValueList* gda_value_get_list (GdaValue *value); void gda_value_set_list (GdaValue *value, const GdaValueList *val); void gda_value_set_null (GdaValue *value); const GdaMoney* gda_value_get_money (GdaValue *value); void gda_value_set_money (GdaValue *value, const GdaMoney *val); const GdaNumeric* gda_value_get_numeric (GdaValue *value); void gda_value_set_numeric (GdaValue *value, const GdaNumeric *val); gfloat gda_value_get_single (GdaValue *value); void gda_value_set_single (GdaValue *value, gfloat val); gshort gda_value_get_smallint (GdaValue *value); void gda_value_set_smallint (GdaValue *value, gshort val); const gchar* gda_value_get_string (GdaValue *value); void gda_value_set_string (GdaValue *value, const gchar *val); const GdaTime* gda_value_get_time (GdaValue *value); void gda_value_set_time (GdaValue *value, const GdaTime *val); const GdaTimestamp* gda_value_get_timestamp (GdaValue *value); void gda_value_set_timestamp (GdaValue *value, const GdaTimestamp *val); gchar gda_value_get_tinyint (GdaValue *value); void gda_value_set_tinyint (GdaValue *value, gchar val); GdaValueType gda_value_get_vtype (GdaValue *value); void gda_value_set_vtype (GdaValue *value, GdaValueType type); gboolean gda_value_set_from_string (GdaValue *value, const gchar *as_string, GdaValueType type); gboolean gda_value_set_from_value (GdaValue *value, const GdaValue *from); gint gda_value_compare (const GdaValue *value1, const GdaValue *value2); gchar* gda_value_stringify (GdaValue *value); xmlNodePtr gda_value_to_xml (GdaValue *value);
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_GOBJECT, GDA_VALUE_TYPE_INTEGER, GDA_VALUE_TYPE_LIST, GDA_VALUE_TYPE_MONEY, 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_TYPE, GDA_VALUE_TYPE_UNKNOWN } GdaValueType;
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; gpointer v_binary; 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; gchar *v_string; GdaTime v_time; GdaTimestamp v_timestamp; gchar v_tinyint; GdaValueType v_type; } value; glong binary_length; } GdaValue;
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.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_binary (gconstpointer val, glong size);
Make a new GdaValue of type GDA_VALUE_TYPE_BINARY with value val.
val : | value to set for the new GdaValue. |
size : | |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_boolean (gboolean val);
Make a new GdaValue of type GDA_VALUE_TYPE_BOOLEAN with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_date (const GdaDate *val);
Make a new GdaValue of type GDA_VALUE_TYPE_DATE with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_double (gdouble val);
Make a new GdaValue of type GDA_VALUE_TYPE_DOUBLE with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_geometric_point (const GdaGeometricPoint *val);
Make a new GdaValue of type GDA_VALUE_TYPE_GEOMETRIC_POINT with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_gobject (const GObject *val);
Make a new GdaValue of type GDA_VALUE_TYPE_GOBJECT with value val.
val : | value to set for the new GdaValue. |
Returns : | the newly created GdaValue. |
GdaValue* gda_value_new_integer (gint val);
Make a new GdaValue of type GDA_VALUE_TYPE_INTEGER with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_list (const GdaValueList *val);
Make a new GdaValue of type GDA_VALUE_TYPE_LIST with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_numeric (const GdaNumeric *val);
Make a new GdaValue of type GDA_VALUE_TYPE_NUMERIC with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_single (gfloat val);
Make a new GdaValue of type GDA_VALUE_TYPE_SINGLE with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_smallint (gshort val);
Make a new GdaValue of type GDA_VALUE_TYPE_SMALLINT with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_string (const gchar *val);
Make a new GdaValue of type GDA_VALUE_TYPE_STRING with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_time (const GdaTime *val);
Make a new GdaValue of type GDA_VALUE_TYPE_TIME with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_timestamp (const GdaTimestamp *val);
Make a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_timestamp_from_timet (time_t val);
Make a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val (of type time_t).
val : | value to set for the new GdaValue. |
Returns : | the newly created GdaValue. |
GdaValue* gda_value_new_tinyint (gchar val);
Make a new GdaValue of type GDA_VALUE_TYPE_TINYINT with value val.
val : | value to set for the new GdaValue. |
Returns : | The newly created GdaValue. |
GdaValue* gda_value_new_type (GdaValueType val);
Make a new GdaValue of type GDA_VALUE_TYPE_TYPE with value val.
val : | Value to set for the new GdaValue. |
Returns : | the newly created GdaValue. |
GdaValue* gda_value_new_from_string (const gchar *as_string, GdaValueType type);
Make a new GdaValue of type type from its string representation.
as_string : | stringified representation of the value. |
type : | tha new value type. |
Returns : | The newly created GdaValue or NULL if the string representation cannot be converted to the specified type. |
GdaValue* gda_value_new_from_xml (const xmlNodePtr node);
Create a GdaValue from a XML representation of it. That XML node corresponds to the following string representation: <value type="gdatype">value</value>
node : | |
Returns : | The newly created GdaValue. |
void gda_value_free (GdaValue *value);
Deallocates all memory associated to a GdaValue.
value : | the resource to free. |
GdaValueType gda_value_get_type (GdaValue *value);
Retrieve the type of the given value.
value : | value to get the type from. |
Returns : | the GdaValueType of the value. |
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. |
gboolean gda_value_is_number (GdaValue *value);
Get whether the value stored in the given GdaValue is of numeric type or not.
value : | a GdaValue. |
Returns : | TRUE if a number, FALSE otherwise. |
GdaValue* gda_value_copy (const 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, glong *size);
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
size : | holder for length of data. |
Returns : | the value contained in value. |
void gda_value_set_binary (GdaValue *value, gconstpointer val, glong size);
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, const 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, const GdaGeometricPoint *val);
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GObject* gda_value_get_gobject (GdaValue *value);
Gets the value stored in value.
value : | a GdaValue whose value we want to get. |
Returns : |
|
void gda_value_set_gobject (GdaValue *value, const GObject *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, const 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. |
const GdaMoney* gda_value_get_money (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_money (GdaValue *value, const GdaMoney *val);
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
const GdaNumeric* gda_value_get_numeric (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_numeric (GdaValue *value, const GdaNumeric *val);
Stores val into value.
value : | a GdaValue that will store val. |
val : | value to be stored in value. |
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, const 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, const 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. |
GdaValueType gda_value_get_vtype (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_vtype (GdaValue *value, GdaValueType type);
Stores type into value.
value : | a GdaValue that will store type. |
type : | value to be stored in 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 val. |
as_string : | the stringified representation of the value. |
type : | the type of the value |
Returns : | TRUE if the value has been properly converted to type from its string representation. FALSE otherwise. |
gboolean gda_value_set_from_value (GdaValue *value, const GdaValue *from);
Set 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.
value : | a GdaValue. |
from : | the value to copy from. |
Returns : | TRUE if successful, FALSE otherwise. |
gint gda_value_compare (const GdaValue *value1, const GdaValue *value2);
Compares two values of the <b>same</b> type.
value1 : | a GdaValue to compare. |
value2 : | the other GdaValue to be compared to value1. |
Returns : | if both values have the same time, return 0 if both contains the same value, an integer less than 0 if value1 is less than value2 or an integer greater than 0 if value1 is greater than value2. |
gchar* gda_value_stringify (GdaValue *value);
Converts a GdaValue to its string representation as indicated by this table:
value : | a GdaValue. |
Returns : | a string formatted according to the printf() style indicated in the preceding table. |
<<< gda-util | GdaXmlConnection >>> |