GdaValue

GdaValue — Single value stored in a GdaDataModel

Synopsis




enum        GdaValueType;
            GdaDate;
            GdaGeometricPoint;
            GdaMoney;
            GdaNumeric;
            GdaTime;
            GdaTimestamp;
            GdaBinary;
typedef     GdaValueList;
typedef     GdaValue;
GdaValue*   gda_value_new_null              (void);
GdaValue*   gda_value_new_bigint            (gint64 val);
GdaValue*   gda_value_new_biguint           (guint64 val);
GdaValue*   gda_value_new_binary            (guchar *val,
                                             glong size);
gpointer    gda_binary_copy                 (gpointer boxed);
void        gda_binary_free                 (gpointer boxed);
GdaValue*   gda_value_new_boolean           (gboolean val);
GdaValue*   gda_value_new_date              (const GdaDate *val);
gpointer    gda_date_copy                   (gpointer boxed);
void        gda_date_free                   (gpointer boxed);
GdaValue*   gda_value_new_double            (gdouble val);
GdaValue*   gda_value_new_geometric_point   (const GdaGeometricPoint *val);
gpointer    gda_geometricpoint_copy         (gpointer boxed);
void        gda_geometricpoint_free         (gpointer boxed);
GdaValue*   gda_value_new_gobject           (const GObject *val);
GdaValue*   gda_value_new_integer           (gint val);
GdaValue*   gda_value_new_uinteger          (guint val);
GdaValue*   gda_value_new_list              (const GdaValueList *val);
GdaValue*   gda_value_new_money             (const GdaMoney *val);
gpointer    gda_money_copy                  (gpointer boxed);
void        gda_money_free                  (gpointer boxed);
GdaValue*   gda_value_new_numeric           (const GdaNumeric *val);
gpointer    gda_numeric_copy                (gpointer boxed);
void        gda_numeric_free                (gpointer boxed);
GdaValue*   gda_value_new_single            (gfloat val);
GdaValue*   gda_value_new_smallint          (gshort val);
GdaValue*   gda_value_new_smalluint         (gushort val);
GdaValue*   gda_value_new_string            (const gchar *val);
GdaValue*   gda_value_new_time              (const GdaTime *val);
gpointer    gda_time_copy                   (gpointer boxed);
void        gda_time_free                   (gpointer boxed);
GdaValue*   gda_value_new_timestamp         (const GdaTimestamp *val);
gpointer    gda_timestamp_copy              (gpointer boxed);
void        gda_timestamp_free              (gpointer boxed);
GdaValue*   gda_value_new_timestamp_from_timet
                                            (time_t val);
GdaValue*   gda_value_new_tinyint           (gchar val);
GdaValue*   gda_value_new_tinyuint          (guchar val);
GdaValue*   gda_value_new_gdatype           (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);
void        gda_value_reset_with_type       (GdaValue *value,
                                             GdaValueType type);
gboolean    gda_value_is_null               (GdaValue *value);
gboolean    gda_value_is_number             (GdaValue *value);
#define     gda_value_isa                   (value, type)
GdaValue*   gda_value_copy                  (GdaValue *value);
gint64      gda_value_get_bigint            (GdaValue *value);
void        gda_value_set_bigint            (GdaValue *value,
                                             gint64 val);
guint64     gda_value_get_biguint           (GdaValue *value);
void        gda_value_set_biguint           (GdaValue *value,
                                             guint64 val);
const GdaBinary* gda_value_get_binary       (GdaValue *value);
void        gda_value_set_binary            (GdaValue *value,
                                             const GdaBinary *binary);
const GdaBlob* gda_value_get_blob           (GdaValue *value);
void        gda_value_set_blob              (GdaValue *value,
                                             const GdaBlob *val);
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);
const GdaMoney* gda_value_get_money         (GdaValue *value);
void        gda_value_set_money             (GdaValue *value,
                                             const GdaMoney *val);
void        gda_value_set_null              (GdaValue *value);
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);
gushort     gda_value_get_smalluint         (GdaValue *value);
void        gda_value_set_smalluint         (GdaValue *value,
                                             gushort 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);
guchar      gda_value_get_tinyuint          (GdaValue *value);
void        gda_value_set_tinyuint          (GdaValue *value,
                                             guchar val);
guint       gda_value_get_uinteger          (GdaValue *value);
void        gda_value_set_uinteger          (GdaValue *value,
                                             guint val);
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);
gchar*      gda_value_stringify             (GdaValue *value);
gint        gda_value_compare               (GdaValue *value1,
                                             GdaValue *value2);
gint        gda_value_compare_ext           (GdaValue *value1,
                                             GdaValue *value2);
xmlNodePtr  gda_value_to_xml                (GdaValue *value);
GdaValueType gda_value_get_gdatype          (GValue *value);
void        gda_value_set_gdatype           (GValue *value,
                                             GdaValueType val);
GdaValueType gda_value_convert_gtype_to_gdatype
                                            (GType type);
GType       gda_value_convert_gdatype_to_gtype
                                            (GdaValueType type);
gchar*      gda_binary_to_string            (const GdaBinary *bin,
                                             guint maxlen);
gboolean    gda_string_to_binary            (const gchar *str,
                                             GdaBinary *bin);
gboolean    gda_value_type_transformable    (GdaValueType src_type,
                                             GdaValueType dest_type,
                                             gboolean strict);
gboolean    gda_value_transform             (const GdaValue *src,
                                             GdaValue *dest);

Description

libgda manages each individual value within an opaque GdaValue structure (which is in fact a GValue). Each GdaValue has a pre-defined type which is among the GdaValueType possible types.

The NULL value is a special case value. It corresponds to a zero-filled (uninitialized) GValue, and it is safe to use such values.

Details

enum GdaValueType

typedef enum {
	GDA_VALUE_TYPE_NULL,
	GDA_VALUE_TYPE_BIGINT,
	GDA_VALUE_TYPE_BIGUINT,
	GDA_VALUE_TYPE_BINARY,
	GDA_VALUE_TYPE_BLOB,

	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_SMALLUINT,
	GDA_VALUE_TYPE_STRING,
	GDA_VALUE_TYPE_TIME,
	GDA_VALUE_TYPE_TIMESTAMP,

	GDA_VALUE_TYPE_TINYINT,
	GDA_VALUE_TYPE_TINYUINT,
	GDA_VALUE_TYPE_TYPE,
        GDA_VALUE_TYPE_UINTEGER,
	GDA_VALUE_TYPE_UNKNOWN
} GdaValueType;

GDA_VALUE_TYPE_NULL represents a NULL value
GDA_VALUE_TYPE_BIGINT signed integer guaranteed to be 64 bits on all platforms on which it is available (see G_HAVE_GINT64). Values of this type can range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
GDA_VALUE_TYPE_BIGUINT unsigned integer guaranteed to be 64 bits on all platforms on which it is available (see G_HAVE_GINT64). Values of this type can range from 0 to 18,446,744,073,709,551,615.
GDA_VALUE_TYPE_BINARY represents binary data: a buffer and its length
GDA_VALUE_TYPE_BLOB To be removed
GDA_VALUE_TYPE_BOOLEAN standard boolean type
GDA_VALUE_TYPE_DATE date type (Year, month, day)
GDA_VALUE_TYPE_DOUBLE standard C double type
GDA_VALUE_TYPE_GEOMETRIC_POINT a 2D point (x, y)
GDA_VALUE_TYPE_GOBJECT fundamental type for GObject
GDA_VALUE_TYPE_INTEGER standard C int type
GDA_VALUE_TYPE_LIST a list (GList) of GdaValue values
GDA_VALUE_TYPE_MONEY type to hold money values (a currency and a value as a double)
GDA_VALUE_TYPE_NUMERIC arbitrary precision numerical value (string plus precision and width)
GDA_VALUE_TYPE_SINGLE standard C float type
GDA_VALUE_TYPE_SMALLINT standard C short type
GDA_VALUE_TYPE_SMALLUINT standard C unsigned short type
GDA_VALUE_TYPE_STRING a string (0 terminated array of characters)
GDA_VALUE_TYPE_TIME time type (HH:MM:SS)
GDA_VALUE_TYPE_TIMESTAMP date and time type
GDA_VALUE_TYPE_TINYINT standard C char type
GDA_VALUE_TYPE_TINYUINT standard C unsigned char type
GDA_VALUE_TYPE_TYPE value which represents a GdaValueType
GDA_VALUE_TYPE_UINTEGER standard C unsigned int type
GDA_VALUE_TYPE_UNKNOWN undefined data type, can't be instanciated as it represents an error

GdaDate

typedef struct {
	gshort year;
	gushort month;
	gushort day;
} GdaDate;


GdaGeometricPoint

typedef struct {
	gdouble x;
	gdouble y;
} GdaGeometricPoint;


GdaMoney

typedef struct {
	gchar *currency;
	gdouble amount;
} GdaMoney;


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;


GdaBinary

typedef struct {
	guchar *data;
	glong  binary_length;
} GdaBinary;


GdaValueList

typedef GList GdaValueList;


GdaValue

typedef GValue GdaValue;


gda_value_new_null ()

GdaValue*   gda_value_new_null              (void);

Makes a new GdaValue of type GDA_VALUE_TYPE_NULL.

Returns : the newly created GdaValue.

gda_value_new_bigint ()

GdaValue*   gda_value_new_bigint            (gint64 val);

Makes 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.

gda_value_new_biguint ()

GdaValue*   gda_value_new_biguint           (guint64 val);

Makes a new GdaValue of type GDA_VALUE_TYPE_BIGUINT with value val.

val : value to set for the new GdaValue.
Returns : the newly created GdaValue.

gda_value_new_binary ()

GdaValue*   gda_value_new_binary            (guchar *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 val.
Returns : the newly created GdaValue.

gda_binary_copy ()

gpointer    gda_binary_copy                 (gpointer boxed);

Creates a new GdaBinary structure from an existing one.

boxed :
Returns : a newly allocated GdaBinary which contains a copy of information in src.

gda_binary_free ()

void        gda_binary_free                 (gpointer boxed);

Deallocates all memory associated to the given GdaBinary.

boxed : GdaBinary to free.

gda_value_new_boolean ()

GdaValue*   gda_value_new_boolean           (gboolean val);

Makes 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.

gda_value_new_date ()

GdaValue*   gda_value_new_date              (const GdaDate *val);

Makes 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.

gda_date_copy ()

gpointer    gda_date_copy                   (gpointer boxed);

boxed :
Returns :

gda_date_free ()

void        gda_date_free                   (gpointer boxed);

boxed :

gda_value_new_double ()

GdaValue*   gda_value_new_double            (gdouble val);

Makes 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.

gda_value_new_geometric_point ()

GdaValue*   gda_value_new_geometric_point   (const GdaGeometricPoint *val);

Makes 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.

gda_geometricpoint_copy ()

gpointer    gda_geometricpoint_copy         (gpointer boxed);

boxed :
Returns :

gda_geometricpoint_free ()

void        gda_geometricpoint_free         (gpointer boxed);

boxed :

gda_value_new_gobject ()

GdaValue*   gda_value_new_gobject           (const GObject *val);

Makes 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.

gda_value_new_integer ()

GdaValue*   gda_value_new_integer           (gint val);

Makes 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.

gda_value_new_uinteger ()

GdaValue*   gda_value_new_uinteger          (guint val);

Makes a new GdaValue of type GDA_VALUE_TYPE_UINTEGER with value val.

val : value to set for the new GdaValue.
Returns : the newly created GdaValue.

gda_value_new_list ()

GdaValue*   gda_value_new_list              (const GdaValueList *val);

Makes 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.

gda_value_new_money ()

GdaValue*   gda_value_new_money             (const GdaMoney *val);

val :
Returns :

gda_money_copy ()

gpointer    gda_money_copy                  (gpointer boxed);

Creates a new GdaMoney structure from an existing one.

boxed :
Returns : a newly allocated GdaMoney which contains a copy of information in src.

gda_money_free ()

void        gda_money_free                  (gpointer boxed);

Deallocates all memory associated to the given GdaMoney.

boxed :

gda_value_new_numeric ()

GdaValue*   gda_value_new_numeric           (const GdaNumeric *val);

Makes 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.

gda_numeric_copy ()

gpointer    gda_numeric_copy                (gpointer boxed);

Creates a new GdaNumeric structure from an existing one.

boxed :
Returns : a newly allocated GdaNumeric which contains a copy of information in src.

gda_numeric_free ()

void        gda_numeric_free                (gpointer boxed);

Deallocates all memory associated to the given boxed

boxed :

gda_value_new_single ()

GdaValue*   gda_value_new_single            (gfloat val);

Makes 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.

gda_value_new_smallint ()

GdaValue*   gda_value_new_smallint          (gshort val);

Makes 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.

gda_value_new_smalluint ()

GdaValue*   gda_value_new_smalluint         (gushort val);

Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLUINT with value val.

val : value to set for the new GdaValue.
Returns : the newly created GdaValue.

gda_value_new_string ()

GdaValue*   gda_value_new_string            (const gchar *val);

Makes 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.

gda_value_new_time ()

GdaValue*   gda_value_new_time              (const GdaTime *val);

val :
Returns :

gda_time_copy ()

gpointer    gda_time_copy                   (gpointer boxed);

boxed :
Returns :

gda_time_free ()

void        gda_time_free                   (gpointer boxed);

boxed :

gda_value_new_timestamp ()

GdaValue*   gda_value_new_timestamp         (const GdaTimestamp *val);

Makes 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.

gda_timestamp_copy ()

gpointer    gda_timestamp_copy              (gpointer boxed);

boxed :
Returns :

gda_timestamp_free ()

void        gda_timestamp_free              (gpointer boxed);

boxed :

gda_value_new_timestamp_from_timet ()

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).

val : value to set for the new GdaValue.
Returns : the newly created GdaValue.

gda_value_new_tinyint ()

GdaValue*   gda_value_new_tinyint           (gchar val);

Makes 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.

gda_value_new_tinyuint ()

GdaValue*   gda_value_new_tinyuint          (guchar val);

Makes a new GdaValue of type GDA_VALUE_TYPE_TINYUINT with value val.

val : value to set for the new GdaValue.
Returns : the newly created GdaValue.

gda_value_new_gdatype ()

GdaValue*   gda_value_new_gdatype           (GdaValueType val);

Makes 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.

gda_value_new_from_string ()

GdaValue*   gda_value_new_from_string       (const gchar *as_string,
                                             GdaValueType type);

Makes a new GdaValue of type type from its string representation.

as_string : stringified representation of the value.
type : the new value type.
Returns : the newly created GdaValue or NULL if the string representation cannot be converted to the specified type.

gda_value_new_from_xml ()

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>

node : a XML node representing the value.
Returns : the newly created GdaValue.

gda_value_free ()

void        gda_value_free                  (GdaValue *value);

Deallocates all memory associated to a GdaValue.

value : the resource to free.

gda_value_reset_with_type ()

void        gda_value_reset_with_type       (GdaValue *value,
                                             GdaValueType type);

value :
type :

gda_value_is_null ()

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.

gda_value_is_number ()

gboolean    gda_value_is_number             (GdaValue *value);

Gets whether the value stored in the given GdaValue is of numeric type or not.

value : a GdaValue.
Returns : TRUE if a number, FALSE otherwise.

gda_value_isa()

#define gda_value_isa(value, type) (gda_value_get_type (value) == type)

value :
type :

gda_value_copy ()

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.

gda_value_get_bigint ()

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.

gda_value_set_bigint ()

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.

gda_value_get_biguint ()

guint64     gda_value_get_biguint           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_biguint ()

void        gda_value_set_biguint           (GdaValue *value,
                                             guint64 val);

Stores val into value.

value : a GdaValue that will store val.
val : value to be stored in value.

gda_value_get_binary ()

const GdaBinary* gda_value_get_binary       (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_binary ()

void        gda_value_set_binary            (GdaValue *value,
                                             const GdaBinary *binary);

Stores val into value.

value : a GdaValue that will store val.
binary : a GdaBinary structure with the data and its size to be stored in value.

gda_value_get_blob ()

const GdaBlob* gda_value_get_blob           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_blob ()

void        gda_value_set_blob              (GdaValue *value,
                                             const GdaBlob *val);

Stores val into value.

value : a GdaValue that will store val.
val : value to be stored in value.

gda_value_get_boolean ()

gboolean    gda_value_get_boolean           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_boolean ()

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.

gda_value_get_date ()

const GdaDate* gda_value_get_date           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_date ()

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.

gda_value_get_double ()

gdouble     gda_value_get_double            (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_double ()

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.

gda_value_get_geometric_point ()

const GdaGeometricPoint* gda_value_get_geometric_point
                                            (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_geometric_point ()

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.

gda_value_get_gobject ()

const GObject* gda_value_get_gobject        (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_gobject ()

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.

gda_value_get_integer ()

gint        gda_value_get_integer           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_integer ()

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.

gda_value_get_list ()

const GdaValueList* gda_value_get_list      (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_list ()

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.

gda_value_get_money ()

const GdaMoney* gda_value_get_money         (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_money ()

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.

gda_value_set_null ()

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.

gda_value_get_numeric ()

const GdaNumeric* gda_value_get_numeric     (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_numeric ()

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.

gda_value_get_single ()

gfloat      gda_value_get_single            (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_single ()

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.

gda_value_get_smallint ()

gshort      gda_value_get_smallint          (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_smallint ()

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.

gda_value_get_smalluint ()

gushort     gda_value_get_smalluint         (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_smalluint ()

void        gda_value_set_smalluint         (GdaValue *value,
                                             gushort val);

Stores val into value.

value : a GdaValue that will store val.
val : value to be stored in value.

gda_value_get_string ()

const gchar* gda_value_get_string           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_string ()

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.

gda_value_get_time ()

const GdaTime* gda_value_get_time           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_time ()

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.

gda_value_get_timestamp ()

const GdaTimestamp* gda_value_get_timestamp (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_timestamp ()

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.

gda_value_get_tinyint ()

gchar       gda_value_get_tinyint           (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_tinyint ()

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.

gda_value_get_tinyuint ()

guchar      gda_value_get_tinyuint          (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_tinyuint ()

void        gda_value_set_tinyuint          (GdaValue *value,
                                             guchar val);

Stores val into value.

value : a GdaValue that will store val.
val : value to be stored in value.

gda_value_get_uinteger ()

guint       gda_value_get_uinteger          (GdaValue *value);

value : a GdaValue whose value we want to get.
Returns : the value stored in value.

gda_value_set_uinteger ()

void        gda_value_set_uinteger          (GdaValue *value,
                                             guint val);

Stores val into value.

value : a GdaValue that will store val.
val : value to be stored in value.

gda_value_set_from_string ()

gboolean    gda_value_set_from_string       (GdaValue *value,
                                             const gchar *as_string,
                                             GdaValueType type);

value :
as_string :
type :
Returns :

gda_value_set_from_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.

value : a GdaValue.
from : the value to copy from.
Returns : TRUE if successful, FALSE otherwise.

gda_value_stringify ()

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. Free the value with a g_free() when you've finished using it.

gda_value_compare ()

gint        gda_value_compare               (GdaValue *value1,
                                             GdaValue *value2);

Compares two values of the same type.

value1 : a GdaValue to compare.
value2 : the other GdaValue to be compared to value1.
Returns : if both values have the same type, returns 0 if both contain 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.

gda_value_compare_ext ()

gint        gda_value_compare_ext           (GdaValue *value1,
                                             GdaValue *value2);

Like gda_value_compare(), compares two values of the same type, except that NULL values and values of type GDA_VALUE_TYPE_NULL are considered equals

value1 : a GdaValue to compare.
value2 : the other GdaValue to be compared to value1.
Returns : 0 if both contain 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.

gda_value_to_xml ()

xmlNodePtr  gda_value_to_xml                (GdaValue *value);

Serializes the given GdaValue to a XML node string.

value : a GdaValue.
Returns : the XML node. Once not needed anymore, you should free it.

gda_value_get_gdatype ()

GdaValueType gda_value_get_gdatype          (GValue *value);

value :
Returns :

gda_value_set_gdatype ()

void        gda_value_set_gdatype           (GValue *value,
                                             GdaValueType val);

value :
val :

gda_value_convert_gtype_to_gdatype ()

GdaValueType gda_value_convert_gtype_to_gdatype
                                            (GType type);

As a GdaValue is a GValue, all the GValue functions returning information on the type of value stored in the GdaValue will return a GType which can be converted into a GdaValueType.

Converts type to the corresponding GdaValueType. This function does the opposite of the gda_value_convert_gdatype_to_gtype() function.

type : a GType type
Returns : the converted type.

gda_value_convert_gdatype_to_gtype ()

GType       gda_value_convert_gdatype_to_gtype
                                            (GdaValueType type);

Converts type to its GType equivalent. This function does the opposite of the gda_value_convert_gtype_to_gdatype() function. See the gda_value_convert_gtype_to_gdatype() function's documentation for more information.

type : a GdaValueType
Returns : the converted type.

gda_binary_to_string ()

gchar*      gda_binary_to_string            (const GdaBinary *bin,
                                             guint maxlen);

Converts all the non printable characters of bin->data into the \xxx representation where xxx is the octal representation of the byte, and the '\' (backslash) character is converted to "\\".

bin : a correctly filled GdaBinary structure
maxlen : a maximum len used to truncate, or 0 for no maximum length
Returns : a new string from bin

gda_string_to_binary ()

gboolean    gda_string_to_binary            (const gchar *str,
                                             GdaBinary *bin);

Performs the reverse of gda_binary_to_string().

str : a string to convert
bin : a non filled GdaBinary structure
Returns : TRUE if no error were found in str, or FALSE otherwise

gda_value_type_transformable ()

gboolean    gda_value_type_transformable    (GdaValueType src_type,
                                             GdaValueType dest_type,
                                             gboolean strict);

Check whether gda_value_transform() is able to transform GDA values of type src_type into GDA values of type dest_type.

If strict is TRUE, then the returned value is conservative in the way that it is ensured that transformations will _always_ work, depending on the actual values. On the contrary if strict is FALSE, then the transformations may fail even thouh this function returns TRUE depending on the actual values being converted.

src_type : source GDA type
dest_type : target GDA type
strict :
Returns : TRUE if the transformation is possible, FALSE otherwise.

gda_value_transform ()

gboolean    gda_value_transform             (const GdaValue *src,
                                             GdaValue *dest);

Tries to cast the contents of src_value into a GDA type appropriate to store in dest_value. Note that on the contrary to g_value_transform(), performing transformations between values will be done only if there is no data loss.

src : source value
dest : target value (to modify)
Returns : Whether a transformation rule was found and could be applied. Upon failing transformations, dest_value may have been changed and should not be used.